API Processing A Check Refund

Processing a refunded check through the PayTrace API may be accomplished by providing a new customer’s key entered checking account information, providing the customer ID of an existing customer, or providing the transaction ID of the original check that should be refunded. Please note that some check processors, such as GETI, do not support Refund requests.

Process Check Refund Request

Required Name Value Pairs

UN, PSWD, TERMS, METHOD, CHECKTYPE, AMOUNT, DDA, TR

Process Check Refund to Customer ID/Token Request

Required Name Value Pairs

UN, PSWD, TERMS, METHOD, CHECKTYPE, AMOUNT, CUSTID

Process Check Refund to Existing Check ID Request

Required Name Value Pairs

UN, PSWD, TERMS, METHOD, CHECKTYPE, CHECKID

Optional Name Value Pairs For Any Process Check Refund Request

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

Sample Process Check Refund Request

‘format the request string to process a refund for $1.00
strRequest = “UN~demo123|PSWD~demo123|TERMS~Y|METHOD~ProcessCheck|”
strRequest = strRequest & “CHECKTYPE~Refund|DDA~123456|TR~999999999|”
strRequest = strRequest & “AMOUNT~1.00|”

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

Request Response

Returned Name Value Pairs

Responses elicited from a ProcessCheck request and a CheckType of Refund will always return either one or more error messages or a set of responses. Successful responses will always include: RESPONSE, CHECKIDENTIFIER

Example of Parsing a Refund Check 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 strCheckID 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)) = " CHECKIDENTIFIER" Then
            strCheckID = arrPair(1)
        End If 
    next
Else
    StrError = StrError  & “The response from the PayTrace API was invalid."
End if

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