Repository navigation
[Payment due @ZhenjaHorbach] [Wise] [No QA] Confirm the Wise quote before paying a cross-currency report - #106141
Conversation
…-quote-confirm-modal
…-quote-confirm-modal
|
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 bun ./scripts/generateTranslations.ts --helpTypically, you'd want to translate only what you changed by running |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@ZhenjaHorbach 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] |
| } | ||
| }; | ||
|
|
||
| const renderArrow = (direction: 'previous' | 'next') => { |
There was a problem hiding this comment.
❌ CLEAN-REACT-PATTERNS-4 (docs)
renderArrow is an internal render helper that returns JSX, closes over mutable parent state (shownIndex, which derives from the targetIndex/currentIndex useState values) and bakes that state into the JSX it produces (isDisabled, the onPress target). The rule targets render helpers that carry non-trivial logic and embed mutable component state in the JSX they return; the recommended fix is to extract the helper into its own component with explicit props.
Extract the arrow into a dedicated component so the state it needs flows in via props:
function CarouselArrow({direction, isDisabled, onPress}: {direction: 'previous' | 'next'; isDisabled: boolean; onPress: () => void}) {
const styles = useThemeStyles();
const StyleUtils = useStyleUtils();
const theme = useTheme();
const {translate} = useLocalize();
const icons = useMemoizedLazyExpensifyIcons(['ArrowRight', 'BackArrow']);
const isPrevious = direction === 'previous';
return (
<PressableWithFeedback
accessibilityRole="button"
accessible
accessibilityLabel={translate(isPrevious ? 'common.previous' : 'common.next')}
style={[styles.reportPreviewArrowButton, StyleUtils.getBackgroundColorStyle(theme.buttonDefaultBG)]}
onPress={onPress}
disabled={isDisabled}
disabledStyle={[styles.cursorDefault, styles.buttonOpacityDisabled]}
sentryLabel={isPrevious ? CONST.SENTRY_LABEL.WISE_QUOTE_CAROUSEL.PREVIOUS : CONST.SENTRY_LABEL.WISE_QUOTE_CAROUSEL.NEXT}
>
<Icon src={isPrevious ? icons.BackArrow : icons.ArrowRight} fill={theme.icon} width={variables.iconSizeExtraSmall} height={variables.iconSizeExtraSmall} />
</PressableWithFeedback>
);
}Then render <CarouselArrow direction="previous" isDisabled={shownIndex === 0} onPress={() => scrollToIndex(shownIndex - 1)} /> and the matching next arrow in the parent.
Reviewed at: ae0dff1 | Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ae0dff1579
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| /** Pay stays disabled until the quote is on screen, since Wise requires the admin to see it before paying */ | ||
| function WiseQuoteConfirmModalWrapper({closeModal, resolveModal, reportID, isPayingUnheldOnly, onConfirm}: WiseQuoteConfirmModalWrapperProps) { | ||
| const {translate} = useLocalize(); | ||
| const [wiseQuoteID] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${getNonEmptyStringOnyxID(reportID)}`, {selector: (report) => report?.wiseQuote?.wiseQuoteID}); |
There was a problem hiding this comment.
Expire or refresh quotes before enabling payment
If the confirmation modal remains open past report.wiseQuote.expiresAt (the new type documents a 30-minute lifetime), this selector retains only the ID and no time-based update ever disables the button, so the user can confirm and submit an expired price. Track expiresAt alongside the ID and disable or refresh the quote when it expires; the carousel selector needs the same treatment.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Edge-case. Should we handle that in a follow-up? @grgia
There was a problem hiding this comment.
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2026-11-06.at.21.08.13.movAndroid: mWeb ChromeScreen.Recording.2026-11-06.at.12.13.45.moviOS: HybridAppScreen.Recording.2026-11-06.at.21.08.13.moviOS: mWeb SafariScreen.Recording.2026-11-06.at.12.13.45.movMacOS: Chrome / SafariScreen.Recording.2026-11-06.at.11.59.29.mov |
|
On iOS native, the modal doesn't open after choosing a few reports Screen.Recording.2026-11-06.at.12.36.27.mov |
Hold menu comes back after the Wise quote modal, so the report can be paid twice
In the video: Pay → Wise account → "Pay only $200.00" → Pay in the quote modal → the hold menu is back → "Pay $314.38" → Pay. One report gets two 1-hold-menu-returns-double-pay.mp4How the API was mockedWeb dev build against the dev backend, throwaway account, expenses in EUR. The Wise setup is merged into Onyx on the client: a USD Wise business bank account,
The box in the bottom-left corner logs the parameters of every intercepted request. |
|
|
🚧 grgia has triggered a test Expensify/App build. You can view the workflow run here. |
This comment has been minimized.
This comment has been minimized.
…-quote-confirm-modal
|
🎯 @ZhenjaHorbach, thanks for reviewing and testing this PR! 🎉 A payment issue will be created for your review once this PR is deployed to production. If payment is not needed (e.g., regression PR review fix etc), react with 👎 to this comment to prevent the payment issue from being created. |
BUG: missing row for same currency payments in bulk pay confirmation modalCan we show: 2026-11-06_16-13-07.mp4 |
Polish: loader over quote that already existsWe shouldn't be showing a loader if we already have a quote 2026-11-06_16-24-28.mp4 |
|
Otherwise working really well! |
|
🚧 grgia has triggered a test Expensify/App build. You can view the workflow run here. |
This comment has been minimized.
This comment has been minimized.
|
🚧 grgia has triggered a test Expensify/App build. You can view the workflow run here. |
This comment has been minimized.
This comment has been minimized.
|
🚧 grgia has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/grgia in version: 9.5.34-0 🚀
|
|
No help site update needed — the new Wise quote confirmation workflow remains behind the |
|
FullStory updates are warranted for the new Wise quote confirmation flow. Created Update FullStory for E/A#106141 Review and confirm cross-currency Wise reimbursement quotes with five suggestions covering custom elements, quote errors, and masking. Added |
|
🚀 Deployed to production by https://github.com/yuwenmemon in version: 9.5.34-1 🚀
Bundle Size Analysis (Sentry): |


Explanation of Change
This PR shows the Wise quote before paying a report from a Wise business bank account, behind the
wiseReimbursementsbeta. The quote shows when the report hasrequiresGlobalReimbursementand at least one of its expenses is in a currency other than the bank account's. The admin sees the report total, the debit amount, what the employee receives, the fees, the tax when Wise charges one and the FX rate, and pays with that quote (wiseQuoteIDonPayMoneyRequest). Every other payment goes straight toPayMoneyRequest.GetWiseQuotereturns. A failed quote shows its error in the card.requiresGlobalReimbursementload a quote, the others show their amounts with zero fees. Pay all pays each report with its own quote.ConfirmModaltakesisConfirmDisabled, which also turns off the Enter shortcut.Fixed Issues
$ https://github.com/Expensify/Expensify/issues/692513
$ https://github.com/Expensify/Expensify/issues/692512
PROPOSAL:
Tests
Note
GetWiseQuoteand paying through Wise aren't live on the backend yet, so the quote comes from the snippet below. Paying sendsPayMoneyRequestwith the quote, and the backend rejects it.Please expand the section below to see instructions on getting the local testing data
Testing with a mocked Wise account and quote
The snippet adds a Wise bank account in USD by hand, makes it the workspace's reimbursement account, and sets
requiresGlobalReimbursementon the reports and the currency of their expenses. A fetch of the bank account list overwrites the account, so runsetUpagain after a reload.Paste this in the browser console (web) or run it through the JS debugger (native):
One report
wiseQuoteTest.setUp('<policyID>', ['<reportA>'])for an approved expense report from another memberGetWiseQuotefails, the card shows the report and the error, and Pay stays disabledwiseQuoteTest.setQuote('<reportA>')wiseQuoteTest.setQuote('<reportA>', 82)and verify that a Tax row of $0.82 shows above the FX rate, with the modal keeping its heightwiseQuoteTest.setQuote('<reportA>')and press PayPayMoneyRequestis sent withwiseQuoteID: test-<reportA>Several reports
wiseQuoteTest.setUp('<policyID>', ['<reportA>', '<reportB>', '<reportC>'])for three approved expense reportswiseQuoteTest.setQuotefor A, B and C, and verify that no card shows a Tax row and that Pay all is enabledwiseQuoteTest.setQuote('<reportB>', 82)and verify that only card B shows a Tax row, with every card and the modal keeping their heightwiseQuoteTest.setQuote('<reportA>', 82)andwiseQuoteTest.setQuote('<reportC>', 82)and verify that every card shows a Tax rowwiseQuoteTest.setUp('<policyID>', ['<reportC>'], 'EUR', false)and open the carousel again for A, B and CwiseQuoteTest.setQuotefor A and B, press Pay all and verify thatPayMoneyRequestis sent for A and B with theirwiseQuoteID, and for C without oneCurrencies
wiseQuoteTest.setUp('<policyID>', ['<reportA>'], 'USD'), press Pay > "Pay with business account" on report A and verify that it pays without the quote modalwiseQuoteTest.setUp('<policyID>', ['<reportA>'], 'EUR', false), press Pay > "Pay with business account" on report A and verify that it pays without the quote modalwiseQuoteTest.setUp('<policyID>', ['<reportB>', '<reportC>'], 'USD'), select B and C in Spend > Reports, press Pay > "Pay with business account" and verify that they're paid without the carouselUse an account on the
wiseReimbursementsbeta, or turn it on in Settings > Troubleshoot > Beta overrides. The account is an admin of a workspace whose reimbursement account is a USD business bank account with global reimbursements enabled through Wise. The workspace needs these approved expense reports:One report
PayMoneyRequestis sent with the quote'swiseQuoteIDand the report is paidSeveral reports
wiseQuoteIDCurrencies
Offline tests
QA Steps
N/A
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)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.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