chore(runway): cherry-pick fix(ramp): show PayPal in payment selector for UB2 (TRAM-3462) cp-7.74.0#29060
Merged
Conversation
… for UB2 (TRAM-3462) cp-7.74.0 (#29046) ## **Description** In Unified Buy V2, PayPal is not shown in the Pay With bottom sheet even when the server would accept it. Two defects stack: 1. `PaymentSelectionModal` and `ProviderSelectionModal` called `useRampsQuotes` without `redirectUrl`. The quotes API only materializes a PayPal dummy quote when both `redirectUrl` and `walletAddress` are provided; otherwise PayPal is only returned under `customActions`. `BuildQuote` already sends `redirectUrl`, but the selection-stage modals were inconsistent. 2. `PaymentSelectionModal`'s visibility filter in `renderListContent` excluded any `success` entry with `quote.isCustomAction: true`, so even when PayPal surfaced in `success` (e.g. when we do pass `redirectUrl`), its payment method row was still filtered out and the "No payment methods are available." banner was shown. This PR: - Passes `redirectUrl: getRampCallbackBaseUrl()` from `PaymentSelectionModal` and `ProviderSelectionModal`, matching `BuildQuote`'s existing shape so the quotes request is consistent across selection stages. - Drops `!isCustomAction(q)` from the `visiblePaymentMethods` filter so custom-action quotes count as "available" for listing. The per-item `matchedQuote` find remains strict, so custom-action rows still do not render a misleading priced preview. ## **Changelog** CHANGELOG entry: Fixed a bug where PayPal was missing from the Pay With list in Unified Buy V2 and the selector showed "No payment methods are available." instead. ## **Related issues** Fixes: https://consensyssoftware.atlassian.net/jira/software/c/projects/TRAM/boards/1568?assignee=712020%3Afd12f7ea-d9e1-4a0a-8a26-36804c9e11c9&selectedIssue=TRAM-3462 ## **Manual testing steps** ```gherkin Feature: Pay With selector surfaces PayPal (UB2) Scenario: PayPal is available as a payment method Given the user is in the Unified Buy V2 flow with PayPal supported in their region And the user has selected a crypto asset and amount When the user opens the Pay With bottom sheet Then the PayPal row appears in the list And the "No payment methods are available." banner is not shown Scenario: PayPal row does not show a misleading price Given PayPal is available in the Pay With list When the user views the PayPal row Then no crypto amount or fiat amount is rendered for the row And the row remains tappable Scenario: Selecting PayPal continues into its checkout flow Given PayPal is listed in the Pay With sheet When the user taps the PayPal row Then the sheet closes and the existing custom-action checkout flow runs ``` ## **Screenshots/Recordings** ### **Before** <!-- [screenshots/recordings] --> https://www.loom.com/share/865aefe1f2024ed28f0564192c01bf0b ### **After** <!-- [screenshots/recordings] --> https://www.loom.com/share/556420ed2f3c41028cc9a1fc21b0d847 ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I've included tests if applicable - [ ] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I've applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Small UI selection logic change plus added test coverage; risk is limited to which payment methods are shown and the quote request parameters sent. > > **Overview** > Fixes Unified Buy V2 payment/provider selection so quote fetches from `PaymentSelectionModal` and `ProviderSelectionModal` include `redirectUrl: getRampCallbackBaseUrl()`, aligning them with the Build Quote flow and enabling providers that require a redirect URL to surface correctly. > > Updates the payment-method visibility filter to treat custom-action quotes as “available” (so their rows remain listed), while keeping per-row price previews gated by non-custom-action quotes; tests were updated/added to cover both the new `redirectUrl` param and the custom-action visibility/no-price behavior. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 8c4209e. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
Contributor
|
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. |
Contributor
🔍 Smart E2E Test Selection⏭️ Smart E2E selection skipped - PR targets a release branch (release/*) All E2E tests pre-selected. |
|
Contributor
|
✅ E2E Fixture Validation — Schema is up to date |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
In Unified Buy V2, PayPal is not shown in the Pay With bottom sheet even
when the server would accept it. Two defects stack:
PaymentSelectionModalandProviderSelectionModalcalleduseRampsQuoteswithoutredirectUrl. The quotes API only materializesa PayPal dummy quote when both
redirectUrlandwalletAddressareprovided; otherwise PayPal is only returned under
customActions.BuildQuotealready sendsredirectUrl, but the selection-stage modalswere inconsistent.
PaymentSelectionModal's visibility filter inrenderListContentexcluded any
successentry withquote.isCustomAction: true, so evenwhen PayPal surfaced in
success(e.g. when we do passredirectUrl),its payment method row was still filtered out and the "No payment
methods are available." banner was shown.
This PR:
redirectUrl: getRampCallbackBaseUrl()fromPaymentSelectionModalandProviderSelectionModal, matchingBuildQuote's existing shape so the quotes request is consistent acrossselection stages.
!isCustomAction(q)from thevisiblePaymentMethodsfilter socustom-action quotes count as "available" for listing. The per-item
matchedQuotefind remains strict, so custom-action rows still do notrender a misleading priced preview.
Changelog
CHANGELOG entry: Fixed a bug where PayPal was missing from the Pay With
list in Unified Buy V2 and the selector showed "No payment methods are
available." instead.
Related issues
Fixes:
https://consensyssoftware.atlassian.net/jira/software/c/projects/TRAM/boards/1568?assignee=712020%3Afd12f7ea-d9e1-4a0a-8a26-36804c9e11c9&selectedIssue=TRAM-3462
Manual testing steps
Screenshots/Recordings
Before
https://www.loom.com/share/865aefe1f2024ed28f0564192c01bf0b
After
https://www.loom.com/share/556420ed2f3c41028cc9a1fc21b0d847
Pre-merge author checklist
Docs and MetaMask Mobile
Coding
Standards.
if applicable
guidelines).
Not required for external contributors.
Pre-merge reviewer checklist
app, test code being changed).
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
Note
Low Risk
Small UI selection logic change plus added test coverage; risk is
limited to which payment methods are shown and the quote request
parameters sent.
Overview
Fixes Unified Buy V2 payment/provider selection so quote fetches from
PaymentSelectionModalandProviderSelectionModalincluderedirectUrl: getRampCallbackBaseUrl(), aligning them with the BuildQuote flow and enabling providers that require a redirect URL to surface
correctly.
Updates the payment-method visibility filter to treat custom-action
quotes as “available” (so their rows remain listed), while keeping
per-row price previews gated by non-custom-action quotes; tests were
updated/added to cover both the new
redirectUrlparam and thecustom-action visibility/no-price behavior.
Reviewed by Cursor Bugbot for commit
8c4209e. Bugbot is set up for automated
code reviews on this repo. Configure
here.