diff --git a/src/languages/en.ts b/src/languages/en.ts index 67cdb1c4cdab..1e8989e3e2a6 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -870,6 +870,7 @@ export default { assignedCardsDescription: 'These are cards assigned by a Workspace admin to manage company spend.', expensifyCard: 'Expensify Card', walletActivationPending: "We're reviewing your information, please check back in a few minutes!", + walletActivationFailed: 'Unfortunately your wallet cannot be enabled at this time. Please chat with Concierge for further assistance.', }, cardPage: { expensifyCard: 'Expensify Card', diff --git a/src/languages/es.ts b/src/languages/es.ts index 3b8434ab7c3e..5f916711d221 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -866,6 +866,7 @@ export default { assignedCardsDescription: 'Son tarjetas asignadas por un administrador del Espacio de Trabajo para gestionar los gastos de la empresa.', expensifyCard: 'Tarjeta Expensify', walletActivationPending: 'Estamos revisando su información, por favor vuelve en unos minutos.', + walletActivationFailed: 'Lamentablemente, no podemos activar tu billetera en este momento. Chatea con Concierge para obtener más ayuda.', }, cardPage: { expensifyCard: 'Tarjeta Expensify', diff --git a/src/pages/EnablePayments/EnablePaymentsPage.js b/src/pages/EnablePayments/EnablePaymentsPage.js index ab690752c0be..5f1577c3b31b 100644 --- a/src/pages/EnablePayments/EnablePaymentsPage.js +++ b/src/pages/EnablePayments/EnablePaymentsPage.js @@ -33,19 +33,20 @@ function EnablePaymentsPage({userWallet}) { const {translate} = useLocalize(); const {isOffline} = useNetwork(); - const {isPendingOnfidoResult} = userWallet; + const {isPendingOnfidoResult, hasFailedOnfido} = userWallet; useEffect(() => { if (isOffline) { return; } - if (!isPendingOnfidoResult) { - Wallet.openEnablePaymentsPage(); - } else { + if (isPendingOnfidoResult || hasFailedOnfido) { Navigation.navigate(ROUTES.SETTINGS_WALLET, CONST.NAVIGATION.TYPE.UP); + return; } - }, [isOffline, isPendingOnfidoResult]); + + Wallet.openEnablePaymentsPage(); + }, [isOffline, isPendingOnfidoResult, hasFailedOnfido]); if (_.isEmpty(userWallet)) { return ; diff --git a/src/pages/EnablePayments/userWalletPropTypes.js b/src/pages/EnablePayments/userWalletPropTypes.js index ef40c5a13b81..53332479d4ec 100644 --- a/src/pages/EnablePayments/userWalletPropTypes.js +++ b/src/pages/EnablePayments/userWalletPropTypes.js @@ -25,4 +25,7 @@ export default PropTypes.shape({ /** The wallet's programID, used to show the correct terms. */ walletProgramID: PropTypes.string, + + /** Whether the user has failed Onfido completely */ + hasFailedOnfido: PropTypes.bool, }); diff --git a/src/pages/settings/Wallet/WalletPage/WalletPage.js b/src/pages/settings/Wallet/WalletPage/WalletPage.js index e9f63bfd5bfc..11974446eea6 100644 --- a/src/pages/settings/Wallet/WalletPage/WalletPage.js +++ b/src/pages/settings/Wallet/WalletPage/WalletPage.js @@ -70,6 +70,7 @@ function WalletPage({bankAccountList, betas, cardList, fundList, isLoadingPaymen const shouldShowEmptyState = !hasBankAccount && !hasWallet && !hasAssignedCard; const isPendingOnfidoResult = lodashGet(userWallet, 'isPendingOnfidoResult', false); + const hasFailedOnfido = lodashGet(userWallet, 'hasFailedOnfido', false); const updateShouldShowLoadingSpinner = useCallback(() => { // In order to prevent a loop, only update state of the spinner if there is a change @@ -311,6 +312,8 @@ function WalletPage({bankAccountList, betas, cardList, fundList, isLoadingPaymen // Determines whether or not the modal popup is mounted from the bottom of the screen instead of the side mount on Web or Desktop screens const isPopoverBottomMount = anchorPosition.anchorPositionTop === 0 || isSmallScreenWidth; + const alertTextStyle = [styles.inlineSystemMessage, styles.flexShrink1]; + const alertViewStyle = [styles.flexRow, styles.alignItemsCenter, styles.w100, styles.ph5]; return ( <> @@ -393,12 +396,24 @@ function WalletPage({bankAccountList, betas, cardList, fundList, isLoadingPaymen if (isPendingOnfidoResult) { return ( - + - {translate('walletPage.walletActivationPending')} + {translate('walletPage.walletActivationPending')} + + ); + } + + if (hasFailedOnfido) { + return ( + + + {translate('walletPage.walletActivationFailed')} ); } diff --git a/src/types/onyx/UserWallet.ts b/src/types/onyx/UserWallet.ts index f29e41a95ce3..aae662f62b6f 100644 --- a/src/types/onyx/UserWallet.ts +++ b/src/types/onyx/UserWallet.ts @@ -16,6 +16,9 @@ type UserWallet = { /** What step in the activation flow are we on? */ currentStep: ValueOf; + /** If the user failed the Onfido verification check */ + hasFailedOnfido?: boolean; + /** If we should show the FailedKYC view after the user submitted their info with a non fixable error */ shouldShowFailedKYC?: boolean;