API Update Recurring Transaction

Update a Recurring Payment Request

Required Name Value Pairs

UN, PSWD, TERMS, METHOD, RECURID, (RECURTYPE if updating an ACH/Check recurring payment)

Optional Name Value Pairs For Updating a Recurring Payment Request

CUSTID, FREQUENCY, NEXT, TOTALCOUNT, AMOUNT, TRANXTYPE, DESCRIPTION, CUSTRECEIPT, RECURTYPE

Sample Update a Recurring Payment Request

‘format the request string to update the recurring transaction for the demo account
strRequest = "un~demo123|pswd~demo123|method~updaterecur|terms~Y|"
strRequest = strRequest & "next~3/27/2012|amount~1.00|"
strRequest = strRequest & "recurid~8|totalcount~03|frequency~1|"
strRequest = strRequest & "custid~testcustomer|tranxtype~Sale|custreceipt~N|"

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

Request Response

Returned Name Value Pairs

RESPONSE, RECURID

Example of Parsing an Update Recurring Payment 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 strRecurID 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)) = "RECURID" Then
            strRecurID = arrPair(1)
        End If 
    next
Else 
    StrError = StrError  & “The response from the PayTrace API was invalid."
End if 

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