fix(router): update last used when the customer acceptance is passed in the recurring payment #5116
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
We need to update the last used for a payment method as whenever a payment is done with that particular saved payment method. Currently we if a customer is making a payment (CIT) with the payment data that is same as the one that is already saved we are not updating the last used a for the payment method in the db.
In this case the new CIT with the payment_data that is same as the one saved also needs to be tied to the saved pm and the last used for it needs to be updated.
Additional Changes
Motivation and Context
How did you test it?
-> Create mca
-> Save card for customer with setup_future_usage offsession
-> Add a one more payment method for the same customer
-> Do payment method list for the customer
-> The above result will display the apple pay on the top as it is recently added
-> Now make a payment with the saved card
-> Do payment method list for the customer and the card should appear at the top
Checklist
cargo +nightly fmt --all
cargo clippy