To overcome [500]/[503] HTTP responses and safely retry requests without the possibility of double charges, we strongly recommend implementing the idempotency feature.
The PayU HUB has the idempotency feature, which allows a safe retry window. First, the merchant needs to include an idempotency header with each request. Its value needs to be unique. If one of the specific HTTP responses above were received for a transaction, the merchant could retry this transaction using the same idempotency header used in the original failed transaction. The PayU HUB then will first check if it has this request existing in the system. If not, it'll query PayU India (or any other idempotent safe payment provider) for the transaction details and status. If the provider has received it, the system will create a resource for it.
The idempotent safe window is 24 hours, meaning that the merchant has 24 hours to retry any transactions that have failed with 500 or 503 HTTPS responses. Otherwise, no action will be made, and these payments will not have authorization/charge/void/refund transaction resources.
It is essential to note that the merchant is responsible for handling these cases and retrying transactions with the same idempotency only when the situation requires it.
The idempotency feature should not be used to retry any other failed transactions, as it can cause transaction and processing issues.
Make sure to double-check the provider you are transacting with support the idempotency feature, before using this solution.