Skip to content

feat(ramps): adds payment selection modal#25681

Merged
georgeweiler merged 18 commits intomainfrom
payment-method-modal
Feb 6, 2026
Merged

feat(ramps): adds payment selection modal#25681
georgeweiler merged 18 commits intomainfrom
payment-method-modal

Conversation

@georgeweiler
Copy link
Copy Markdown
Contributor

@georgeweiler georgeweiler commented Feb 5, 2026

Description

Introduces the payment selection modal and payment selection flow. Users can choose a payment method (e.g. debit/credit card). Quotes and an option to change provider coming soon.

Changelog

CHANGELOG entry: adds functionality for selecting a payment method

Related issues

Fixes:

Manual testing steps

Feature: my feature name

  Scenario: user [verb for user action]
    Given [describe expected initial app state]

    When user [verb for user action]
    Then [describe expected outcome]

Screenshots/Recordings

Before

After

Loom video of the feature working:
https://www.loom.com/share/bfcf206254ff46b48107f8efb55875e5

Screenshot 2026-02-04 at 7 19 45 PM

Loading state:
Screenshot 2026-02-04 at 7 19 09 PM

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Note

Medium Risk
Touches Ramp navigation and selection state (payment method/provider) and upgrades @metamask/ramps-controller, which could affect runtime behavior across the ramps flow despite being mostly additive and UI-focused.

Overview
Adds a new payment selection bottom sheet modal to the Ramp buy flow, letting users pick a paymentMethod (and a stubbed provider-selection view) and persisting the choice via useRampsController.setSelectedPaymentMethod.

Updates BuildQuote to use controller-managed selectedToken/selectedPaymentMethod (instead of route param lookup), display a “Select payment method” placeholder, show a loading spinner/disable interaction while payment methods load, and navigate to the new modal. Also centralizes payment-delay string formatting into shared Aggregator/utils helpers and bumps @metamask/ramps-controller to ^7.0.0, with new/updated tests and snapshots covering the modal, pill loading state, and navigation.

Written by Cursor Bugbot for commit 4c37973. This will update automatically on new commits. Configure here.

@georgeweiler georgeweiler requested a review from a team as a code owner February 5, 2026 00:29
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 5, 2026

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.

@metamaskbot metamaskbot added the team-money-movement issues related to Money Movement features label Feb 5, 2026
@georgeweiler georgeweiler changed the title Payment method modal feat(ramps): adds payment selection modal Feb 5, 2026
@github-actions github-actions bot added the size-L label Feb 5, 2026
@github-actions github-actions bot added size-XL and removed size-L labels Feb 5, 2026
@socket-security
Copy link
Copy Markdown

socket-security bot commented Feb 5, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatednpm/​@​metamask/​ramps-controller@​6.0.0 ⏵ 7.0.09810078 +196 +1100

View full report

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

@github-actions github-actions bot added size-L and removed size-XL labels Feb 5, 2026
@amitabh94
Copy link
Copy Markdown
Contributor

This is looking great! 🔥
Quick nit: Why do we have so much blank space at the bottom of the payment modal ?

Copy link
Copy Markdown
Contributor

@amitabh94 amitabh94 left a comment

Choose a reason for hiding this comment

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

Minor comments but overall looks 💯

Comment on lines +56 to +83
const translateX = useSharedValue(0);

const paymentPageStyle = useAnimatedStyle(() => ({
transform: [{ translateX: translateX.value }],
}));

const providerPageStyle = useAnimatedStyle(() => ({
transform: [{ translateX: translateX.value + screenWidth }],
}));

const handleChangeProviderPress = useCallback(() => {
translateX.value = withTiming(-screenWidth, {
duration: ANIMATION_DURATION,
});
}, [screenWidth, translateX]);

const handleProviderBack = useCallback(() => {
translateX.value = withTiming(0, { duration: ANIMATION_DURATION });
}, [translateX]);

const handleProviderSelect = useCallback(
(provider: Provider) => {
setSelectedProvider(provider);
translateX.value = withTiming(0, { duration: ANIMATION_DURATION });
},
[setSelectedProvider, translateX],
);

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.

Can we double check if this is the best way to do horizontal animation and there isn't already a helper that is being used in other modals?

@github-actions github-actions bot added size-XL and removed size-L labels Feb 5, 2026
@github-actions github-actions bot added size-L and removed size-XL labels Feb 5, 2026
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.

Looks like we are updating more than we should.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 6, 2026

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeRamps
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: medium
  • AI Confidence: 90%
click to see 🤖 AI reasoning details

E2E Test Selection:
This PR focuses entirely on the Ramps (buy/sell crypto) feature with the following changes:

  1. Package Update: Upgrades @metamask/ramps-controller from v6.0.0 to v7.0.0 - this is a major version bump which could introduce breaking changes in the ramps functionality.

  2. New PaymentSelectionModal: Introduces a new modal component for selecting payment methods and providers in the buy/sell flow. This includes:

    • PaymentSelectionModal.tsx - Main modal with animated transitions
    • PaymentMethodListItem.tsx - List items for payment methods
    • PaymentMethodQuote.tsx - Quote display component
    • ProviderSelection.tsx - Provider selection view
  3. BuildQuote Updates: Modified to integrate with the new payment selection modal, changing how payment methods are selected.

  4. PaymentMethodPill Updates: Added loading state support for better UX during payment method loading.

  5. Utility Refactoring: Extracted formatDelayFromArray and renderDelayToken functions from PaymentMethod.tsx to utils for reuse.

  6. New Navigation Route: Added PAYMENT_SELECTION route for the new modal.

All changes are scoped to the Ramps feature (app/components/UI/Ramp/). The SmokeRamps tag covers the off-ramp token amount input screen, on-ramp flows, and payment method selection - all of which could be affected by these changes. No other features (confirmations, wallet platform, accounts, etc.) are impacted by these changes.

Performance Test Selection:
The changes are localized to the Ramps feature and introduce new UI components (PaymentSelectionModal with animations using react-native-reanimated). While there are new components with FlatList rendering and animations, these are specific to the payment selection flow within the buy/sell crypto feature. The changes don't affect core app performance areas like app launch, login, account list rendering, asset loading, or swap flows. The Ramps feature doesn't have dedicated performance tests, and the changes are unlikely to cause measurable performance regressions in the existing performance test areas.

View GitHub Actions results

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Feb 6, 2026

@georgeweiler georgeweiler added this pull request to the merge queue Feb 6, 2026
Merged via the queue into main with commit fa38c18 Feb 6, 2026
86 checks passed
@georgeweiler georgeweiler deleted the payment-method-modal branch February 6, 2026 01:43
@github-actions github-actions bot locked and limited conversation to collaborators Feb 6, 2026
@metamaskbot metamaskbot added the release-7.66.0 Issue or pull request that will be included in release 7.66.0 label Feb 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.66.0 Issue or pull request that will be included in release 7.66.0 size-L team-money-movement issues related to Money Movement features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants