Requirements
Check the transaction status
We recommend that your integration automatically checks the status of a transaction any time it fails to receive a transaction response. Payment requests time out after a while. If you do not receive a payment response (or you receive a response indicating a time-out) after 120 seconds (local integration) or 150 seconds (cloud integration), and the internet connection hasn’t dropped, your integration should automatically check the transaction status. To get the status of a transaction:-
Make a Terminal API transaction status request, specifying:
-
The standard
SaleToPOIRequest.MessageHeaderobject, withMessageClassset to Service andMessageCategoryset to TransactionStatus.If you do not include theMessageReferenceobject, you receive a failure response withErrorConditionNotFound. Use theAdditionalResponseto find theSaleIDandServiceIDof the most recent transaction made by the terminal. |
ServiceID29235. TransactionStatusRequest -
The standard
-
In the TransactionStatusResponse.Response, check the
Result. This indicates whether the transaction has been processed:-
Success: The transaction has been processed. The original transaction response is also provided. -
Failure: The transaction has not been processed. The reason is indicated by theErrorCondition:InProgress: The transaction is still being processed.NotFound: We were not able to find the transaction.
-
Transaction processed
A TransactionStatusResponse.Response with aResult of Success indicates that the transaction reached an end state: approved, cancelled, or declined.
To determine the result of the transaction, use the original transaction response, provided in the RepeatedResponseMessageBody. For example:
- PaymentResponse.Response has
ResultSuccess: the payment succeeded. - PaymentResponse.Response has
ResultFailure andErrorConditionAborted: the payment was cancelled from the POS app. - PaymentResponse.Response has
ResultFailure andErrorConditionCancel: the payment was cancelled from the terminal.
Transaction in progress
A TransactionStatusResponse.Response with anErrorCondition of InProgress indicates the transaction is still being processed. This is usually due to the terminal waiting for input from the shopper. For example, the shopper is entering their PIN, adding a tip, or selecting currency conversion.
When you receive an InProgress response, you can submit repeated transaction status requests in a loop until you receive a response that indicates the transaction reached an end state. There is no need to apply a polling delay, because the terminal will handle that for you.
In the TransactionStatusResponse.Response, the AdditionalResponse field includes:
tenderReference: The transaction reference provided by the terminal. This is important for reporting purposes.detailedStatus: The tender state, for example, TENDER_CREATED. You can use this to inform the POS system. It is the same information that is provided in theeventfield in display notifications. This means you can use transaction status requests as an alternative to implementing display notifications.
tenderReference and detailedStatus are not included in the response.
The example response below indicates that this transaction is still in-progress.
TransactionStatusResponse for an in-progress transaction
Transaction not found
A TransactionStatusResponse.Response with anErrorCondition of NotFound indicates that we were not able to find the transaction with the SaleID and ServiceID you specified. The AdditionalResponse has Message not found and echoes the category of the transaction (such as Payment), the SaleID, and the ServiceID you specified in the request.
When the transaction is not found, this means that either:
- The
POIID,SaleIDorServiceIDyou specified in the transaction status request are incorrect. Check that you provided thePOIID,SaleID, andServiceIDfrom the original transaction in theTransactionStatusRequest.MessageReference. - We did not receive the original transaction request. The cause can be a dropped internet connection or an unexpected power loss. You can retry the original transaction.
