fix: route fiat payment method through strategy selection to enable fiat strategy#8720
Merged
fix: route fiat payment method through strategy selection to enable fiat strategy#8720
Conversation
pedronfigueiredo
previously approved these changes
May 6, 2026
pedronfigueiredo
approved these changes
May 6, 2026
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
The fiat strategy was never selected during quote retrieval because of two issues:
getStrategyOrdernever includedFiat— The default strategy order only containedRelayandAcross. The fiat payment method ID was not passed into the strategy routing function, soTransactionPayStrategy.Fiatwas never part of the strategy list.getQuotesbailed early on empty requests — When a fiat payment method is selected without a crypto payment token,buildQuoteRequestsreturns an empty array (nopaymentToken). The guardif (!requests?.length)short-circuited before any strategy could run. The fiat strategy doesn't need these requests — it derives its own relay request fromamountFiatinternally.Changes
getStrategyOrder— Added optionalfiatPaymentMethodIdparameter. When provided, early returns[TransactionPayStrategy.Fiat]so only the fiat strategy is used.#getStrategiesWithFallback— Now passestransactionData.fiatPayment.selectedPaymentMethodIdthrough togetStrategyOrder.getQuotes— Changed the empty-requests guard from!requests?.lengthto!requests?.length && !fiatPaymentMethodso the strategy loop runs when a fiat payment method is active.References
Checklist
Note
Medium Risk
Changes strategy routing and quote retrieval guard logic, which can affect which pay strategy executes and when quotes are fetched, but scope is limited to the transaction-pay controller and covered by new unit tests.
Overview
Fixes fiat pay quote retrieval by threading
fiatPayment.selectedPaymentMethodIdinto strategy selection and ensuring it can drive theFiatstrategy.getStrategyOrdernow accepts an optional fiat payment method ID and short-circuits to Fiat-only strategy ordering when present, andTransactionPayControllerpasses this value through during fallback strategy resolution. Quote retrieval no longer bails early on empty request sets when a fiat payment method is selected, allowing fiat quotes even without a cryptopaymentToken.Adds targeted test coverage for the new routing behavior and updates the package changelog under Fixed.
Reviewed by Cursor Bugbot for commit 5e81276. Bugbot is set up for automated code reviews on this repo. Configure here.