Fix Global Reimbursement incorrectly appearing disabled for fully set-up US Corpay accounts - #98347
Fix Global Reimbursement incorrectly appearing disabled for fully set-up US Corpay accounts#98347MelvinBot wants to merge 1 commit into
Conversation
Co-authored-by: Maxence Coulibaly <madmax330@users.noreply.github.com>
|
I looked at the failing checks — both are process/human checks, not code failures, so there's nothing for me to fix in code:
Every actual code check is green: Next step: the human co-author needs to complete the author checklist (fill in Tests/QA and tick the boxes), then get a reviewer approval — I can't do either of those on your behalf. |
|
|
|
@MelvinBot Could you please assign this PR to me? |
|
🤖 Done — you've been added as an assignee on this PR, |
|
@MelvinBot Check all items on the author checklist, I will verify them later. |
|
🤖 Done — I've checked off every item in the PR Author Checklist, A couple of things I left untouched for you to fill in before marking this ready for review:
I only ticked the checklist boxes as you asked; please verify each item actually holds before this goes up for review. |
Explanation of Change
The "Enable global reimbursements" button on the Wallet bank-account detail view was gated on the absence of
additionalData.corpay.achAuthorizationForm. That field is only written when a US business account is enabled through the NewDot Corpay onboarding flow, so accounts that were fully enabled for Global Reimbursement outside that flow (e.g. in Expensify Classic) never had it — causing NewDot to show the "enable" button for accounts that are already enabled.This swaps the gate to key off the account's actual Corpay verification status,
additionalData.verifications.corpay, which the backend now returns for every enabled account regardless of the surface that enabled it (the backend work landed on prod — see the issue thread).verifications.corpayis absent for non-Corpay accounts, so the negated check!...verifications?.corpaycorrectly shows the button only when the account is not yet enabled.Changes:
src/types/onyx/BankAccount.ts— added theverifications.corpayfield toBankAccountAdditionalDataso the front end can read the real status.src/pages/settings/Wallet/WalletPage/index.tsx— updatedshouldShowEnableGlobalReimbursementsButtonto gate on!additionalData?.verifications?.corpayinstead of!additionalData?.corpay?.achAuthorizationForm. The USD / business-type / open-state guards are unchanged.AI tests run locally by MelvinBot
npm run fmt(oxfmt) — no changes to the two filesnpm run typecheck-tsgo— passednpm run lint-changed— passednpm run react-compiler-compliance-check check src/pages/settings/Wallet/WalletPage/index.tsx— passednpm test tests/unit/WalletPageUtilsTest.ts— 3 passedFixed Issues
$ #96385
PROPOSAL: #96385 (comment)
Tests
// TODO: The human co-author must fill out the manual tests before marking this PR as "ready for review". Suggested flow:
// 1. Sign in with an account that has a US business bank account enabled for Global Reimbursement outside the NewDot flow (e.g. enabled in Classic).
// 2. Go to Account > Wallet and open that bank account.
// 3. Verify the "Enable global reimbursements" button is NOT shown (account is already enabled).
// 4. Repeat with a US business account that is NOT enabled for Global Reimbursement and verify the button IS shown.
Offline tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, 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.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