Linked Refund
A Linked Refund is a refund of a previously approved and confirmed transaction. This can either be a full or partial refund of the previous transaction and cannot exceed the full amount of the original authorization.
In order to perform a linkedRefundTransaction
, you will need the User Reference of the previous transaction, which was supplied as the ParameterKeys.Reference
parameter during the startTransaction
method call. This User Reference should be passed in as ParameterKeys.SaleReference
during a linkedRefundTransaction
call so the refund can be linked to the previous transaction.
Implementation
try { ParameterSet parameterSet = new ParameterSet(); /* Amount to be refunded. Cannot be greater than previous Sale Amount */ parameterSet.add(ParameterKeys.Amount, refundAmount); /* User Reference for this Refund Transaction */ parameterSet.add(ParameterKeys.Reference, refundReference); /* User Reference of a previous Sale Transaction that needs to be refunded */ parameterSet.add(ParameterKeys.SaleReference, refundSaleReference); clientHelper.linkedRefundTransaction(parameterSet); } catch (ClientException e) { //Handle Exception }
Standalone Refund
A Standalone Refund is a refund that is not linked to a previous transaction and can be of any amount specified by the merchant. It also requires the customer to Insert, Swipe, or Tap their card in order to be processed.
Implementation
try { ParameterSet parameterSet = new ParameterSet(); /* Amount to be refunded/returned */ parameterSet.add(ParameterKeys.Amount, amount); /* User Reference for this refund transaction */ parameterSet.add(ParameterKeys.Reference, reference); /* TransactionType of "refund" needed to invoke Standalone Refund */ parameterSet.add(ParameterKeys.TransactionType, "refund"); clientHelper.startTransaction(parameterSet); } catch (ClientException e) { /* Handle Exception */ }