Reverse Method
Reverses a previously authorized transaction.
Syntax
ptechreversal.reverse([callback])
Callback
The 'callback' parameter specifies a function which will be called when the operation completes (or an error is encountered). If the 'callback' parameter is not specified, then the method will block and will not return until the operation completes (or an error is encountered).
The callback for this method is defined as:
function(err){ }
'err' is the error that occurred. If there was no error, then 'err' is 'null'.
'err' has 2 properties which hold detailed information:
err.code err.message
Remarks
A Reversal transaction is used to reverse (void) a previously authorized transaction. This transaction is NOT added to the current batch, and the original transaction must be removed from the batch upon receiving a successful response to a Reversal. This method (and this class) is applicable to authorizations sent in both Terminal Capture Mode as well as Host Capture Mode.
A reversal transaction immediately releases funds blocked in the cardholder's open-to-buy by the original authorization. To reverse an authorization, set the CardNumber, CardExpMonth, CardExpYear, IndustryType, and POSRetrievalNumber which were sent in the original transaction. Also indicate the type of the original authorization (Auth-only or Sale) in the OriginalTransactionType property. The OriginalTransactionAmount should be set to the amount originally sent in the TransactionAmount property of the class that authorized the transaction. It does not matter if the amount actually authorized was less, the originally submitted amount must be sent in the OriginalTransactionAmount property.
For example:
class.IndustryType = itRetail class.CardNumber = "4444333322221111" class.CardExpMonth = 1 class.CardExpYear = 2010 class.OriginalTransactionType = ttAuthOnly class.OriginalTransactionAmount = "1.00" class.POSRetrievalNumber = "1234567890" class.Reverse()