Skip to content

fix(ramps-controller): skip payment methods fetch when token is unsupported by provider#8103

Open
AxelGes wants to merge 3 commits intomainfrom
fix/ramps-skip-payment-methods-for-unsupported-token
Open

fix(ramps-controller): skip payment methods fetch when token is unsupported by provider#8103
AxelGes wants to merge 3 commits intomainfrom
fix/ramps-skip-payment-methods-for-unsupported-token

Conversation

@AxelGes
Copy link
Contributor

@AxelGes AxelGes commented Mar 4, 2026

Summary

  • In setSelectedProvider, skip the getPaymentMethods fetch when the selected token is explicitly not supported by the new provider (based on supportedCryptoCurrencies)
  • Previously, the fetch would proceed with an unsupported token's assetId, causing the API to return empty results — leaving the user with no payment methods and no feedback
  • The UI's Token Not Available modal handles this case, so no fetch is needed

How it works

supportedCryptoCurrencies is treated as a blocklist hint: if the field is absent or doesn't explicitly exclude the token, we fetch as usual. Only skip when supportedCryptoCurrencies[assetId] is explicitly false.

Test plan

  • Select a token, change provider to one that explicitly doesn't support the token — confirm payment methods are not fetched and Token Not Available modal appears
  • Select a supported token, change provider — confirm payment methods load normally

Note

Low Risk
Low risk: a small guard in setSelectedProvider to avoid an unnecessary getPaymentMethods call based on provider metadata, covered by targeted unit tests. Main risk is behavioral change if supportedCryptoCurrencies data is incomplete or incorrect.

Overview
Prevents setSelectedProvider from fetching payment methods when the currently selected token is explicitly unsupported by the newly selected provider (via provider.supportedCryptoCurrencies[assetId] === false), avoiding misleading empty payment-method state.

Adds unit tests for the new skip/fetch conditions (unsupported token, supported token, and missing supportedCryptoCurrencies field) and documents the fix in the ramps-controller changelog.

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

…ported by provider

When setSelectedProvider is called, avoid fetching payment methods if
the selected token is explicitly not supported by the new provider
(according to supportedCryptoCurrencies). Fetching with an unsupported
token causes the API to return empty results for the wrong reason,
leaving the user with no payment methods and no feedback. The UI's
Token Not Available modal handles this case instead.
@AxelGes AxelGes requested a review from a team as a code owner March 4, 2026 02:36
Copy link

@cursor cursor bot left a comment

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.

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

AxelGes added 2 commits March 3, 2026 23:55
…rencies check and add changelog entry

Use !== false instead of === true so that tokens absent from the map
are treated as supported (blocklist, not allowlist).
@AxelGes AxelGes requested a review from a team as a code owner March 4, 2026 03:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant