API Export Transaction Information

Transaction information may be exported through the PayTrace API at any time allowing transaction records to be viewed without being stored on the client computer.

Export Transactions Request

Required Name Value Pairs

UN, PSWD, TERMS, SDATE, EDATE, METHOD or UN, PSWD, TERMS, TRANXID, METHOD

Optional Name Value Pairs For Create Customer Request

TRANXTYPE, CUSTID, USER, RETURNBIN, SEARCHTEXT
(Please note the TRANXTYPE name may also include the values “SETTLED”, “PENDING”, and “DECLINED” in addition to the values in the Name / Value Pair Definitions Page)

Sample Export Transactions Request

‘format the request string to export all of the transactions for the demo account processed in the May of 2011 
strRequest = “UN~demo123|PSWD~demo123|TERMS~Y|METHOD~ExportTranx|”
strRequest = strRequest & “SDATE~05/01/2011|EDATE~05/31/2011|”

strResponse = SendPayTraceAPIRequest(strRequest) ‘defined in Referencing the API Page

Request Response

Returned Name Value Pairs

Through the PayTrace API, transaction information may always be exported for any transaction that has been processed through the PayTrace Payment Gateway. In order to minimize the number of transaction records may be searched by the following criterion: SDATE, EDATE, TRANXTYPE, CUSTID, USER

Responses elicited from an ExportTranx request will always return either one or more error messages or one or more transaction records

Example of Parsing a Export Transaction Response

‘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

Dim arrSUBResponse() as String
Dim arrSUBPair() as String
Dim SUBCounter as Integer

‘declare the tools to store the values of the appropriate responses
Dim strError As String
 ‘…declare all of the individual fields (i.e. BNAME, BADDRESS, etc) that you wish to catch.

‘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)) = "TRANSACTIONRECORD" Then
            arrSUBResponse = split(arrPair(1), “+”)
            for SUBCounter = 0 to uBound(arrSUBResponse)-1
                arrSUBPair = split(arrResponse(SUBCounter), “=”)
                If UCase(arrSUBPair (0)) = "BNAME" Then
                    Msgbox “Billing Name = “ & arrSUBPair (1)
                ElseIf UCase(arrSUBPair (0)) = "BADDRESS" Then
                    Msgbox “Billing Address = “ & arrSUBPair (1)
                End If 
            next
        End If 
    next
Else
    StrError = StrError  & “The response from the PayTrace API was invalid."
End if 

If StrError <> “” then
    MsgBox “Transaction export was not successful per the following error: ” & StrError
Else
    MsgBox “Transaction export was successful”
End if