Skip to content

Commit d918cd4

Browse files
authored
Merge pull request #32666 from barttom/refactor/30442/varification-step
Refactor/30442/varification step
2 parents 0bcce1e + 5467681 commit d918cd4

File tree

16 files changed

+501
-348
lines changed

16 files changed

+501
-348
lines changed

src/CONST.ts

+8
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,14 @@ const CONST = {
260260
EXIT: 'EXIT',
261261
},
262262
},
263+
COMPLETE_VERIFICATION: {
264+
INPUT_KEY: {
265+
BANK_ACCOUNT_ID: 'bankAccountID',
266+
IS_AUTHORIZED_TO_USE_BANK_ACCOUNT: 'isAuthorizedToUseBankAccount',
267+
CERTIFY_TRUE_INFORMATION: 'certifyTrueInformation',
268+
ACCEPT_TERMS_AND_CONDITIONS: 'acceptTermsAndConditions',
269+
},
270+
},
263271
ERROR: {
264272
MISSING_ROUTING_NUMBER: '402 Missing routingNumber',
265273
MAX_ROUTING_NUMBER: '402 Maximum Size Exceeded routingNumber',

src/languages/en.ts

+21-2
Original file line numberDiff line numberDiff line change
@@ -1535,10 +1535,29 @@ export default {
15351535
confirmAgreements: 'Please confirm the agreements below.',
15361536
certifyTrueAndAccurate: 'I certify that the information provided is true and accurate',
15371537
certifyTrueAndAccurateError: 'Must certify information is true and accurate',
1538-
isControllingOfficer: 'I am authorized to use my company bank account for business spend',
1539-
isControllingOfficerError: 'You must be a controlling officer with authorization to operate the business bank account.',
1538+
isAuthorizedToUseBankAccount: 'I am authorized to use my company bank account for business spend',
1539+
isAuthorizedToUseBankAccountError: 'You must be a controlling officer with authorization to operate the business bank account.',
15401540
termsAndConditions: 'terms and conditions',
15411541
},
1542+
connectBankAccountStep: {
1543+
connectBankAccount: 'Connect bank account',
1544+
finishButtonText: 'Finish setup',
1545+
validateYourBankAccount: 'Validate your bank account',
1546+
validateButtonText: 'Validate',
1547+
validationInputLabel: 'Transaction',
1548+
maxAttemptsReached: 'Validation for this bank account has been disabled due to too many incorrect attempts.',
1549+
description: 'A day or two after you add your account to Expensify we send three (3) transactions to your account. They have a merchant line like "Expensify, Inc. Validation".',
1550+
descriptionCTA: 'Please enter each transaction amount in the fields below. Example: 1.51.',
1551+
reviewingInfo: "Thanks! We're reviewing your information, and will be in touch shortly. Please check your chat with Concierge ",
1552+
forNextSteps: ' for next steps to finish setting up your bank account.',
1553+
letsChatCTA: "Yes, let's chat",
1554+
letsChatText: 'Thanks for doing that. We need your help verifying a few pieces of information, but we can work this out quickly over chat. Ready?',
1555+
letsChatTitle: "Let's chat!",
1556+
enable2FATitle: 'Prevent fraud, enable two-factor authentication!',
1557+
enable2FAText:
1558+
'We take your security seriously, so please set up two-factor authentication for your account now. That will allow us to dispute Expensify Card digital transactions, and will reduce your risk for fraud.',
1559+
secureYourAccount: 'Secure your account',
1560+
},
15421561
reimbursementAccountLoadingAnimation: {
15431562
oneMoment: 'One moment',
15441563
explanationLine: 'We’re taking a look at your information. You will be able to continue with next steps shortly.',

src/languages/es.ts

+27-7
Original file line numberDiff line numberDiff line change
@@ -1554,13 +1554,33 @@ export default {
15541554
},
15551555
},
15561556
completeVerificationStep: {
1557-
completeVerification: 'Complete verification',
1558-
confirmAgreements: 'Please confirm the agreements below.',
1559-
certifyTrueAndAccurate: 'I certify that the information provided is true and accurate',
1560-
certifyTrueAndAccurateError: 'Must certify information is true and accurate',
1561-
isControllingOfficer: 'I am authorized to use my company bank account for business spend',
1562-
isControllingOfficerError: 'You must be a controlling officer with authorization to operate the business bank account.',
1563-
termsAndConditions: 'terms and conditions',
1557+
completeVerification: 'Completar la verificación',
1558+
confirmAgreements: 'Por favor, confirma los Acuerdos a continuación.',
1559+
certifyTrueAndAccurate: 'Certifico que la información dada es verdadera y precisa',
1560+
certifyTrueAndAccurateError: 'Debe certificar que la información es verdadera y precisa',
1561+
isAuthorizedToUseBankAccount: 'Estoy autorizado para usar la cuenta bancaria de mi empresa para gastos comerciales',
1562+
isAuthorizedToUseBankAccountError: 'Debes ser un oficial controlador con autorización para operar la cuenta bancaria de la empresa.',
1563+
termsAndConditions: 'Términos y Condiciones',
1564+
},
1565+
connectBankAccountStep: {
1566+
connectBankAccount: 'Conectar cuenta bancaria',
1567+
finishButtonText: 'Finalizar configuración',
1568+
validateYourBankAccount: 'Valida tu cuenta bancaria',
1569+
validateButtonText: 'Validar',
1570+
validationInputLabel: 'Transacción',
1571+
maxAttemptsReached: 'La validación para esta cuenta bancaria se ha desactivado debido a demasiados intentos incorrectos.',
1572+
description:
1573+
'Un día o dos después de agregar tu cuenta a Expensify, enviamos tres (3) transacciones a tu cuenta. Tienen un nombre de comerciante similar a "Expensify, Inc. Validation".',
1574+
descriptionCTA: 'Ingresa el importe de cada transacción en los campos a continuación. Ejemplo: 1.51.',
1575+
reviewingInfo: '¡Gracias! Estamos revisando tu información y nos comunicaremos contigo en breve. Consulta el chat con Concierge ',
1576+
forNextSteps: ' para conocer los próximos pasos para terminar de configurar tu cuenta bancaria.',
1577+
letsChatCTA: 'Sí, vamos a chatear',
1578+
letsChatText: 'Gracias. Necesitamos tu ayuda para verificar la información, pero podemos resolver esto rápidamente a través del chat. ¿Estás Listo?',
1579+
letsChatTitle: '¡Vamos a chatear!',
1580+
enable2FATitle: '¡Evita fraudes, habilita la autenticación de dos factores!',
1581+
enable2FAText:
1582+
'Tu seguridad es importante para nosotros. Por favor, configura ahora la autenticación de dos factores. Eso nos permitirá disputar las transacciones de la Tarjeta Expensify y reducirá tu riesgo de fraude.',
1583+
secureYourAccount: 'Asegura tu cuenta',
15641584
},
15651585
reimbursementAccountLoadingAnimation: {
15661586
oneMoment: 'Un momento',

src/pages/ReimbursementAccount/ACHContractStep.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,15 @@ const propTypes = {
1313

1414
function ACHContractStep({onBackButtonPress, onCloseButtonPress}) {
1515
const [isBeneficialOwnerInfoSet, setIsBeneficialOwnerInfoSet] = useState(false);
16+
const handleCompleteVerificationBackButtonPress = () => setIsBeneficialOwnerInfoSet(false);
1617

1718
if (isBeneficialOwnerInfoSet) {
18-
return <CompleteVerification setIsBeneficialOwnerInfoSet={setIsBeneficialOwnerInfoSet} />;
19+
return (
20+
<CompleteVerification
21+
onBackButtonPress={handleCompleteVerificationBackButtonPress}
22+
onCloseButtonPress={onCloseButtonPress}
23+
/>
24+
);
1925
}
2026

2127
return (

src/pages/ReimbursementAccount/BankInfo/substeps/Confirmation.js

+11-10
Original file line numberDiff line numberDiff line change
@@ -73,21 +73,23 @@ function Confirmation({reimbursementAccount, reimbursementAccountDraft, onNext})
7373
>
7474
<ScrollView contentContainerStyle={styles.flexGrow1}>
7575
<Text style={[styles.textHeadline, styles.ph5, styles.mb6]}>{translate('bankAccount.letsDoubleCheck')}</Text>
76-
<View style={[styles.confirmBankInfoCard]}>
76+
<View style={[styles.cardSection]}>
7777
{setupType === CONST.BANK_ACCOUNT.SUBSTEP.MANUAL && (
78-
<View style={[styles.mb5]}>
78+
<View style={[styles.mb5, styles.flexRow, styles.alignItemsCenter]}>
7979
<Icon
8080
src={Expensicons.Bank}
81-
additionalStyles={[styles.confirmBankInfoCompanyIcon, styles.mb5]}
81+
additionalStyles={[styles.confirmBankInfoCompanyIcon, styles.mr3]}
8282
fill={theme.iconHovered}
8383
/>
84-
<View style={[styles.mb3]}>
85-
<Text style={[styles.mutedTextLabel, styles.mb1]}>{translate('bankAccount.routingNumber')}</Text>
86-
<Text style={styles.confirmBankInfoNumber}>{values[bankInfoStepKeys.ROUTING_NUMBER]}</Text>
87-
</View>
8884
<View>
89-
<Text style={[styles.mutedTextLabel, styles.mb1]}>{translate('bankAccount.accountNumber')}</Text>
90-
<Text style={styles.confirmBankInfoNumber}>{values[bankInfoStepKeys.ACCOUNT_NUMBER]}</Text>
85+
<View style={[styles.mb3]}>
86+
<Text style={[styles.mutedTextLabel, styles.mb1]}>{translate('bankAccount.routingNumber')}</Text>
87+
<Text style={styles.confirmBankInfoNumber}>{values[bankInfoStepKeys.ROUTING_NUMBER]}</Text>
88+
</View>
89+
<View>
90+
<Text style={[styles.mutedTextLabel, styles.mb1]}>{translate('bankAccount.accountNumber')}</Text>
91+
<Text style={styles.confirmBankInfoNumber}>{values[bankInfoStepKeys.ACCOUNT_NUMBER]}</Text>
92+
</View>
9193
</View>
9294
</View>
9395
)}
@@ -105,7 +107,6 @@ function Confirmation({reimbursementAccount, reimbursementAccountDraft, onNext})
105107
<Text style={[styles.confirmBankInfoText, styles.mb4]}>{translate('bankAccount.thisBankAccount')}</Text>
106108
<MenuItem
107109
icon={Expensicons.Bank}
108-
titleStyle={[styles.confirmBankInfoText]}
109110
title={translate('bankAccount.connectDifferentAccount')}
110111
onPress={handleConnectDifferentAccount}
111112
shouldShowRightIcon

src/pages/ReimbursementAccount/BusinessInfo/BusinessInfo.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import {parsePhoneNumber} from 'awesome-phonenumber';
21
import lodashGet from 'lodash/get';
32
import PropTypes from 'prop-types';
43
import React, {useCallback, useMemo} from 'react';
@@ -11,6 +10,7 @@ import ScreenWrapper from '@components/ScreenWrapper';
1110
import useLocalize from '@hooks/useLocalize';
1211
import useSubStep from '@hooks/useSubStep';
1312
import useThemeStyles from '@hooks/useThemeStyles';
13+
import {parsePhoneNumber} from '@libs/PhoneNumber';
1414
import reimbursementAccountDraftPropTypes from '@pages/ReimbursementAccount/ReimbursementAccountDraftPropTypes';
1515
import {reimbursementAccountPropTypes} from '@pages/ReimbursementAccount/reimbursementAccountPropTypes';
1616
import * as ReimbursementAccountProps from '@pages/ReimbursementAccount/reimbursementAccountPropTypes';

src/pages/ReimbursementAccount/CompleteVerification/CompleteVerification.js

+19-10
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,11 @@ const propTypes = {
2525
/** The draft values of the bank account being setup */
2626
reimbursementAccountDraft: reimbursementAccountDraftPropTypes,
2727

28-
/** Changes variable responsible for displaying step 4 or 5 */
29-
setIsBeneficialOwnerInfoSet: PropTypes.func.isRequired,
28+
/** Handles back button press */
29+
onBackButtonPress: PropTypes.func.isRequired,
30+
31+
/** Exits flow and goes back to the workspace initial page */
32+
onCloseButtonPress: PropTypes.func.isRequired,
3033
};
3134

3235
const defaultProps = {
@@ -35,29 +38,33 @@ const defaultProps = {
3538
};
3639

3740
const BODY_CONTENT = [ConfirmAgreements];
38-
const PERSONAL_INFO_STEP_KEYS = CONST.BANK_ACCOUNT.PERSONAL_INFO_STEP.INPUT_KEY;
41+
const COMPLETE_VERIFICATION_KEYS = CONST.BANK_ACCOUNT.COMPLETE_VERIFICATION.INPUT_KEY;
42+
const BENEFICIAL_OWNER_INFO_STEP_KEYS = CONST.BANK_ACCOUNT.BENEFICIAL_OWNER_INFO_STEP.INPUT_KEY;
3943

40-
// This is a mocked step to showcase full transition between steps - will be removed with next PR
41-
const CompleteVerification = forwardRef(({reimbursementAccount, reimbursementAccountDraft, setIsBeneficialOwnerInfoSet}, ref) => {
44+
const CompleteVerification = forwardRef(({reimbursementAccount, reimbursementAccountDraft, onBackButtonPress, onCloseButtonPress}, ref) => {
4245
const {translate} = useLocalize();
4346
const styles = useThemeStyles();
4447

45-
const values = useMemo(() => getSubstepValues(PERSONAL_INFO_STEP_KEYS, reimbursementAccountDraft, reimbursementAccount), [reimbursementAccount, reimbursementAccountDraft]);
48+
const values = useMemo(() => getSubstepValues(COMPLETE_VERIFICATION_KEYS, reimbursementAccountDraft, reimbursementAccount), [reimbursementAccount, reimbursementAccountDraft]);
4649

4750
const submit = useCallback(() => {
4851
const payload = {
49-
bankAccountID: getDefaultValueForReimbursementAccountField(reimbursementAccount, PERSONAL_INFO_STEP_KEYS.BANK_ACCOUNT_ID, 0),
52+
bankAccountID: getDefaultValueForReimbursementAccountField(reimbursementAccount, COMPLETE_VERIFICATION_KEYS.BANK_ACCOUNT_ID, 0),
5053
...values,
5154
};
55+
const beneficialOwnersStepValues = getSubstepValues(BENEFICIAL_OWNER_INFO_STEP_KEYS, reimbursementAccountDraft, reimbursementAccount);
5256

53-
BankAccounts.updatePersonalInformationForBankAccount(payload);
54-
}, [reimbursementAccount, values]);
57+
BankAccounts.updateBeneficialOwnersForBankAccount({
58+
...beneficialOwnersStepValues,
59+
...payload,
60+
});
61+
}, [reimbursementAccount, reimbursementAccountDraft, values]);
5562

5663
const {componentToRender: SubStep, isEditing, screenIndex, nextScreen, prevScreen, moveTo} = useSubStep({bodyContent: BODY_CONTENT, startFrom: 0, onFinished: submit});
5764

5865
const handleBackButtonPress = () => {
5966
if (screenIndex === 0) {
60-
setIsBeneficialOwnerInfoSet(false);
67+
onBackButtonPress();
6168
} else {
6269
prevScreen();
6370
}
@@ -74,6 +81,8 @@ const CompleteVerification = forwardRef(({reimbursementAccount, reimbursementAcc
7481
<HeaderWithBackButton
7582
onBackButtonPress={handleBackButtonPress}
7683
title={translate('completeVerificationStep.completeVerification')}
84+
shouldShowCloseButton
85+
onCloseButtonPress={onCloseButtonPress}
7786
/>
7887
<View style={[styles.ph5, styles.mt3, {height: CONST.BANK_ACCOUNT.STEPS_HEADER_HEIGHT}]}>
7988
<InteractiveStepSubHeader

0 commit comments

Comments
 (0)