feat: add support for fiat payment methods in PayWithModal#30184
Conversation
…nfig and adjust renderTrailing function
…sk/metamask-mobile into vs/pay-with-bottom-sheet-skeleton
…ed on transaction metadata
…ability in transaction selection
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
…ismissal on payment selection changes
…ection in usePayWithCryptoSection
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
Tag Selection Rationale:
The changes are feature-flag gated ( Performance Test Selection: |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit cfde84e. Configure here.
| }); | ||
| navigation.goBack(); | ||
| }, [navigation, preferredToken, selectToken]); | ||
| }, [navigation, preferredToken, setPayToken]); |
There was a problem hiding this comment.
Double navigation pop when switching from fiat to crypto
High Severity
handlePreferredTokenPress calls both setPayToken(...) and navigation.goBack(). When a fiat method was previously selected, the controller's updatePaymentToken atomically clears the fiat payment. useDismissOnPaymentChange in PayWithBottomSheet then detects the selectedPaymentMethodId change and fires a second navigation.goBack(). The latch (isDismissingRef) only guards against multiple hook-triggered dismissals — it does not prevent the combination of the manual goBack() from the press handler plus the hook's goBack(). This double-pop dismisses the bottom sheet AND the screen behind it.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit cfde84e. Configure here.
|





Description
Adds a Bank and card section to the redesigned Pay With bottom sheet so users can pay a confirmation with a fiat payment method (Debit/Credit card, Apple Pay, Google Pay, etc.) in addition to crypto. The new section wraps the existing
useFiatPaymentHighlightedActionshook so it inherits the same gating and selection behavior the legacyPayWithModalalready uses for fiat methods — same data source, same controller writes, new UI surface.When a user taps a fiat method, the controller's
selectedPaymentMethodIdupdates and the bottom sheet closes. Tapping an already-selected fiat row just dismisses the sheet without deselecting. The section renders above the existing Crypto section.When the new bottom sheet is enabled, the legacy
PayWithModalno longer surfaces fiat highlighted items — it continues to serve as the underlying token picker reachable via "Other assets". The Bank and card section becomes the single source of truth for fiat payment methods in this flow.A few related fixes that surfaced during integration:
Changelog
CHANGELOG entry: null
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/CONF-1364
Manual testing steps
Screenshots/Recordings
WhatsApp.Video.2026-05-14.at.14.26.49.mp4
Before
After
Pre-merge author checklist
Performance checks (if applicable)
trace()for usage andaddTokenfor an exampleFor performance guidelines and tooling, see the Performance Guide.
Pre-merge reviewer checklist
Note
Medium Risk
Moderate UI/state-flow changes in the confirmations payment picker: selection semantics and navigation dismissal now react to both token and fiat method changes, which could cause regressions in how pay methods are applied or screens are popped.
Overview
Adds a new Bank and card section to the redesigned Pay With bottom sheet via
usePayWithFiatSection, mappinguseFiatPaymentHighlightedActionsinto selectable rows (withPaymentMethodIcon) and ordering it before the crypto section.Updates crypto-row selection behavior to be mutually exclusive with fiat selection (hides/clears crypto checkmarks/rows when a fiat method is selected) and replaces
useDismissOnPayTokenChangewithuseDismissOnPaymentChangeso the bottom sheet dismisses once on either pay-token or fiat-method changes.When the new bottom sheet is enabled (
isPayWithBottomSheetEnabled),PayWithModalnow suppresses fiat highlighted actions so it functions only as the “Other assets” token picker; tests and theen.jsonstring forconfirm.pay_with_bottom_sheet.bank_and_cardare added/updated accordingly.Reviewed by Cursor Bugbot for commit cfde84e. Bugbot is set up for automated code reviews on this repo. Configure here.