[No QA][ECUK In-App 3DS] Implement transaction approval flow#82704
Conversation
…tion-action-and-scenario
…tion-action-and-scenario
…tion-action-and-scenario
…tion-action-and-scenario
…tion-action-and-scenario
|
Hey, I noticed you changed If you want to automatically generate translations for other locales, an Expensify employee will have to:
Alternatively, if you are an external contributor, you can run the translation script locally with your own OpenAI API key. To learn more, try running: npx ts-node ./scripts/generateTranslations.ts --helpTypically, you'd want to translate only what you changed by running |
|
|
|
@DylanDylann Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
…thorizationChallenge
Glitch with the recording |
src/libs/ReportActionsUtils.ts
Outdated
| return undefined; | ||
| } | ||
| const {amount, currency, merchant} = originalMessage; | ||
| const formattedAmount = amount ? convertToDisplayString(amount, currency) : ''; |
There was a problem hiding this comment.
Noting that if there is no currency, we need to omit the symbol rather than show USD
src/libs/TransactionPreviewUtils.ts
Outdated
| return ''; | ||
| } | ||
| const digitsOnly = String(lastFourPAN).replaceAll(/\D/g, ''); | ||
| return digitsOnly ? digitsOnly.slice(-4).padStart(4, '0') : ''; |
There was a problem hiding this comment.
Per discussion we should pad with X's.
| return digitsOnly ? digitsOnly.slice(-4).padStart(4, '0') : ''; | |
| return digitsOnly ? digitsOnly.slice(-4).padStart(4, 'X') : ''; |
src/libs/TransactionPreviewUtils.ts
Outdated
| * If the number is shorter than 4 digits, it will be padded with zeros. | ||
| */ | ||
| function formatLastFourPAN(lastFourPAN?: number | string): string { | ||
| if (lastFourPAN === undefined || lastFourPAN === null) { |
There was a problem hiding this comment.
Right? Since if we have no digits, we don't want to show as all padding XXXX
| if (lastFourPAN === undefined || lastFourPAN === null) { | |
| if (lastFourPAN === undefined || lastFourPAN === null || lastFourPAN === '') { |
|
|
||
| // Show skeleton when transaction data is not yet available (e.g. initial load before parent has received it from Onyx). | ||
| // Data is loaded by the parent; this component does not fetch. | ||
| const shouldShowSkeleton = !amount && !currency && !merchant && !created && !lastFourPAN; |
There was a problem hiding this comment.
Only require non-optional fields before showing
| const shouldShowSkeleton = !amount && !currency && !merchant && !created && !lastFourPAN; | |
| const shouldShowSkeleton = !created && !transactionID; |
| import type {ErrorState} from '@components/MultifactorAuthentication/Context/State'; | ||
| import CONST from '@src/CONST'; | ||
|
|
||
| /** Show server failure screen when status is 5xx or unknown (e.g. network/parse error). Otherwise treat as client error (4xx). */ |
There was a problem hiding this comment.
NAB
| /** Show server failure screen when status is 5xx or unknown (e.g. network/parse error). Otherwise treat as client error (4xx). */ | |
| /** Server failure screen generally represents "unknown error" so also show when status is unknown (e.g. network/parse error). */ |
| expires: string; | ||
|
|
||
| /** Last 4 digits of the card PAN */ | ||
| lastFourPAN: number; |
There was a problem hiding this comment.
Should be a string, else we'll lose leading 0's and replace with X's
There was a problem hiding this comment.
Confirmed it is a string in Auth
Reviewer Checklist
Screenshots/VideosSee above comments for videos |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚧 @chuckdries has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/chuckdries in version: 9.3.28-0 🚀
|
|
🚀 Deployed to staging by https://github.com/chuckdries in version: 9.3.30-0 🚀
|
|
🚀 Deployed to production by https://github.com/blimpich in version: 9.3.30-3 🚀
|
| } | ||
|
|
||
| // Renders content of ACTIONABLE_CARD_3DS_TRANSACTION_APPROVAL reportActions | ||
| function getActionableCard3DSTransactionApprovalMessage( |
There was a problem hiding this comment.
@chuckdries @JakubKorytko You have not used this custom report action renderer in multiple places which will cause mismatch in report name when you create thread on this message. Also, copying this message will also mismatch. Can you please fix this?
Explanation of Change
This PR introduces support for 3DS transaction approval flows, enhances eReceipt theming flexibility, and adds a new custom HTML tag renderer for transaction history links. It also includes various supporting updates to constants, routes, Onyx keys, and illustrations to enable these new features.
3DS Transaction Approval and Multifactor Authentication Enhancements:
AUTHORIZE_SCENARIOapproveTransaction&denyTransactionACTIONABLE_CARD_3DS_TRANSACTION_APPROVALinCONSTto support 3DS transaction approval messages.MultifactorAuthenticationTriggerCancelConfirmModalcomponent. Modals follow the pattern of component as a value same as screens.eReceipt Component Theming and Flexibility:
overrideThemeprop toEReceiptandEReceiptWithSizeCalculationcomponents, allowing custom theming (colors, icons, background image, and title text) via the newOverrideThemePropstype.Custom HTML Tag Renderer for Transaction History Links:
<transaction-history-link>custom HTML tag in the HTML engine provider and implemented a new renderer that navigates to the transaction history search page.Asset and Illustration Updates:
Fixed Issues
$ #79379
$ #79380
$ #82616
PROPOSAL: N/A
Tests
These tests should only be performed in native mobile apps. The changes are not supported on the web or mWeb.
Offline tests
N/A,
D - Full Page Blocking UI Patternfor this project.QA Steps
QA cannot test this
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari