Skip to content

[Payment due @ZhenjaHorbach][NoQA][Wise][Release 1] Business - UI - Entry Point Bulk Pay - #105238

Merged
grgia merged 26 commits into
Expensify:mainfrom
software-mansion-labs:wojtekboman/wise-bulk-pay-gr-modal
Nov 19, 2026
Merged

grgia merged 26 commits into
Expensify:mainfrom
software-mansion-labs:wojtekboman/wise-bulk-pay-gr-modal

Conversation

@WojtekBoman

@WojtekBoman WojtekBoman commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Explanation of Change

Behind the wiseReimbursements beta, Search bulk pay now skips reports whose bank account needs global reimbursements, pays the rest, and shows one modal listing the reports that weren't paid. Get started opens the global reimbursements intro for that account, Not now closes it. "Select all" is out of scope.

Screenshot 2026-10-28 at 09 04 04

The client can't predict every rejection: nextStep.requiresGlobalReimbursement is only sent when the workspace has a reimbursement account, and only describes paying from that account. So the backend can still reject a payment with jsonCode 666. Those rejections are now handled the same way:

  • One modal per bulk pay click. The reports the backend rejected are listed in the same modal as the ones the client skipped. It shows once every payment of the click has a response, also when the admin has left Search by then. The backend signal no longer opens the intro once per rejected report.
  • Nothing paid. If no report of the click was paid, the intro opens directly instead of the list, with the copy for several reports when more than one wasn't paid.
  • No generic error. GlobalReimbursementPayError drops the generic error that Search pay adds to the report in failureData, for bulk pay and for a single row. The Search row had no way to dismiss it.
  • Single report pay is unchanged. The payment is still sent first and the intro opens from the backend signal.

How it works: useSearchBulkActions hands each click over to GlobalReimbursementsBulkPay, which keeps the pending payments in memory. GlobalReimbursementPayError reports each payment response to it and holds the backend signal back for bulk pay requests. After the last response it sets enableGlobalReimbursementsModal, and EnableGlobalReimbursementsPayModal (mounted in AuthScreens) shows the list or opens the intro.

Known limitations:

  • A payment that never gets a response (a dropped duplicate request, a reload in the middle of the queue) leaves its click without the modal. Later clicks aren't affected.
  • On web only the leader tab gets the responses. In another tab the skipped reports are listed right away, and a backend rejection opens the intro as it does for a single report.

Fixed Issues

$ https://github.com/Expensify/Expensify/issues/694432
PROPOSAL:

Tests

Setup: an admin account with the wiseReimbursements beta, a workspace whose reimbursement account is a USD business bank account (OPEN) with isGlobalReimbursementEnabled: false, and at least two approved expense reports in that workspace. A second workspace whose bank account does not need global reimbursements, with one approved report.

  1. Mixed selection

    1. Go to Reports in Search, filter by Status: Approved
    2. Select one report from the first workspace and one from the second workspace
    3. Click Pay and choose the bank account
    4. Verify that only the report from the second workspace is paid
    5. Verify that a "Pay with x1234" modal opens, listing only the report from the first workspace, with Get started and Not now buttons
    6. Click Not now
    7. Verify that the modal closes and the selection is cleared, like after any bulk pay that paid at least one report
  2. All selected reports need global reimbursements

    1. Select the two approved reports from the first workspace
    2. Click Pay and choose the bank account
    3. Verify that nothing is paid, no modal appears, and the "Set up global reimbursements?" intro opens in the RHP right away
    4. Verify that the intro subtitle says none of these reports could be paid
    5. Close the intro and verify that both reports are still selected
  3. Selecting expenses and beta off

    1. Go to Expenses in Search and select two expenses from the same report in the first workspace, plus one expense from the second workspace
    2. Click Pay and choose the bank account
    3. Verify that the modal lists that report only once
    4. Remove the wiseReimbursements beta and repeat bulk pay
    5. Verify that no modal appears and bulk pay behaves as before
  4. Reports the backend rejects

    Setup: add a second USD business bank account (OPEN, isGlobalReimbursementEnabled: false) that is not the reimbursement account of the first workspace. In that workspace, have one approved report from a member with a USD deposit account and one from a member with a deposit account in another currency.

    1. Go to Reports in Search, filter by Status: Approved, and select both reports
    2. Click Pay and choose the second bank account
    3. Verify that both payments are sent and nothing opens while they are in flight
    4. Verify that after the last response one "Pay with x1234" modal opens, listing only the report of the member paid in another currency
    5. Verify that the intro did not open on its own and that the unpaid report shows no error on its Search row
    6. Click Get started and verify that the intro opens for the second bank account
  5. Leaving Search before the responses arrive

    1. Repeat steps 1 and 2 of Test 4 and go to Home right away
    2. Verify that the same modal opens on Home after the responses arrive
  6. Only rejected reports

    1. Select two approved reports from members paid in another currency
    2. Click Pay and choose the second bank account
    3. Verify that no list opens and the intro opens once, with the subtitle saying none of these reports could be paid
    4. Verify that neither report shows an error on its Search row
  7. Single report

    1. Click Pay on the Search row of a report from a member paid in another currency and choose the second bank account
    2. Verify that the intro opens after the response and the row shows no error
  • Verify that no errors appear in the JS console

