Smart Retries
Smart retry is a Hyperswitch feature to improve the payment success rates in a single or multi-processor setup. If the payment fails through the primary processor due to specific reasons, the payment will be retried with the same or an alternative payment processor to increase the chances of making the payment successful.
The Auto Retry engine handles varied Retry strategy based on the type of error encountered such as:
- Cascading Retry - Re-attempting an authorization request to an alternate processor with the same or enhanced payload
- Step-Up Retry - Re-attempting an authorization request to the same/different processors with additional authentication data (frictionless and challenge flows)
- Clear PAN Retry - Re-attempting a tokenised authorization request with a Clear PAN in case of de-tokenisation failures
- Global Network Retry - Re-attempting an authorization request with a signature network in case of debit network failure
Hyperswitch’s error handling engine is enriched with mappings for error codes and error messages across 100+ processors, acquirers, issuers. Processors have anywhere between 400 to 1,000 and at times more error codes. The database contains these combinations of error code and error messages for every processor and is constantly refreshed with newer codes that are encountered.
 (1) (1).png)
Error code segregation
- For each PSP all the published + encountered error codes are segregated in two categories “Retriable” and “Non-retriable”
- This is a dynamic list and continue to grow for each PSP as they change their error mapping or introduce new errors
- We’re also implementing a feedback loop from “Non-retriable” errors to “Retriable” errors basis retry exploration (bottom branch on the image above)
Each of the error codes are mapped individually as to whether they are eligible for the various retry capabilities.
Category |
Example codes from a PSP |
|---|---|
| Cascading retry | Refused, System malfunction, Processing temporarily unavailable |
| Step-up retry | 3D Secure required, Strong customer authentication required, Suspected Fraud |
| Clear PAN retry | Invalid cryptogram, Network token not supported, Payment token expired |
| Network retry | Transaction not permitted on this network, Invalid card for selected network, Function not supported |
Merchant config enablement
- Merchant needs to be enabled across the required flows
- Merchant can be eligible to all 4 or some of retry flows - Cascading Retry, Step-Up Retry, Clear PAN Retry, Global Network Retry
- Merchant needs to specify N = Number of retries permitted
Retry Decision Flow
- Payment fails → GSM lookup determines retry eligibility retry
- Check retry flags:
- step_up_possible → Attempt 3DS if no 3DS was used
- clear_pan_possible → Retry with PAN for network tokens
- alternate_network_possible → Try different debit network
- Execute retry via do_retry() function retry with SAME or ENHANCED payload
- Exhaustion handling → Stop when retries/connectors depleted retry
How it all comes together
Use Case 1
Attempt |
PSP |
Flow |
Outcome |
|---|---|---|---|
| 1 | PSP1 | Original payload (non-3ds) | Suspected fraud |
| 2 | PSP1 | Step up - Independent 3DS (frictionless flow) | Generic decline |
| 3 | PSP2 | Original payload + Authentication data | Succesful |
Use case 2
Attempt |
PSP |
Flow |
Outcome |
|---|---|---|---|
| 1 | PSP1 | Original payload (non-3ds) | Suspected fraud |
| 2 | PSP1 | Step up - Independent 3DS (challenge flow) | Generic decline |
| 3 | PSP2 | Original payload + Authentication data | Succesful |
Use case 3
Attempt |
PSP |
Flow |
Outcome |
|---|---|---|---|
| 1 | PSP1 | Original payload (non-3ds) | Generic decline |
| 2 | PSP2 | Original payload (non-3ds) | Succesful |
Use case 4
Attempt |
PSP |
Flow |
Outcome |
|---|---|---|---|
| 1 | PSP1 | Original payload (non-3ds) |
Generic decline |
| 2 | PSP2 | Additional payload (non-3ds) | Succesful |
Use case 5
Attempt |
PSP |
Flow |
Outcome |
|---|---|---|---|
| 1 | PSP1 | Original payload (Network token PAN) | Do not honor |
| 2 | PSP1 | Original payload (Clear PAN) | Generic decline |
| 3 | PSP2 | Original payload (Clear PAN) | Succesful |
User Consent-based Retries: These retries are applicable for payment flows that need an additional level of user authentication (example: Apple Pay, Google Pay, 3DS cards, bank transfers). Such payment flows need an additional authentication from the user. Hence smart retries are not possible for such scenarios.
How to enable Smart Retries?
Step 1: Ensure that you have enabled the pecking order of payment processors on the Hyperswitch dashboard. You can access the settings from Routing > Default fallback > Manage.
Step 2: Drop a request to hyperswitch@juspay.in with the below information.
- Confirmation on the retry flows to be enaled
- Maximum number of payment retry attempts