Skip to content

feat: allow users to see payment method if they type 0#26717

Merged
georgeweiler merged 7 commits into
mainfrom
zero-payment-pill
Mar 2, 2026
Merged

feat: allow users to see payment method if they type 0#26717
georgeweiler merged 7 commits into
mainfrom
zero-payment-pill

Conversation

@georgeweiler

@georgeweiler georgeweiler commented Feb 27, 2026

Copy link
Copy Markdown
Contributor

Description

  • Allow opening the payment method and provider selection modals when the amount is 0
  • Skip quote fetching in both modals when amount is 0 (no quotes available for $0)
  • Hide quote display columns in payment method and provider lists when amount is 0, showing only the item name

Changes

  • BuildQuote.tsx: Removed the early return guard in handlePaymentPillPress that blocked modal navigation when amount was 0
  • PaymentSelectionModal.tsx: Added amount > 0 check to quoteFetchParams so quotes aren't fetched for $0
  • ProviderSelectionModal.tsx: Added amount > 0 check to quoteFetchParams and showQuotes prop

Changelog

CHANGELOG entry: Allow users to select a payment method if their amount is 0

Related issues

https://consensyssoftware.atlassian.net/browse/TRAM-3190

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

zero-payment-pill

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
Changes the on-ramp flow to allow opening selection modals with a $0 amount and alters quote-fetching conditions, which could surface edge cases if downstream screens assume a positive amount.

Overview
Users can now open the payment method selection modal even when the entered amount is 0 (removed the zero-amount navigation guard in BuildQuote and updated the related test expectation).

Both PaymentSelectionModal and ProviderSelectionModal now skip quote fetching and hide quote UI when amount <= 0, including conditionally omitting the quote column in PaymentMethodListItem and disabling provider quote display via showQuotes.

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

@georgeweiler georgeweiler requested a review from a team as a code owner February 27, 2026 22:41
@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.

@metamaskbot metamaskbot added the team-money-movement issues related to Money Movement features label Feb 27, 2026

@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 2 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Comment thread app/components/UI/Ramp/Views/BuildQuote/BuildQuote.tsx
@github-actions github-actions Bot added size-S and removed size-XS labels Feb 28, 2026
georgeweiler and others added 5 commits February 28, 2026 05:15
Resolved conflict in ProviderSelectionModal.tsx: kept the
amount > 0 showQuotes guard from this branch while adding
showBackButton and ordersProviders props from main.
@github-actions

github-actions Bot commented Mar 2, 2026

Copy link
Copy Markdown
Contributor

🔍 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:
The changes are focused entirely on the Ramp (Buy/Sell crypto) functionality:

  1. BuildQuote.tsx: Removed guard that prevented navigating to payment selection when amount <= 0, allowing users to browse payment methods before entering an amount.

  2. PaymentMethodListItem.tsx: Added showQuote prop to conditionally render quote display.

  3. PaymentSelectionModal.tsx: Modified to only fetch quotes when amount > 0 and passes showQuote={amount > 0} to hide quotes when no amount is entered.

  4. ProviderSelectionModal.tsx: Similar changes - only fetch quotes when amount > 0 and conditionally show quotes.

  5. BuildQuote.test.tsx: Updated unit test to reflect the new expected behavior.

These changes improve UX by allowing users to explore payment methods and providers before entering an amount, while optimizing API calls by not fetching quotes until an amount is provided. The SmokeRamps tag covers the on-ramp and off-ramp flows including payment method selection, which is exactly what these changes affect.

Performance Test Selection:
No performance tests needed. The changes are focused on conditional rendering and preventing unnecessary API calls when amount is 0. This is actually a performance optimization (fewer API calls) rather than a potential performance regression. There are no Ramp-specific performance tests available in the performance test suite.

View GitHub Actions results

@georgeweiler georgeweiler enabled auto-merge March 2, 2026 18:10
@github-actions

github-actions Bot commented Mar 2, 2026

Copy link
Copy Markdown
Contributor

⚠️ E2E Fixture Validation — Structural changes detected

Category Count
New keys 60
Missing keys 0
Type mismatches 0
Value mismatches 7 (informational)

The committed fixture schema is out of date. To update, comment:

@metamaskbot update-mobile-fixture

View full details | Download diff report

@georgeweiler georgeweiler added this pull request to the merge queue Mar 2, 2026
Merged via the queue into main with commit 9f5d5b4 Mar 2, 2026
88 checks passed
@georgeweiler georgeweiler deleted the zero-payment-pill branch March 2, 2026 18:46
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 2, 2026
@metamaskbot metamaskbot added the release-7.69.0 Issue or pull request that will be included in release 7.69.0 label Mar 2, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants