This method may be used to return the date, amount, and approval code of the most recent approved recurring payment processed on the customer profile provided.
Export a Recurring Transaction Request
Required Name Value Pairs
UN, PSWD, TERMS, METHOD, CUSTID
Optional Name Value Pairs For Export a Recurring Transaction Request
The PayTrace API does not allow any optional name / value pairs for exporting recurring transaction requests.
Sample Export a Recurring Transaction Request
‘format the request string to export a customer’s recurring payment strRequest = “un~demo123|pswd~demo123|method~ExportCustomerRecur|terms~Y|" strRequest = strRequest & "custid~testcustomer|" strResponse = SendPayTraceAPIRequest(strRequest) ‘defined in Referencing the API Page
Returned Name Value Pairs
RESPONSE, WHEN, AMOUNT, APPROVAL, NEXT, TOTALCOUNT, CURRENTCOUNT, DESCRIPTION, RECURID
Example of Parsing an Export Recurring Transaction Response
‘declare tools to loop through the response and store the current name / value pair Dim curChar as Integer Dim curPair as String ‘declare the tools to store the values of the appropriate responses Dim strError As String Dim strResponseMessage As String Dim strWhen As String Dim strAmount As String Dim strApproval As String ‘check to make sure the response was not null if strResponse <> “” and inStr(strResponse,”|”) = true and inStr(strResponse,”~”) = true then 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)) = " WHEN" Then strWhen = arrPair(1) ElseIf UCase(arrPair(0)) = " AMOUNT" Then strAmount = arrPair(1) ElseIf UCase(arrPair(0)) = " APPROVAL" Then strApproval = arrPair(1) End If next Else StrError = StrError & “The response from the PayTrace API was invalid." End if If StrError <> “” then MsgBox “Export recurring customer was not successful per the following error: ” & StrError Else MsgBox “Export recurring customer was successful: ” & strResponseMessage End if