diff --git a/cspell.json b/cspell.json index 5e51ea6f5c49..23720a61ff84 100644 --- a/cspell.json +++ b/cspell.json @@ -59,6 +59,7 @@ "Bushwick", "CARDFROZEN", "CARDUNFROZEN", + "CARDDEACTIVATED", "CAROOT", "CCDQCAMM", "CFPB", diff --git a/src/CONST/index.ts b/src/CONST/index.ts index 9eca6b7c9b96..37645e8ba0c1 100644 --- a/src/CONST/index.ts +++ b/src/CONST/index.ts @@ -1485,6 +1485,7 @@ const CONST = { CARD_ASSIGNED: 'CARDASSIGNED', CARD_FROZEN: 'CARDFROZEN', CARD_UNFROZEN: 'CARDUNFROZEN', + CARD_DEACTIVATED: 'CARDDEACTIVATED', PERSONAL_CARD_CONNECTION_BROKEN: 'PERSONALCARDCONNECTIONBROKEN', CHANGE_FIELD: 'CHANGEFIELD', // OldDot Action CHANGE_POLICY: 'CHANGEPOLICY', diff --git a/src/languages/de.ts b/src/languages/de.ts index 7a5a9cda47ec..2ab596c70013 100644 --- a/src/languages/de.ts +++ b/src/languages/de.ts @@ -2696,6 +2696,7 @@ ${amount} für ${merchant} – ${date}`, reportFraudConfirmationPage: { title: 'Kartenbetrug gemeldet', description: 'Wir haben Ihre bestehende Karte dauerhaft deaktiviert. Wenn Sie Ihre Kartendetails erneut aufrufen, steht Ihnen eine neue virtuelle Karte zur Verfügung.', + descriptionCardNotReplaced: 'Deine Karte wurde dauerhaft deaktiviert. Bitte kontaktiere einen Administrator, um eine neue Karte auszustellen.', buttonText: 'Verstanden, danke!', }, activateCardPage: { diff --git a/src/languages/en.ts b/src/languages/en.ts index 1f33269ef87a..653fcec7296f 100644 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -2752,6 +2752,7 @@ const translations = { reportFraudConfirmationPage: { title: 'Card fraud reported', description: 'We’ve permanently deactivated your existing card. When you go back to view your card details, you’ll have a new virtual card available.', + descriptionCardNotReplaced: 'Your card was permanently deactivated. Please contact an admin to issue a new card.', buttonText: 'Got it, thanks!', }, activateCardPage: { diff --git a/src/languages/es.ts b/src/languages/es.ts index dadd563c1960..e9be75ab258f 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -2565,6 +2565,7 @@ ${amount} para ${merchant} - ${date}`, reportFraudConfirmationPage: { title: 'Fraude con tarjeta reportado', description: 'Hemos desactivado permanentemente tu tarjeta existente. Cuando vuelvas a ver los detalles de tu tarjeta, tendrás una nueva tarjeta virtual disponible.', + descriptionCardNotReplaced: 'Tu tarjeta fue desactivada permanentemente. Por favor, contacta a un administrador para emitir una nueva tarjeta.', buttonText: 'Entendido, ¡gracias!', }, activateCardPage: { diff --git a/src/languages/fr.ts b/src/languages/fr.ts index 26101aaa3714..f55cc611506f 100644 --- a/src/languages/fr.ts +++ b/src/languages/fr.ts @@ -2704,6 +2704,7 @@ ${amount} pour ${merchant} - ${date}`, reportFraudConfirmationPage: { title: 'Fraude à la carte signalée', description: 'Nous avons définitivement désactivé votre carte actuelle. Lorsque vous retournerez consulter les détails de votre carte, une nouvelle carte virtuelle sera disponible.', + descriptionCardNotReplaced: 'Votre carte a été désactivée définitivement. Veuillez contacter un administrateur pour émettre une nouvelle carte.', buttonText: 'Compris, merci !', }, activateCardPage: { diff --git a/src/languages/it.ts b/src/languages/it.ts index 2d0cf3937886..1c121e97f4e6 100644 --- a/src/languages/it.ts +++ b/src/languages/it.ts @@ -2692,6 +2692,7 @@ ${amount} per ${merchant} - ${date}`, reportFraudConfirmationPage: { title: 'Frode della carta segnalata', description: 'Abbiamo disattivato definitivamente la tua carta esistente. Quando tornerai a visualizzare i dettagli della carta, avrai a disposizione una nuova carta virtuale.', + descriptionCardNotReplaced: 'La tua carta è stata disattivata permanentemente. Contatta un amministratore per emettere una nuova carta.', buttonText: 'Ricevuto, grazie!', }, activateCardPage: { diff --git a/src/languages/ja.ts b/src/languages/ja.ts index eeeb9fe81406..1b0145224a84 100644 --- a/src/languages/ja.ts +++ b/src/languages/ja.ts @@ -2665,6 +2665,7 @@ ${date} の ${merchant} への ${amount}`, reportFraudConfirmationPage: { title: 'カード不正利用を報告済み', description: '既存のカードは永久に無効化しました。カードの詳細画面に戻ると、新しいバーチャルカードが利用可能になっています。', + descriptionCardNotReplaced: 'カードは完全に無効化されました。新しいカードを発行するには管理者に連絡してください。', buttonText: '了解しました、ありがとうございます!', }, activateCardPage: { diff --git a/src/languages/nl.ts b/src/languages/nl.ts index 5b507734aed7..15ce8513ac3a 100644 --- a/src/languages/nl.ts +++ b/src/languages/nl.ts @@ -2689,6 +2689,7 @@ ${amount} voor ${merchant} - ${date}`, reportFraudConfirmationPage: { title: 'Kaartfraude gemeld', description: 'We hebben je bestaande kaart permanent gedeactiveerd. Wanneer je teruggaat om je kaartgegevens te bekijken, heb je een nieuwe virtuele kaart beschikbaar.', + descriptionCardNotReplaced: 'Je kaart is permanent gedeactiveerd. Neem contact op met een beheerder om een nieuwe kaart uit te geven.', buttonText: 'Begrepen, dank je!', }, activateCardPage: { diff --git a/src/languages/pl.ts b/src/languages/pl.ts index 1666152ef5a2..aa6de0fd2765 100644 --- a/src/languages/pl.ts +++ b/src/languages/pl.ts @@ -2683,6 +2683,7 @@ ${amount} dla ${merchant} - ${date}`, reportFraudConfirmationPage: { title: 'Zgłoszono oszustwo kartowe', description: 'Trwale dezaktywowaliśmy Twoją dotychczasową kartę. Gdy wrócisz do szczegółów karty, będzie tam dostępna nowa wirtualna karta.', + descriptionCardNotReplaced: 'Twoja karta została trwale dezaktywowana. Skontaktuj się z administratorem, aby wydać nową kartę.', buttonText: 'Jasne, dzięki!', }, activateCardPage: { diff --git a/src/languages/pt-BR.ts b/src/languages/pt-BR.ts index dfecdf345a57..46a328068abe 100644 --- a/src/languages/pt-BR.ts +++ b/src/languages/pt-BR.ts @@ -2683,6 +2683,7 @@ ${amount} para ${merchant} - ${date}`, reportFraudConfirmationPage: { title: 'Fraude no cartão reportada', description: 'Desativamos permanentemente seu cartão atual. Quando você voltar para ver os detalhes do cartão, um novo cartão virtual estará disponível.', + descriptionCardNotReplaced: 'Seu cartão foi desativado permanentemente. Entre em contato com um administrador para emitir um novo cartão.', buttonText: 'Entendido, obrigado!', }, activateCardPage: { diff --git a/src/languages/zh-hans.ts b/src/languages/zh-hans.ts index 8141d30d7aca..05fa78aae4b5 100644 --- a/src/languages/zh-hans.ts +++ b/src/languages/zh-hans.ts @@ -2609,6 +2609,7 @@ ${amount},商户:${merchant} - 日期:${date}`, reportFraudConfirmationPage: { title: '已报告卡片欺诈', description: '我们已永久停用你的现有卡片。当你返回查看卡片详情时,你将会看到一张新的虚拟卡片可用。', + descriptionCardNotReplaced: '您的卡已被永久停用。请联系管理员以发行新卡。', buttonText: '明白了,谢谢!', }, activateCardPage: { diff --git a/src/libs/actions/Card.ts b/src/libs/actions/Card.ts index d39539b91667..9749d0877e8a 100644 --- a/src/libs/actions/Card.ts +++ b/src/libs/actions/Card.ts @@ -70,7 +70,7 @@ type CardListUpdateData = Omit, 'errors'> & { function reportVirtualExpensifyCardFraud(card: Card, validateCode: string) { const cardID = card?.cardID ?? CONST.DEFAULT_NUMBER_ID; - const optimisticData: Array> = [ + const optimisticData: Array> = [ { onyxMethod: Onyx.METHOD.MERGE, key: ONYXKEYS.FORMS.REPORT_VIRTUAL_CARD_FRAUD, @@ -85,6 +85,11 @@ function reportVirtualExpensifyCardFraud(card: Card, validateCode: string) { key: ONYXKEYS.ACCOUNT, value: {isLoading: true}, }, + { + onyxMethod: Onyx.METHOD.MERGE, + key: ONYXKEYS.FORMS.REPORT_PHYSICAL_CARD_FORM, + value: {cardTerminatedWithoutReplacement: null}, + }, ]; const successData: Array> = [ @@ -102,7 +107,7 @@ function reportVirtualExpensifyCardFraud(card: Card, validateCode: string) { }, ]; - const failureData: Array> = [ + const failureData: Array> = [ { onyxMethod: Onyx.METHOD.MERGE, key: ONYXKEYS.FORMS.REPORT_VIRTUAL_CARD_FRAUD, @@ -115,6 +120,11 @@ function reportVirtualExpensifyCardFraud(card: Card, validateCode: string) { key: ONYXKEYS.ACCOUNT, value: {isLoading: false}, }, + { + onyxMethod: Onyx.METHOD.MERGE, + key: ONYXKEYS.FORMS.REPORT_PHYSICAL_CARD_FORM, + value: {cardTerminatedWithoutReplacement: null}, + }, ]; const parameters: ReportVirtualExpensifyCardFraudParams = { diff --git a/src/pages/inbox/report/actionContents/ActionContentRouter.tsx b/src/pages/inbox/report/actionContents/ActionContentRouter.tsx index 8667431d0d38..043f500ba36a 100644 --- a/src/pages/inbox/report/actionContents/ActionContentRouter.tsx +++ b/src/pages/inbox/report/actionContents/ActionContentRouter.tsx @@ -351,7 +351,11 @@ function ActionContentRouter({ /> ); } - if (action.actionName === CONST.REPORT.ACTIONS.TYPE.CARD_FROZEN || action.actionName === CONST.REPORT.ACTIONS.TYPE.CARD_UNFROZEN) { + if ( + action.actionName === CONST.REPORT.ACTIONS.TYPE.CARD_FROZEN || + action.actionName === CONST.REPORT.ACTIONS.TYPE.CARD_UNFROZEN || + action.actionName === CONST.REPORT.ACTIONS.TYPE.CARD_DEACTIVATED + ) { return ( ${getReportActionHtml(action)}`} /> diff --git a/src/pages/settings/Wallet/ReportVirtualCardFraudConfirmationPage.tsx b/src/pages/settings/Wallet/ReportVirtualCardFraudConfirmationPage.tsx index 9bd18714345e..0ac49a2475b6 100644 --- a/src/pages/settings/Wallet/ReportVirtualCardFraudConfirmationPage.tsx +++ b/src/pages/settings/Wallet/ReportVirtualCardFraudConfirmationPage.tsx @@ -8,10 +8,12 @@ import ScrollView from '@components/ScrollView'; import Text from '@components/Text'; import {useMemoizedLazyExpensifyIcons} from '@hooks/useLazyAsset'; import useLocalize from '@hooks/useLocalize'; +import useOnyx from '@hooks/useOnyx'; import useThemeStyles from '@hooks/useThemeStyles'; import Navigation from '@navigation/Navigation'; import type {PlatformStackScreenProps} from '@navigation/PlatformStackNavigation/types'; import type {SettingsNavigatorParamList} from '@navigation/types'; +import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; import type SCREENS from '@src/SCREENS'; @@ -25,10 +27,18 @@ function ReportVirtualCardFraudConfirmationPage({ const themeStyles = useThemeStyles(); const {translate} = useLocalize(); const expensifyIcons = useMemoizedLazyExpensifyIcons(['MagnifyingGlassSpyMouthClosed']); + const [physicalCardForm] = useOnyx(ONYXKEYS.FORMS.REPORT_PHYSICAL_CARD_FORM); + const isCardTerminatedWithoutReplacement = !!physicalCardForm?.cardTerminatedWithoutReplacement; + const description = isCardTerminatedWithoutReplacement ? 'reportFraudConfirmationPage.descriptionCardNotReplaced' : 'reportFraudConfirmationPage.description'; const close = useCallback(() => { + if (isCardTerminatedWithoutReplacement) { + Navigation.goBack(ROUTES.SETTINGS_WALLET); + return; + } + Navigation.navigate(ROUTES.SETTINGS_WALLET_DOMAIN_CARD.getRoute(cardID)); - }, [cardID]); + }, [cardID, isCardTerminatedWithoutReplacement]); return ( {translate('reportFraudConfirmationPage.title')} - - {translate('reportFraudConfirmationPage.description')} - + {translate(description)}