[CP Staging] Revert "Hide paying invoices via Expensify behind a beta" (#82046)#82546
[CP Staging] Revert "Hide paying invoices via Expensify behind a beta" (#82046)#82546mountiny wants to merge 1 commit into
Conversation
|
@marcochavezf 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] |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a285842a07
ℹ️ 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".
| if (hasIntentToPay) { | ||
| const currentBankInformation = formattedPaymentMethods.at(0) as BankAccount; |
There was a problem hiding this comment.
Guard invoice one-tap pay on eligible Expensify option
This unconditional if (hasIntentToPay) now forces invoice payments down the EXPENSIFY path even when that option is not actually eligible (for example, unsupported invoice currency, or formattedPaymentMethods still empty while Onyx data is loading). That bypasses the isCurrencySupported gating used to build invoice submenu options and can either trigger an invalid pay-via-Expensify attempt or crash when formattedPaymentMethods.at(0) is undefined and currentBankInformation.accountData is accessed. Gate this branch with the same eligibility check used for invoice options and verify a payment method exists before forcing Expensify.
Useful? React with 👍 / 👎.
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
|
🚧 @mountiny 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! 🧪🧪
|
|
The behaviour is intentional now https://expensify.slack.com/archives/C01GTK53T8Q/p1771243142598549?thread_ts=1771064936.144169&cid=C01GTK53T8Q |
Explanation of Change
This reverts PR #82046 ("Hide paying invoices via Expensify behind a beta").
PR #82046 introduced a
PAY_INVOICE_VIA_EXPENSIFYbeta gate that hid the ability to pay invoices via Expensify bank accounts/cards. This revert removes that beta gate, restoring the original invoice payment behavior where currency support alone determines whether pay-via-Expensify options are shown.Changes across 4 files:
src/CONST/index.ts— Removed thePAY_INVOICE_VIA_EXPENSIFYbeta constant.src/components/SettlementButton/index.tsx— RemovedisPayInvoiceViaExpensifyBetaEnabledchecks; revertedshowPayViaExpensifyOptionsback toisCurrencySupported; removed theinvoiceDefaultValuegating logic; restored the originalhasIntentToPayternary for default payment values.src/hooks/useBulkPayOptions.ts— RemovedusePermissionsimport and beta check; revertedshowPayViaExpensifyOptionsback toisCurrencySupported.src/hooks/usePaymentOptions.ts— RemovedusePermissionsimport and beta check; revertedshowPayViaExpensifyOptionsback toisCurrencySupported.Conflict resolution:
There was one conflict in
src/hooks/useBulkPayOptions.ts. After PR #82046 was merged, a separate PR addedconst activeAdminPolicies = useActiveAdminPolicies();on an adjacent line. The revert wanted to remove the two lines added by #82046 (usePermissionsdestructure + beta check), but Git couldn't auto-resolve because the nearbyactiveAdminPoliciesline didn't exist at the time of the original PR. Resolution: removed the two PR #82046 lines while keeping theactiveAdminPoliciesline which belongs to a different PR. The other 3 files auto-merged without conflicts.Fixed Issues
$ #82485
PROPOSAL:
Tests
Offline tests
N/A - This is a revert of a beta gate, no new offline behavior introduced.
QA Steps
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