Offline tests

  1. Go offline
  2. Select reports from Test 1 and click Pay with the bank account
  3. Verify that the offline modal appears and no global reimbursements modal or payment is triggered

QA Steps

Same as tests

  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I verified any copy / text that was added to the app is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • If new assets were added or existing ones were modified, I verified that:
    • The assets are optimized and compressed (for SVG files, run npm run compress-svg)
    • The assets load correctly across all supported platforms.
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • If the PR adds or modifies the UI:
    • I asked an AI agent to review the changes for accessibility issues and addressed its findings.
    • I tested with a screen reader (VoiceOver on macOS) and verified all new/changed elements are reachable with a logical focus order.
    • I verified all new/changed elements have meaningful accessible names and roles.
    • I verified state changes are announced (e.g. checked/unchecked, expanded/collapsed, selected).
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari

@melvin-bot

melvin-bot Bot commented Oct 28, 2026

Copy link
Copy Markdown

Hey, I noticed you changed src/languages/en.ts in a PR from a fork. For security reasons, translations are not generated automatically for PRs from forks.

If you want to automatically generate translations for other locales, an Expensify employee will have to:

  1. Look at the code and make sure there are no malicious changes.
  2. Run the Generate static translations GitHub workflow. If you have write access and the K2 extension, you can simply click: [this button]

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 --help

Typically, you'd want to translate only what you changed by running npx bun ./scripts/generateTranslations.ts --compare-ref main

@WojtekBoman
WojtekBoman force-pushed the wojtekboman/wise-bulk-pay-gr-modal branch from 4e598fe to 2ed5c78 Compare October 28, 2026 08:37
@WojtekBoman

Copy link
Copy Markdown
Contributor Author

Hey! I created a draft PR for this issue, but there are a few questions we need to answer before proceeding :)

  1. "Select all" (50+ reports): that path pays on the server (QueueBulkPayReports), so the app doesn't know which reports were skipped. Showing this modal there would need the backend to return the skipped reports. How should we handle "Select all"?
  2. Nothing gets paid: if every selected report needs GR, we still show "These reports weren't paid..." and the user has to click [Get started]. What should happen in that case?
  3. Splitting work with 103871: @apeyada is adding a similar "skipped reports" modal for non-reimbursable / $0 reports (Bulk pay: show a modal explaining why non-reimbursable reports got excluded from bank payment #103871 (comment)). Both hook into the same bulk pay flow, and when one bulk pay skips reports for both reasons, they should end up in one modal. How do we split this between the two PRs?

@grgia @joekaufmanexpensify Feel free to run an adhoc build and test it! Any feedback helps me catch issues early :)

@github-actions

Copy link
Copy Markdown
Contributor

🚧 grgia has triggered a test Expensify/App build. You can view the workflow run here.

@github-actions

This comment has been minimized.

@joekaufmanexpensify

Copy link
Copy Markdown
Contributor

"Select all" (50+ reports): that path pays on the server (QueueBulkPayReports), so the app doesn't know which reports were skipped. Showing this modal there would need the backend to return the skipped reports. How should we handle "Select all"?

How are we handling this in the other non-reimbursable case? My understanding is that we are going to pay the eligible reports, skip the ones that are not eligible, and then show the results afterward, explaining what was skipped. Can we take a similar approach for this case here?

Nothing gets paid: if every selected report needs GR, we still show "These reports weren't paid..." and the user has to click [Get started]. What should happen in that case?

Let's handle this the same way we handle the cases in #104574 (comment). If all the selected reports require GR, we can just open the right-hand pane that prompts the user to set up global reimbursements. Perhaps changing the subheader to clarify that all the reports require it versus the singular copy now

