From e4bed60f2fe40ccd947d729537994bef7858335b Mon Sep 17 00:00:00 2001 From: Puneet Lath Date: Tue, 21 Sep 2021 14:04:42 -0400 Subject: [PATCH 1/4] update error message for bank transaction validation failure --- src/CONST.js | 1 + src/languages/en.js | 1 + src/languages/es.js | 1 + src/libs/actions/BankAccounts.js | 9 ++++++++- 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/CONST.js b/src/CONST.js index 9e9932cefcb0..02e5a9455b7a 100755 --- a/src/CONST.js +++ b/src/CONST.js @@ -28,6 +28,7 @@ const CONST = { MISSING_INCORPORATION_STATE: '402 Missing incorporationState in additionalData', MISSING_INCORPORATION_TYPE: '402 Missing incorporationType in additionalData', MAX_VALIDATION_ATTEMPTS_REACHED: 'Validation for this bank account has been disabled due to too many incorrect attempts. Please contact us.', + INCORRECT_VALIDATION_AMOUNTS: 'The validate code you entered is incorrect, please try again.', }, STEP: { // In the order they appear in the VBA flow diff --git a/src/languages/en.js b/src/languages/en.js index a37511d00a16..815209a4e3a5 100755 --- a/src/languages/en.js +++ b/src/languages/en.js @@ -414,6 +414,7 @@ export default { noDefaultDepositAccountOrDebitCardAvailable: 'Please add a default deposit bank account or debit card', fixTheErrors: 'fix the errors', inTheFormBeforeContinuing: 'in the form before continuing', + validationAmounts: 'The validation amounts you entered are incorrect. Please double-check your bank statement and try again.' }, }, addPersonalBankAccountPage: { diff --git a/src/languages/es.js b/src/languages/es.js index 6a14382bad6f..5d1bb682bbb1 100644 --- a/src/languages/es.js +++ b/src/languages/es.js @@ -414,6 +414,7 @@ export default { noDefaultDepositAccountOrDebitCardAvailable: 'Por favor agrega una cuenta bancaria para depósitos o una tarjeta de débito', fixTheErrors: 'corrige los errores', inTheFormBeforeContinuing: 'en el formulario antes de continuar', + validationAmounts: 'Los montos de la transacción de validación que ingresó son incorrectos. Vuelva a verificar su extracto bancario y vuelva a intentarlo.' }, }, addPersonalBankAccountPage: { diff --git a/src/libs/actions/BankAccounts.js b/src/libs/actions/BankAccounts.js index 37e32c27ba23..a0b0ddecf2dc 100644 --- a/src/libs/actions/BankAccounts.js +++ b/src/libs/actions/BankAccounts.js @@ -580,7 +580,14 @@ function validateBankAccount(bankAccountID, validateCode) { return; } - // We are generically showing any backend errors that might pop up in the validate step + // If the validation amounts entered were incorrect, show specific error + if (response.message === CONST.BANK_ACCOUNT.ERROR.INCORRECT_VALIDATION_AMOUNTS) { + showBankAccountErrorModal(translateLocal('bankAccount.error.validationAmounts')); + Onyx.merge(ONYXKEYS.REIMBURSEMENT_ACCOUNT, {loading: false}); + return; + } + + // We are generically showing any other backend errors that might pop up in the validate step showBankAccountErrorModal(response.message); Onyx.merge(ONYXKEYS.REIMBURSEMENT_ACCOUNT, {loading: false}); }); From 9bbbaeef9ddad1e933c5c2f8896fabe5c0cec43b Mon Sep 17 00:00:00 2001 From: Puneet Lath Date: Tue, 21 Sep 2021 14:09:26 -0400 Subject: [PATCH 2/4] fix missing comma in object --- src/languages/es.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/languages/es.js b/src/languages/es.js index 5d1bb682bbb1..a34e13e395d5 100644 --- a/src/languages/es.js +++ b/src/languages/es.js @@ -414,7 +414,7 @@ export default { noDefaultDepositAccountOrDebitCardAvailable: 'Por favor agrega una cuenta bancaria para depósitos o una tarjeta de débito', fixTheErrors: 'corrige los errores', inTheFormBeforeContinuing: 'en el formulario antes de continuar', - validationAmounts: 'Los montos de la transacción de validación que ingresó son incorrectos. Vuelva a verificar su extracto bancario y vuelva a intentarlo.' + validationAmounts: 'Los montos de la transacción de validación que ingresó son incorrectos. Vuelva a verificar su extracto bancario y vuelva a intentarlo.', }, }, addPersonalBankAccountPage: { From 8adf228ed5cd0c6541ca2991404baaf461e55b95 Mon Sep 17 00:00:00 2001 From: Puneet Lath Date: Tue, 21 Sep 2021 14:10:17 -0400 Subject: [PATCH 3/4] fix another missing comma in object --- src/languages/en.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/languages/en.js b/src/languages/en.js index 815209a4e3a5..d7ad54eef222 100755 --- a/src/languages/en.js +++ b/src/languages/en.js @@ -414,7 +414,7 @@ export default { noDefaultDepositAccountOrDebitCardAvailable: 'Please add a default deposit bank account or debit card', fixTheErrors: 'fix the errors', inTheFormBeforeContinuing: 'in the form before continuing', - validationAmounts: 'The validation amounts you entered are incorrect. Please double-check your bank statement and try again.' + validationAmounts: 'The validation amounts you entered are incorrect. Please double-check your bank statement and try again.', }, }, addPersonalBankAccountPage: { From c29904fa93b5e83c8c95d92565f06b56afb00b14 Mon Sep 17 00:00:00 2001 From: Puneet Lath Date: Tue, 21 Sep 2021 18:40:47 -0400 Subject: [PATCH 4/4] update spanish tranlation for bank validation error --- src/languages/es.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/languages/es.js b/src/languages/es.js index a34e13e395d5..99b3b7ceb785 100644 --- a/src/languages/es.js +++ b/src/languages/es.js @@ -414,7 +414,7 @@ export default { noDefaultDepositAccountOrDebitCardAvailable: 'Por favor agrega una cuenta bancaria para depósitos o una tarjeta de débito', fixTheErrors: 'corrige los errores', inTheFormBeforeContinuing: 'en el formulario antes de continuar', - validationAmounts: 'Los montos de la transacción de validación que ingresó son incorrectos. Vuelva a verificar su extracto bancario y vuelva a intentarlo.', + validationAmounts: 'Los montos de validación que ingresaste son incorrectos. Verifica tu cuenta de banco e intenta de nuevo.', }, }, addPersonalBankAccountPage: {