How to extend a PUSH (OCT) transaction for Query API - We are going to run the PUSH (OCT) and after we are going to retrieve the PUSH (OCT) transaction details using acquiringBin and transactionIdentifier
We are going to simulate a timeout for PUSH(OCT) transaction by passing header “x-transaction-timeout-ms","1" and use Query API to retrieve the transaction details. In this case, we do not have transactionIdentifier, so we can use retrievalReferenceNumber (RRN) and systemsTraceAuditNumber(STAN) to retrieve the PUSH(OCT) transaction which has timed out.
If the Query API was not able to retrieve a transaction for some reason, you would have to use retry the logic and send the PUSH (OCT) transaction again.
Let's get started.
1 - Modify Python Sample Code
We are going to slightly modify our Python Sample Code (found here) in order to capture transactionIdentifier which is going to be used in our Query API example. We are also going to capture the X-CORRELATION-ID as well.
2- Generate retrievalReferenceNumber (RRN) and systemTraceAuditNumber (STAN). For that, we have developed two functions, more details can be found here.
Now we are ready to run the Query API
Why do we need the Query API? It allows service providers to query history of transactions and return the entire transaction set related to the original Visa Direct transaction. A transaction set will include approved and settled original Visa Direct transactions, reversals, chargebacks, adjustments, and re-presentments.
Elapsed time in milliseconds (ms) in which an API will respond back. If no value is specified then it defaults to 30000 ms (i.e. 30 seconds), which is the maximum value allowed. If the set value is greater than the maximum value then timeout will not occur. The API will respond with HTTP 202 ACCEPTED if the processing has not yet completed. If the processing completes within the designated timeout period, then the API will return HTTP 200 OK and the XML- or JSON-formatted response, based on the Content-Type value.
The POST transaction timed out. If the API is not able to complete the transaction within 30 seconds (default) or within the timeout duration set in the HTTP header, it will respond with an 202 HTTP Status Code and a statusIdentifier value that can be used in the GET operation as the statusIdentifier in the URI.
The Sample Code is attached.
There you have it! Hope you find this guide helpful
Please make sure to save this and if you have any questions comment below, ask in our forums or email us at email@example.com - we're here to help.