Getting Started with Visa Developer
First time to the Visa Developer Center? Watch this tutorial to learn where to find the Visa APIs th...
Objective:
acquiringBin
systemsTraceAuditNumber
retrievalReferenceNumber
cardAcceptor.idCode
cardAcceptor.terminalId
Links for the previous webinars:
For the How to Run the Query API in Visa Direct Transactions webinar:
We have to capture correlation_id for logging purpose
# Capture X-CORRELATION-ID
print(response.headers.get("X-CORRELATION-ID"))
correlation_id = response.headers.get("X-CORRELATION-ID")
print("correlation_id", correlation_id)
We need to generate
retrievalReferenceNumber
systemsTraceAuditNumber
systemsTraceAuditNumber
Required
number , 6 characters
A unique value should be used for each API method. However, when passing the (AFTR) method, this value must match the systemsTraceAuditNumber previously passed with the AFT method for the current transaction.
retrievalReferenceNumber
Required
number , 12 characters
A value used to tie together service calls related to a single financial transaction. When passing Account Funding Transaction (AFT) and an Original Credit Transaction (OCT) methods, this value must differ between the two methods. When passing the Account Funding Transaction Reversal (AFTR) method, this value must match the retrievalReferenceNumber previously passed with the AFT method for this transaction.
Recommended Format : ydddhhnnnnnn
The first fours digits must be a valid yddd date in the Julian date format, where the first digit = 0-9 (last digit of current year) and the next three digits = 001-366 (number of the day in the year). hh can be the two digit hour in a 24 hour clock (00-23) during which the transaction is performed.
nnnnnn can be the systemsTraceAuditNumber or any 6 digit number.
Now to simulate a timeout for the OCT transaction. We have to add header
“x-transaction-timeout-ms","1" (it is case insensitive)
headers = { "content-type": "application/json",
"Accept": "application/json",
"X-Transaction-Timeout-MS" : "1"
}
Query API
https://developer.visa.com/capabilities/visa_direct/docs
Use case:
Now we would like to use Query API to retrieve results from the Push (OCT) transaction.
Why?
The Query API allows service providers to query in real-time the processing status of Visa Direct (Account Funding and Original Credit) transactions as well as other related transactions that are part of the Visa Direct suite of transactions (Reversals, Adjustments, Chargebacks and Re-presentments).
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.
stan and rrn parameters combination
url = 'https://sandbox.api.visa.com/visadirect/v1/transactionquery?acquiringBIN=' + str(acquiringBin) + '&stan=' + str(systemsTraceAuditNumber) + '&rrn=' + str(retrievalReferenceNumber)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
First time to the Visa Developer Center? Watch this tutorial to learn where to find the Visa APIs th...
Watch the recording of my How to Run a Visa Direct Transaction using Python webinar as you follow al...
Learn how to create a project and where to find test data, credentials and sample code. Leave a comm...
We feel that the Visa Developer Center has come full circle since launch in 2016. It hosts many APIs...