API Settling Transactions
Transactions processed through merchant accounts that are set up on the TSYS/Vital network or other terminal-based networks may initiate the settlement of batches through the PayTrace API.
Settling Transactions Request
Required Name Value Pairs
UN, PSWD, TERMS, METHOD
Optional Name Value Pairs For Settling Transactions Request
The PayTrace API does not allow optional name / value pairs for settling transaction requests.
Sample Settling Transactions Request
‘format the request string to settle transactions on the demo account
strRequest = "un~demo123|pswd~demo123|method~settletranx|terms~Y|"
strResponse = SendPayTraceAPIRequest(strRequest) ‘defined in Referencing the API Page
Request Response
Returned Name Value Pairs
RESPONSE, TRANXCOUNT, NETAMOUNT, BATCHNUM
Example of Parsing a Settle Transaction Response
‘--------------------------------...continued from Image 4.10...------------------------------
‘declare tools to loop through the response and store the current name / value pair
Dim arrResponse() as String
Dim arrPair() as String
Dim Counter as Integer
‘declare the tools to store the values of the appropriate responses
Dim strError As String
Dim strResponseMessage As String
Dim strTranxCount As String
Dim strNetAmount as String
Dim strBatchNum as String
‘check to make sure the response was not empty/invalid
if strResponse <> “” and inStr(strResponse,”|”) > 0 and inStr(strResponse,”~”) > 0 then
arrResponse = split(strResponse, “|”) ‘split the response into an array of name/value pairs
for Counter = 0 to uBound(arrResponse)-1
arrPair = split(arrResponse(Counter), “~”)
If UCase(arrPair(0)) = "ERROR" Then
StrError = strError & arrPair(1)
ElseIf UCase(arrPair(0)) = "RESPONSE" Then
strResponseMessage = arrPair(1)
ElseIf UCase(arrPair(0)) = " TRANXCOUNT" Then
strTranxCount = arrPair(1)
ElseIf UCase(arrPair(0)) = " NETAMOUNT" Then
strNetAmount = arrPair(1)
ElseIf UCase(arrPair(0)) = " BATCHNUM" Then
strBatchNum = arrPair(1)
End If
next
Else
StrError = StrError & “The response from the PayTrace API was invalid."
End if
If StrError <> “” then
MsgBox “Settlement was not successful per the following error: ” & StrError
Else
MsgBox “Settlement was successful: ” & strResponseMessage
End if
page revision: 3, last edited: 06 May 2014 23:56