API Adjusting Transaction Amounts

An Adjust request allows for adjusting transaction amounts to any amount that is less than or equal to the original transaction amount and greater than zero. A transaction cannot be adjusted to more than 30% above its authorized amount.

Amounts may be adjusted for the following transaction conditions:

  • Approved Sale that is not yet settled
  • Forced Sale that is not yet settled
  • Authorization that is approved and not yet settled
  • Refund that is not yet settled

Please note that amounts for cash advance transaction may also not be adjusted.

Adjust Transaction Amount Request

Required Name Value Pairs

UN, PSWD, TERMS, METHOD, TRANXID, AMOUNT

Optional Name Value Pairs For Adjust Transaction Amount Request

The PayTrace API does not allow any optional name / value pairs for Adjust Transaction Amount request.

Sample Adjust Transaction Amount Request

‘format the request string to adjust a transaction amount
strRequest = "un~demo123|pswd~demo123|method~adjustamount|terms~Y|"
strRequest = strRequest & "TRANXID~1234|amount~0.75|”

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

Request Response

Returned Name Value Pairs

Responses elicited from an AdjustAmount request will always return either one or more error messages or a response. Successful responses will always include: RESPONSE

Example of Parsing an Adjust Amount Request 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

‘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)
        End If 
    next
Else
    StrError = StrError  & “The response from the PayTrace API was invalid."
End if

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