Table of Contents
Overview
The Payment Device SDK for Windows and Linux offers two different methods of refunding. This article will discuss how the two refunds, Linked and Standalone, differ from each other. There will also be examples of how to perform each type of refund using the Payment SDK for Windows and Linux.
Linked Refund
A linked refund is a refund that is associated with and linked to an original transaction. This type of refund is typically processed by referencing the original transaction and using the same payment information from the original transaction to issue the refund. The main benefit of a linked refund is that it is faster and easier to process compared to a standalone refund since the payment information is already on file and does not need to be re-entered.
In order to perform a linkedRefundTransaction
, you will need the User Reference of the original 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, this will link the refund back to the original 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, on the other hand, is a refund that is processed independently of any previous transaction. This type of refund may also be referred to as a "blind" credit. This is because the refund is not linked to a previous transaction.
The main benefit of a standalone refund is that it allows for more flexibility, as it can be issued for any amount, regardless of the original transaction amount, and to a payment method of choice. Standalone refunds are typically not recommended and are not enabled by default for merchant accounts due to inherent risks.
Whilst a linked refund can be performed without the customer present, standalone refunds are a card-present process, requiring the cardholder to Insert, Swipe, or Tap their card in order to be processed.
Below is the function used to start a standalone refund, along with the parameter keys required to process this type of transaction.
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 */ }