Skip to content

chore(runway): cherry-pick fix(ramp): show PayPal in payment selector for UB2 (TRAM-3462) cp-7.74.0#29060

Merged
chloeYue merged 1 commit into
release/7.74.00from
runway-cherry-pick-7.74.0-1776696559
Apr 20, 2026
Merged

chore(runway): cherry-pick fix(ramp): show PayPal in payment selector for UB2 (TRAM-3462) cp-7.74.0#29060
chloeYue merged 1 commit into
release/7.74.00from
runway-cherry-pick-7.74.0-1776696559

Conversation

@runway-github

@runway-github runway-github Bot commented Apr 20, 2026

Copy link
Copy Markdown
Contributor

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

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

https://www.loom.com/share/865aefe1f2024ed28f0564192c01bf0b

After

https://www.loom.com/share/556420ed2f3c41028cc9a1fc21b0d847

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

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.

Reviewed by Cursor Bugbot for commit
8c4209e. Bugbot is set up for automated
code reviews on this repo. Configure
here.

[5048eae](https://github.com/MetaMask/metamask-mobile/commit/5048eae296f9bb71d32e2c3ca6cdb029d5632e85)

… 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 -->
@runway-github runway-github Bot requested a review from a team as a code owner April 20, 2026 14:49
@github-actions

Copy link
Copy Markdown
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.

@metamaskbotv2 metamaskbotv2 Bot added the team-bots Bot team (for MetaMask Bot, Runway Bot, etc.) label Apr 20, 2026
@github-actions github-actions Bot added the risk-high Extensive testing required · High bug introduction risk label Apr 20, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

⏭️ Smart E2E selection skipped - PR targets a release branch (release/*)

All E2E tests pre-selected.

View GitHub Actions results

@sonarqubecloud

Copy link
Copy Markdown

@chloeYue chloeYue left a comment

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.

LGTM

@github-actions

Copy link
Copy Markdown
Contributor

E2E Fixture Validation — Schema is up to date
12 value mismatches detected (expected — fixture represents an existing user).
View details

@chloeYue chloeYue merged commit 9de45a5 into release/7.74.00 Apr 20, 2026
151 of 153 checks passed
@chloeYue chloeYue deleted the runway-cherry-pick-7.74.0-1776696559 branch April 20, 2026 19:45
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 20, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

risk-high Extensive testing required · High bug introduction risk size-S team-bots Bot team (for MetaMask Bot, Runway Bot, etc.)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants