feat(router): add debit routing support for saved card flow #7923
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.
Type of Change
Description
Once debit routing is performed for a card and the card is saved in the payment, we can also store the debit routing output. This allows us to reuse the saved data in future saved card flows instead of re-running the debit routing process.
Changes:
In this PR, support for co-badged card data has been introduced. This data will be stored in the payment_method_data column of the payment_methods table and will contain the debit routing output.
In the saved card flow, we check if the co-badged card data is present in the payment_method_data of the payment method. If it is present, the same data will be sent to the open router for debit routing.
If the co-badged card data is not available, then the card_isin, which contains the card BIN, will be used to call the open router.
Additional Changes
add debit routing support for saved card flow
Motivation and Context
How did you test it?
Tested locally by creating dummy co-badged card bin dump
-> Create a merchant account and business profile
-> Enable debit routing and provide merchant business country for the business profile
-> Create a payment
-> Connector request indicating the card brand as star

-> Create a payment for the same customer
-> list payment methods for the same customer
-> Confirm the a payment with the payment token
-> Logs showing the debit routing flow was triggered with the previously saved co-badged card data


-> Logs showing the card brand was set star in the connector request
Checklist
cargo +nightly fmt --all
cargo clippy