feat(router): add automatic retries and step up 3ds flow #2834
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
add automatic retries and step up 3ds flow
Auto Retries -> When a payment fails due to connector error and if the error is decided to be retryable by Gsm. Then instead of returning error the trackers are updated and the next eligible connector is called based on merchant configuration.
Step up 3Ds -> When a no-3ds payment fails due to connector error and if the error is eligible to step up by Gsm. Then instead of returning error the trackers are updated and the payment is retried by enforcing 3ds with same connector based on merchant configuration.
Additional Changes
Motivation and Context
How did you test it?
Tested Manually
Enable retries for merchant by enabling
should_call_gsm_{mid}
configSet max_auto_retries_{mid} config to 1
Add GSM for relevant connector, code and message to enable retry with step_up_possible as false
Make a payment to replicate the payment failure with code and message configured in Gsm, can be seen that payment is retried with next eligible connector (attempt_count = 2 and can see detailed view using payments retrieve api with expand_attempts = true flag)
Now enable step_up_enabled_{mid} config for merchant
Update Gsm to enable step_up_possible
Now, redo the same payment can be seen that instead of retrying with next connector it gets retried with same connector but now enforcing three_ds
Checklist
cargo +nightly fmt --all
cargo clippy