Splitting work with 103871: @apeyada is adding a similar "skipped reports" modal for non-reimbursable / $0 reports (#103871 (comment)). Both hook into the same bulk pay flow, and when one bulk pay skips reports for both reasons, they should end up in one modal. How do we split this between the two PRs?

No preference here. If you are farther along, can you just create the pattern and vice versa with the other issue?

@joekaufmanexpensify

Copy link
Copy Markdown
Contributor

I tested, and the modal looks good, but it's not working correctly. In this case, the October 28 report is from an employee that has a U.S. business bank account set up, not one that requires global reimbursement. I would have expected that we pay that report and list only the October 21 report on the modal, right?

image

@WojtekBoman

Copy link
Copy Markdown
Contributor Author

Thanks for testing! You're right, the October 28 report should be paid.

The app decides whether a report needs global reimbursements before paying, but it only looks at the company bank account (USD, global reimbursements not enabled). It has no data about the employee's bank account, so every report paid from that account gets skipped. Paying a single report from the report view has the same issue, since it uses the same check.

So both cases need backend data:

  1. Selected reports: the app needs to know per report whether paying it requires global reimbursements (or the employee's bank account country/currency), e.g. in the Search results and on the report.
  2. "Select all": that payment runs on the server (QueueBulkPayReports), so to show the "skipped reports" result afterwards, like in the non-reimbursable case, the backend would need to skip those reports and return which ones it skipped.

cc @grgia, could you take a look at the missing backend data I mentioned above? :)

@grgia

grgia commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Yes @WojtekBoman

@joekaufmanexpensify seems the BE doesnt support this- I created an issue. Can you confirm, this wasnt supported already for corpay?

@joekaufmanexpensify

Copy link
Copy Markdown
Contributor

@joekaufmanexpensify seems the BE doesnt support this- I created an issue. Can you confirm, this wasnt supported already for corpay?

Correct. The UX we're implementing here is not currently supported with Corpay. Here is how it works today if you try and bulk pay a mix of payments, some of which require Corpay and some do not, when the bank account is not enabled for Corpay:

  • The domestic report proceeds with payment.
  • The international report stays unpaid.
  • An “Enable global reimbursements” prompt appears, but it doesn’t identify the unpaid report(s) or summarize which payments succeeded. Modal code

So you get a setup prompt, without a clear explanation of the bulk-payment results. The feedback we're adding here will make for a much better UX.

@@ -1951,6 +1976,36 @@ function useSearchBulkActions({queryJSON}: UseSearchBulkActionsParams) {
playSound(SOUNDS.SUCCESS);
clearSelectedTransactions();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NAB

an admin who bulk pays a mixed selection and clicks Not now on the Pay with x1234 modal finds the unpaid report no longer selected.

test 1 step 7 says the unpaid report stays selected, but clearSelectedTransactions() runs whenever paidReportCount > 0. which one is intended?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! Clearing the selection is intended, same as after any bulk pay that pays at least one report. The test step was wrong, I updated the PR description.

Comment thread src/hooks/useSearchBulkActions.ts Resolved
Comment thread src/hooks/useSearchBulkActions.ts Resolved
@grgia

grgia commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Heads up: the backend moved. Read nextStep.requiresGlobalReimbursement and nextStep.depositCurrency on the Search report row, not the row-level fields, which https://github.com/Expensify/Auth/pull/26353 removes. Both are only present on a waiting-to-pay step.

# Conflicts:
#	src/hooks/useSearchBulkActions.ts
@WojtekBoman

Copy link
Copy Markdown
Contributor Author

Thanks for retesting @joekaufmanexpensify!

First account: @grgia maybe it'd be worth checking the logs for the failed PayMoneyRequest calls on jkaufman+gr9@expensifail.com from Nov 18 to confirm what happened there 🕵️. What do you think?

Reports disappearing: the app marks reports as paid before the server answers, and brings them back when they're rejected. I'll change it so they stay in place with a loader until the server answers 🫡

Single report: the app can only open the setup right away when it pays from the workspace's reimbursement account. In your tests the paying account was a different one, so the app has to ask the server first. With the change above, the report will just show a loader until the setup opens :)

@github-actions

Copy link
Copy Markdown
Contributor

🚧 joekaufmanexpensify has triggered a test Expensify/App build. You can view the workflow run here.

@github-actions

This comment has been minimized.

@grgia

grgia commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

@joekaufmanexpensify @WojtekBoman

gr9's bank account has the same bank account numbers as the submitter's deposit account, so Auth refused the two USD reports.

Comment thread src/libs/actions/IOU/PayMoneyRequest.ts Outdated
playSound(SOUNDS.SUCCESS);
// Offline the payment is queued and has to show as paid right away, and a partial payment creates the report for the held expenses optimistically
const shouldHoldOptimisticPayment =
full && !getIsOffline() && !!iouReport?.reportID && canGlobalReimbursementsRejectPayment({paymentType, policy, methodID, bankAccountList, isWiseReimbursementsBetaEnabled});

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NAB

an admin in the Wise beta who pays a US employee from a USD account without global reimbursements waits on a loader on every Pay button, and never gets the paid animation or sound.

@WojtekBoman canGlobalReimbursementsRejectPayment holds every payment from that account. WDYT about this case?

Im also find to merge and tackle as follow up

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, updated! Payments from the workspace account now show as paid right away unless the report is flagged. The loader stays only when paying from a different account :)

grgia
grgia previously approved these changes Nov 19, 2026

@grgia grgia left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

…backend does not flag them for global reimbursements
@joekaufmanexpensify

Copy link
Copy Markdown
Contributor

Closing the loop, I retested with the account (`jkaufman+gr9@expensifail.com) where I was having issues yesterday (because I was trying to pay from and into the same bank account). I changed the deposit bank account and confirmed the modal is working for me as expected now. The loader also looks way better.

2026-11-19_13-09-43.mp4

I retested the paying single report case, and the loader looks way better there as well. I do think it could be worth further exploration in the future whether we can change the single paying experience to not even require the loader, but that is NAB, since it only impacts a case where you're not using the workspace bank account.

2026-11-19_13-10-57.mp4

@joekaufmanexpensify joekaufmanexpensify left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good from my perspective. Great work, everyone!

@grgia
grgia merged commit 5350596 into Expensify:main Nov 19, 2026
41 of 42 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

🚧 grgia has triggered a test Expensify/App build. You can view the workflow run here.

@OSBotify

Copy link
Copy Markdown
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@github-actions

Copy link
Copy Markdown
Contributor

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/grgia in version: 9.5.43-0 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

@MelvinBot

Copy link
Copy Markdown
Contributor

No help site update needed — the new bulk-payment feedback is behind the wiseReimbursements beta, and the remaining changes do not make any existing article sentence incorrect.


view run

@IuliiaHerets

Copy link
Copy Markdown

Hi @WojtekBoman. How can we set isGlobalReimbursementEnabled to false?

cc @grgia @ZhenjaHorbach @joekaufmanexpensify

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/grgia in version: 9.5.47-0 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

@IuliiaHerets

Copy link
Copy Markdown

@WojtekBoman, another question: we’re a bit confused about the second bank account. Shouldn’t it also be hidden when Global Reimbursement is disabled?
In the video, we disable Global Reimbursement and enable Wise Reimbursements, but both bank accounts are still displayed. Is this expected behavior, or should only the Wise bank account be displayed?

105238A.mp4

cc @grgia @joekaufmanexpensify @ZhenjaHorbach

@joekaufmanexpensify

Copy link
Copy Markdown
Contributor

another question: we’re a bit confused about the second bank account. Shouldn’t it also be hidden when Global Reimbursement is disabled?
In the video, we disable Global Reimbursement and enable Wise Reimbursements, but both bank accounts are still displayed. Is this expected behavior, or should only the Wise bank account be displayed?

@IuliiaHerets I'm not totally following the question or the video. Could you clarify the steps that you're taking and what you think isn't working correctly in a bit more detail so I can confirm?

@IuliiaHerets

Copy link
Copy Markdown

@joekaufmanexpensify Hi! To clarify our steps and questions:

  1. Setup: We weren't sure where to set isGlobalReimbursementEnabled to false for our test bank account.
  2. Pay dropdown: In Search > Reports, when we select reports and click Pay, both USD business bank accounts are displayed. Since the second bank account isn't the workspace's reimbursement account and has Global Reimbursements disabled, should it be hidden here, or is showing both accounts expected?

@WojtekBoman

Copy link
Copy Markdown
Contributor Author

@IuliiaHerets I talked with @grgia and for now it should be [NoQA], sorry for the confusion 🙇

@WojtekBoman WojtekBoman changed the title [Payment due @ZhenjaHorbach] [Wise][Release 1] Business - UI - Entry Point Bulk Pay [Payment due @ZhenjaHorbach][NoQA][Wise][Release 1] Business - UI - Entry Point Bulk Pay Nov 20, 2026
@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/grgia in version: 9.5.51-0 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 failure ❌

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/marcaaron in version: 9.5.51-1 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

Bundle Size Analysis (Sentry):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants