Timeout Reversals
If a payment attempt times out, for whatever reason, the response will not contain a payment ID and you will not know whether or not the payment was actually processed.
In this circumstance, you will want to perform a timeout reversal to ensure the payment gets reversed if it did in fact end up being processed.
To make use of this functionality, you need to send your own unique correlation ID with your payment request.
If the request does end up timing out, you can then use that correlation ID to void the transaction.
POST /payments
{
"amount": 1122,
"terminal": {
"gateway_id": "YOUR_GATEWAY_ID"
},
"payment_method": {
"credit_card": {
"cardholder": "Fred Flintstone",
"number": "4111111111111111",
"expiry_year": 2023,
"expiry_month": 12
}
},
"reference": {
"correlation_id": "ksdeiuhwer98347298374"
}
}
Note: the request will be rejected if the correlation ID you supply is not unique.
Assuming this request timed out, you could reverse it as follows...
POST /payments/open/void
{
"amount": 1122,
"terminal": {
"gateway_id": "YOUR_GATEWAY_ID"
},
"reference": {
"correlation_id": "ksdeiuhwer98347298374"
}
}
Note: in order for the reversal to be processed, you must supply the exact amount & correlation ID from the timed out request. Failure to supply the correct amount will result in a message saying no payment was found for the correlation ID.
If the original request was in fact processed, you will get a response which indicates that the reversal was successful.
If the original request was never processed, you will get a response which states that no payment was found for the supplied correlation ID.
Finally, if you attempt to reverse a payment which you have already reversed, the response will contain an "Invalid Payment ID" message.
Updated over 2 years ago