Skip to content

fix(ramp): show PayPal in payment selector for UB2 (TRAM-3462) cp-7.74.0#29046

Merged
saustrie-consensys merged 2 commits into
mainfrom
fix/ramp-paypal-payment-selection-tram-3462
Apr 20, 2026
Merged

fix(ramp): show PayPal in payment selector for UB2 (TRAM-3462) cp-7.74.0#29046
saustrie-consensys merged 2 commits into
mainfrom
fix/ramp-paypal-payment-selection-tram-3462

Conversation

@saustrie-consensys

@saustrie-consensys saustrie-consensys 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.

PaymentSelectionModal and ProviderSelectionModal omitted `redirectUrl`
when fetching quotes, so the API never materialized a PayPal dummy quote
and PayPal only appeared in `customActions`. The per-row visibility
filter also excluded `isCustomAction: true` quotes, so PayPal was hidden
even when returned. Pass `redirectUrl: getRampCallbackBaseUrl()` from
both modals and drop the `!isCustomAction(q)` clause from the
`visiblePaymentMethods` filter so custom-action quotes count as
available. The per-item matchedQuote find still skips custom-action
quotes so rows without a priced quote don't render a misleading amount.
@saustrie-consensys saustrie-consensys added the team-money-movement issues related to Money Movement features label Apr 20, 2026
@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.

@saustrie-consensys saustrie-consensys self-assigned this Apr 20, 2026
@saustrie-consensys saustrie-consensys marked this pull request as ready for review April 20, 2026 13:33
@saustrie-consensys saustrie-consensys requested a review from a team as a code owner April 20, 2026 13:33

@cursor cursor Bot 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.

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

Fix All in Cursor

❌ 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 1f06b92. Configure here.

@wachunei

Copy link
Copy Markdown
Member

aah so we were actually not sending the redirect url in that view get quotes call, great catch.

One question, if paypal is selected the flow works normally?

Please fix the unused useEffect by removing it and add cp-7.74.0 to the title so we can include this as a cherry pick. 🙏

@saustrie-consensys

Copy link
Copy Markdown
Contributor Author

aah so we were actually not sending the redirect url in that view get quotes call, great catch.

One question, if paypal is selected the flow works normally?

Please fix the unused useEffect by removing it and add cp-7.74.0 to the title so we can include this as a cherry pick. 🙏

I plan to remove the useEffect. It was left over when I was debugging.

As far as "works normally", yes - I am directed to PayPal's iframe/widget url.

Screenshot 2026-04-20 at 4 43 08 PM @wachunei

@saustrie-consensys saustrie-consensys changed the title fix(ramp): show PayPal in payment selector for UB2 (TRAM-3462) fix(ramp): show PayPal in payment selector for UB2 (TRAM-3462) cp-7.74.0 Apr 20, 2026
@saustrie-consensys

saustrie-consensys commented Apr 20, 2026

Copy link
Copy Markdown
Contributor Author

@wachunei yes — BuildQuote was already sending redirectUrl, so when PayPal is the active payment method the controller fetches the PayPal custom-action quote, canContinue evaluates true, and Continue routes through the custom-action checkout from #27364. This PR doesn't touch that path; it only unblocks the Pay-With selector from hiding PayPal.

useEffect removed and cp-7.74.0 appended to the title. 🙏

@saustrie-consensys

Copy link
Copy Markdown
Contributor Author

@wachunei All changes were made

@github-actions github-actions Bot added the risk-low Low testing needed · Low bug introduction risk label Apr 20, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

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

E2E Test Selection:
The 4 changed files are all within the Ramp feature area (app/components/UI/Ramp/Views/Modals/). Two are implementation files and two are their corresponding unit test files.

Key changes:

  1. PaymentSelectionModal.tsx: (a) Adds redirectUrl: getRampCallbackBaseUrl() to the quotes request, enabling callback URL support for ramp providers. (b) Fixes payment method filtering logic — previously, payment methods with only custom-action quotes (e.g., PayPal) were hidden from users; now they remain visible since custom-action providers have their own checkout flow.
  2. ProviderSelectionModal.tsx: Adds the same redirectUrl: getRampCallbackBaseUrl() to the quotes request.
  3. Test files: Updated to assert the new redirectUrl parameter is passed and to verify the corrected custom-action quote filtering behavior.

These changes are entirely scoped to the Ramp (buy/sell) feature. No shared components (navigation, Engine, controllers, confirmations), no cross-cutting concerns. SmokeRamps is the correct and only tag needed. No dependent tags are required per the tag descriptions.

Performance Test Selection:
The changes are limited to Ramp modal UI components — adding a redirectUrl parameter to quote requests and fixing payment method visibility logic. These are not performance-sensitive code paths and do not affect rendering performance, data loading, account/network lists, or app startup. No performance tests are warranted.

View GitHub Actions results

@sonarqubecloud

Copy link
Copy Markdown

@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

@saustrie-consensys saustrie-consensys added this pull request to the merge queue Apr 20, 2026
Merged via the queue into main with commit 5048eae Apr 20, 2026
101 checks passed
@saustrie-consensys saustrie-consensys deleted the fix/ramp-paypal-payment-selection-tram-3462 branch April 20, 2026 14:40
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 20, 2026
@metamaskbotv2 metamaskbotv2 Bot added the release-7.75.0 Issue or pull request that will be included in release 7.75.0 label Apr 20, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.75.0 Issue or pull request that will be included in release 7.75.0 risk-low Low testing needed · Low bug introduction risk size-S team-money-movement issues related to Money Movement features team-ramps

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants