Repository navigation
[Payment due @ZhenjaHorbach] [No QA][Wise] Recover when App and Auth disagree on whether a payment needs a Wise quote - #108156
Conversation
# Conflicts: # src/types/onyx/index.ts
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
Codex Review Summary: ✅ CompletedThis 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. |
|
@Krishna2323 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] |
|
Iterated on Daniel's review. Checking the Perf issue now. |
|
The perf issue was in the baseline step (main). I've updated it and it seems to be gone. |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2026-12-04.at.10.50.39.movAndroid: mWeb ChromeScreen.Recording.2026-12-04.at.10.49.55.moviOS: HybridAppScreen.Recording.2026-12-04.at.10.50.39.moviOS: mWeb SafariScreen.Recording.2026-12-04.at.10.49.55.movMacOS: Chrome / SafariScreen.Recording.2026-12-04.at.10.44.06.mov |
|
|
||
| /** Whether the server answered the report's quote request with no quote, because the payment doesn't go through Wise */ | ||
| function isPaidWithoutWiseQuote(report: Pick<Report, 'wiseQuote' | 'wiseQuoteRequest'> | undefined): boolean { | ||
| return !report?.wiseQuote && !!report?.wiseQuoteRequest?.hasResponse; |
There was a problem hiding this comment.
If GetWiseQuote returns an error without a quote, this is true, so Pay is enabled, and the error is hidden
Should we exclude that case?
So I hope we need to update this something like this
return !report?.wiseQuote && !!report?.wiseQuoteRequest?.hasResponse && !report?.errorFields?.wiseQuote;
There was a problem hiding this comment.
Good catch, updated in eb13b60. One failed request can't reach that state: a refused quote comes back as an error, so only failureData runs and hasResponse stays false. But overlapping quote requests can leave hasResponse: true from one request next to an error from another, so isPaidWithoutWiseQuote now also requires no errorFields.wiseQuote, with a test for that case.
|
But overall changes look good! |
|
Retested on web Chrome at ✅ Two reports paid offline that Auth needs a quote forBack online, Confirm payment opens for one report and then the other, each with its own quote. Both end up paid with no error. Pressing Cancel on each instead puts the report back to Approved with Pay available. q4-offline-two.mp4✅ Bulk pay with one report Auth has no quote for
✅ No loop when the quote prompt's payment is rejectedThe employee moved to a GBP account while Confirm payment was open without a quote. The payment fails once, the prompt does not open again, and the report keeps Pay with the usual error. ✅ Single report Auth needs a quote forConfirm payment opens with the quote and no report error. Pay completes the payment. ✅ Payment sent while a second tab is openNo Confirm payment in either tab. The report stays Approved with the usual error. |
|
@heekinho |
|
🚧 joekaufmanexpensify has triggered a test Expensify/App build. You can view the workflow run here. |
This comment has been minimized.
This comment has been minimized.
joekaufmanexpensify
left a comment
There was a problem hiding this comment.
Tests well, good from my perspective!
# Conflicts: # src/libs/actions/Wise.ts
|
Done, @ZhenjaHorbach. Thanks! |
|
🎯 @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. |
|
🚧 danieldoglas 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/danieldoglas in version: 9.5.59-2 🚀
|
|
No help site update needed — this PR fixes Wise payment quote handling behind the existing beta flag without releasing the feature or making any existing article sentence incorrect. |


Explanation of Change
App decides on its own whether to show the Wise quote before paying, and it can't always get that right, because it doesn't know the country of the employee's deposit account. This keeps App's check, so domestic payments stay optimistic, and recovers when App and Auth disagree:
wiseQuoteRequiredsignal (https://github.com/Expensify/Web-Expensify/pull/59075),GlobalReimbursementPayErrordrops the failed PAY action and the report error.WiseQuoteRequiredPayModalthen gets the quote for the same bank account and opens Confirm payment, which pays again with the confirmed quote. A payment this tab didn't send, such as one from another tab, keeps the error as before.getWiseQuoterecords when the server has answered. When the answer has no quote, Confirm payment and the bulk carousel show the amounts without fees and pay without a quote, instead of staying open with Pay disabled.Search bulk pay doesn't open one quote per report. A bulk payment that needs a quote keeps today's error on its row.
Fixed Issues
$ https://github.com/Expensify/Expensify/issues/708923
PROPOSAL: N/A
Tests
Precondition: an admin on the
wiseReimbursementsbeta (Troubleshoot > Beta overrides on a dev build) of a workspace that pays from an approved USD Wise business account. Debug mode on.Note
Turn on the
wiseReimbursementsoverride even if the account is on theallbeta. Theallbeta doesn't enablewiseReimbursements, and without it App doesn't treat the payment as a Wise one, so the report only shows "Unexpected error. Please try again later."Auth needs a quote App didn't ask for:
depositCurrencyinsidenextStepto"USD"and press Save, so App pays without a quote.CheckQuote.mov
Auth has no quote for a payment App asked one for:
depositCurrencyinsidenextStepto"GBP"and press Save, so App asks for a quote.US.mov
Unit and UI tests:
GlobalReimbursementPayErrorTest,WiseQuoteUtilsTest,usePayWithWiseQuote.test,PayMoneyRequestTest,WiseQuoteConfirmModalWrapperTest,WiseQuoteCarouselModalWrapperTestandWiseQuoteRequiredPayModalTest.Offline tests
N/A. Confirm payment keeps Pay disabled while offline, as before.
QA Steps
N/A. Still behind the beta flag.
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