API Authorizations

Processing an authorization through the PayTrace API will request authorization for specified amount. However, the approved funds will not be charged or funded until the transaction is captured and settled.

Authorization

Required Name Value Pairs

UN, PSWD, TERMS, METHOD, TRANXTYPE, AMOUNT, CC, EXPMNTH, EXPYR

Customer ID (Token) Authorization Processing

Required Name Value Pairs

UN, PSWD, TERMS, METHOD, TRANXTYPE, AMOUNT, CUSTID

Optional Name Value Pairs For Any Authorization Request

BNAME, BADDRESS, BADDRESS2, BCITY, BSTATE, BZIP, BCOUNTRY, SNAME, SADDRESS, SADDRESS2, SCITY, SCOUNTY, SSTATE, SZIP, SCOUNTRY, EMAIL, CSC, INVOICE, DESCRIPTION, TAX, CUSTREF, RETURNCLR, CUSTOMDBA, ENABLEPARTIALAUTH, DISCRETIONARY DATA

Referenced Authorization Transaction Processing

Required Name Value Pairs

UN, PSWD, TERMS, METHOD, TRANXTYPE, TRANXID

Optional Name Value Pairs For Any Referenced Authorization Transaction Request

BNAME, BADDRESS, BADDRESS2, BCITY, BSTATE, BZIP, BCOUNTRY, SNAME, SADDRESS, SADDRESS2, SCITY, SCOUNTY, SSTATE, SZIP, SCOUNTRY, EMAIL, CSC, INVOICE, DESCRIPTION, TAX, CUSTREF, AMOUNT, DISCRETIONARY DATA

Sample of a Authorization Request

‘format the request string to process an authorization for $1.00
strRequest = “UN~demo123|PSWD~demo123|TERMS~Y|METHOD~ProcessTranx|”
strRequest = strRequest & “TRANXTYPE~Authorization|CC~4012881888818888|EXPMNTH~12|”
strRequest = strRequest & “EXPYR~12|AMOUNT~1.00|CSC~999|BADDRESS~1234|BZIP~83852|”
strRequest = strRequest & “INVOICE~8888|”

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

Request Response

Returned Name Value Pairs

RESPONSE, TRANSACTIONID, APPCODE, APPMSG, AVSRESPONSE, CSCRESPONSE,

  • PARTIALAMOUNT, BALANCEAMOUNT are only returned if the ENABLEPARTIALAUTH parameter is set to Y and a transaction is partially approved or a balance response is provided by the issuer.

Example of Parsing an Authorization 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

‘declare the tools to store the values of the appropriate responses
Dim strError As String
Dim strResponseMessage As String
Dim strTransactionID As String
Dim strAppCode As String
Dim strAppMsg As String
Dim strAVSResponse As String
Dim strCSCResponse 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)) = "TRANSACTIONID" Then
            strTransactionID = arrPair(1)
        ElseIf UCase(arrPair(0)) = "APPCODE" Then
            strAppCode = arrPair(1)
ElseIf UCase(arrPair(0)) = "APPMSG" Then
            strAppMsg = arrPair(1)    
        ElseIf UCase(arrPair(0)) = "AVSRESPONSE" Then
            strAVSResponse = arrPair(1)    
        ElseIf UCase(arrPair(0)) = "CSCRESPONSE" Then
            strCSCResponse = arrPair(1)
        End If 
    next
Else 
    StrError = StrError  & “The response from the PayTrace API was invalid."
End if 

If StrError <> “” then
    MsgBox “Transaction was not successful per the following error: ” & StrError
Else
    If strAppCode <> “” then
        MsgBox “Transaction was APPROVED: ” & strResponseMessage    
    Else
        MsgBox “Transaction was NOT approved: ” & strResponseMessage
    End if
End if