feat: add getPaymentMethodsForContext to ramps-controller - #9801
Draft
saustrie-consensys wants to merge 3 commits into
Draft
feat: add getPaymentMethodsForContext to ramps-controller#9801saustrie-consensys wants to merge 3 commits into
saustrie-consensys wants to merge 3 commits into
Conversation
Add a context-scoped payment-method API aligned with getQuotes provider resolution so Headless/MM Pay can list request-eligible methods for a deposit asset without mutating the Buy payment-method catalog (TRAM-3838).
Contributor
Author
|
@metamaskbot publish-previews |
saustrie-consensys
force-pushed
the
saustrie/tram-3838-payment-methods-for-context
branch
from
August 7, 2026 13:25
0a0be4b to
1bbcc4b
Compare
saustrie-consensys
force-pushed
the
saustrie/tram-3838-payment-methods-for-context
branch
from
August 7, 2026 13:25
1bbcc4b to
8321b8c
Compare
Contributor
Author
|
@metamaskbot publish-previews |
Contributor
|
Preview builds have been published. Learn how to use preview builds in other projects. Expand for full list of packages and versions. |
Contributor
|
Preview builds have been published. Learn how to use preview builds in other projects. Expand for full list of packages and versions. |
10 tasks
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Explanation
Money account "Pay with" (MM Pay / Headless Buy) currently lists payment methods from the Buy flow's globally selected provider and token via
useRampsPaymentMethods, while deposit quotes usegetQuotesagainst the deposit asset withautoSelectProvider+restrictToKnownOrNativeProviders(andmoneyHeadlessAllProvidersallowlist pick). That mismatch surfaces Revolut Pay and similar Buy-only methods in Money, then fails quoting (TRAM-3838 / metamask-mobile#34109).This PR adds
RampsController.getPaymentMethodsForContext, a generic context-scoped API aligned withgetQuotesprovider options:providersrestrictToKnownOrNativeProviders, including flag-off restricted/native resolution and flag-on supporting providers (intersect allowlist when non-empty for pick survivors)providersare omitted (UB2)By default the call is request-only and does not mutate Buy
paymentMethods.data/.selected. PassupdateState: trueonly when a caller wants catalog write semantics. Fan-out results are deduped by payment-method id with conservative delay, best score, and deterministic name/icon merge. Partial provider failures still return methods from successful fetches.Phase 1 of Option C only. Does not land
getSmartSelectedQuote,applyQuoteContext, or full UB2 dumbification (tracked as TRAM-3856).References
Checklist