Processing a Cash Advance transaction is similar to processing a Sale, however Cash Advances are special transactions that result in cash disbursements to the card holder. Consequently, additional information is required to process Cash Advances. Cash Advances should always be swiped unless your card reader is not able to reader the card’s magnetic stripe. Additionally, your PayTrace account must be specially configured to process this type of transaction.
Please note that Cash Advances may also be processed as forced transactions by setting the TranxType to FORCE and including a valid APPROVAL value, all other fields remain the same. Forced Cash Advance transactions should be also be swiped unless your card reader is not able to read the card’s magnetic stripe.
Swiped Cash Advance Transaction
Required Name Value Pairs
UN, PSWD, TERMS, METHOD, TRANXTYPE, AMOUNT, SWIPE, CASHADVANCE, PHOTOID, IDEXP, LAST4, BNAME, BADDRESS, BADDRESS2, BCITY, BSTATE, BZIP
Key Entered Cash Advance Transaction
Required Name Value Pairs
UN, PSWD, TERMS, METHOD, TRANXTYPE, AMOUNT, CC, EXPMNTH, EXPYR, CASHADVANCE, PHOTOID, IDEXP, LAST4, BNAME, BADDRESS, BADDRESS2, BCITY, BSTATE, BZIP
Optional Name Value Pairs for any Cash Advance Request
BCOUNTRY, SNAME, SADDRESS, SADDRESS2, SCITY, SCOUNTY, SSTATE, SZIP, EMAIL, CSC, INVOICE, DESCRIPTION, TAX, CUSTREF
Example of a Cash Advance Transaction
strRequest =“UN~demo123|PSWD~demo123|TERMS~Y|METHOD~ProcessTranx|CASHADVANCE~Y|AMOUNT~1|”
strRequest = strRequest & “TRANXTYPE~Sale|bname~Test User|baddress~1234 Main|bcity~YourCity|”
strRequest = strRequest & “bstate~NY|bzip~10001|photoid~123456abcd|idexp~1/1/2020|last4~8888|”
strResponse = SendPayTraceAPIRequest(strRequest) ‘defined in Referencing the API Page
Request Response
Returned Name Value Pairs
RESPONSE, TRANSACTIONID, APPCODE, APPMSG, AVSRESPONSE, CSCRESPONSE,
Example of Parsing a Cash Advance 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