This method may be used to permanently delete a recurring payment.
Delete a Recurring Transaction
Required Name Value Pairs
UN, PSWD, TERMS, METHOD, RECURID or UN, PSWD, TERMS, METHOD, CUSTID
Optional Name Value Pairs For Deleting a Recurring Transaction Request
The PayTrace API does not allow any optional name / value pairs for deleting a recurring transaction request.
Sample Delete a Recurring Transaction Request
‘format the request string to delete the recurring transaction for the demo account strRequest = "un~demo123|pswd~demo123|method~DeleteRecur|terms~Y|" strRequest = strRequest & "RecurID~1333|" strResponse = SendPayTraceAPIRequest(strRequest) ‘defined in Referencing the API Page
Returned Name Value Pairs
RESPONSE, RECURID Or RESPONSE, CUSTID, CUSTOMERID
Example of Parsing a Delete 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