Retries and 3rd-Party APIs
Handling timeouts and network protocol failures when connecting to a third party through TokenEx
Overview
Some of our products reach out to third party APIs such as gateways in Payment Services and endpoints specified in the Transparent Gateway API's tx-url
header or a Proxy profile. Sometimes connecting to these third parties presents temporary hiccups and the request needs to be retried to process successfully. TokenEx automatically attempts retries for common network protocol failures when connecting to third parties. To specify that a request should not be retried or that a request should be retried when a timeout occurs, utilize the tx-retry
header.
Managing Retries
The tx-retry
header can be used to specify a retry handling preference.
Tx-Retry Header value | Action |
---|---|
null or header omitted | Common network protocol failures are automatically retried by TokenEx. For example, an SSL connection failing to establish or other issues that occur prior to the transmission of any payload data to the third party. Timeouts are never automatically retried. |
false | Do not attempt a retry for any reason. |
true | Connection timeouts are retried. See warning below |
Values that can't be parsed to true or false | See null or header omitted . |
Retrying 3rd-Party API Timeouts
When sending data, use any available idempotency options provided by the third party to prevent that data from being re-processed and avoid issues like a payment being processed twice.
To increase the amount of time TokenEx waits for a response from a third party's API before timing out, use the
tx-http-timeout
header with the time to wait specified in seconds. For example,tx-http-timeout:70
to wait up to 70 seconds for a response before a timeout error is returned.
Supported Products
- Transparent Gateway API v2
- Tokenize
- Detokenize
- Proxy
- Payment Services v2
- All gateway integrations support retries except: Adyen Classic, Braintree, Cybersource, and Stripe.
Updated 11 months ago