Linked Refund

This transaction issues a partial or full refund to the cardholder's credit card or debit card.

Use this transaction to refund a previously settled debit card or credit card transaction. To reverse authorized but unsettled transactions, use the Void transaction.

error_outline
note

Interac debit card transactions require certified terminals and the cardholder needs to swipe, insert or tap the debit card on the device.

Code Samples

CWS

Request

method
string | required
startPaymentTransaction
 
requestId
string | required
Transaction Request ID
 
targetType
string | required
paymentGatewayConverge
 
parameters
JSONObject | required
All relevant parameters for refunding transactions.
 
paymentGatewayId
string | required
Payment Gateway ID
Unique payment gateway identifier as returned in the openPaymentGateway transaction response.
transactionType
string | required
Transaction Type
Valid value: LINKED_REFUND
originalTransId
string | required
Transaction ID
Unique transaction identifier of the pre-authorized transaction.
baseTransactionAmount
JSONObject | required
Transaction Amount
Important: Must be less than or equal to the original transaction amount.
"baseTransactionAmount" : { "currencyCodeStr" : "USD", "amountInMinorUnits" : 1900 },
tenderType
string | required
Tender Type
Valid value: CARD

Response

requestId
string
Transaction Request ID
As specified in the request.
statusDetails
string
Request Status
 
data
JSONObject
Object holding various responses.
 
transId
string
Transaction ID
Unique identifier of the current refund transaction.

Example

Request
 {
  "method" : "linkedRefund",
  "requestId" : "2143090732",
  "targetType" : "paymentGatewayConverge",
  "version" : "1.0",
  "parameters" : {
    "baseTransactionAmount" : {
      "value" : 1000,
      "currencyCode" : "USD"
    },
    "paymentGatewayId" : " e9b2f3cd-ad49-482b-9982-d39d76a79a7f ",
    "originalTransId" : "251119AD4-FF6736F1-5030-42B1-BC74-0E020884191F9",
    "tenderType" : "CARD",
    "cardType" : "CREDIT"
  }
}
Response
  "requestId" : "2143090734",
  "statusDetails" : "REQUEST_ACCEPTED",
  "data" : {
    "paymentGatewayCommand" : {
      "completed" : true,
      "eventQueue" : [ ],
      "chanId" : "9689c81c-c976-48bf-83d2-60dca06b1b39",
      "paymentTransactionData" : {
        "result" : "APPROVED",
        "authCode" : null,
        "date" : "Mon Mar 07 12:48:24 MST 2016",
        "cardEntryType" : "UNKNOWN",
        "resultMessage" : "APPROVED",
        "cardScheme" : "VISA",
        "amount" : {
          "currencyCode" : "USD",
          "value" : 2500
        },
        "id" : "070316A15-EB815E1F-4D49-4E3E-953B-7DAEF0C43315",
        "transactionType" : "LINKED_REFUND",
        "approved" : "yes",
        "errors" : [ ],
        "maskedPan" : "******",
        "tenderType" : "CARD",
        "balanceDue" : {
          "currencyCode" : "UNKNOWN",
          "value" : 0
        }
      }
    }
  }
}

Java

  1. Initialize Commerce SDK and receive an ECLAccountInterface instance named account.

  2. Create a refund amount object by specifying a currency code and an amount.

    ECLMoney amount = new ECLMoney(ECLCurrencyCode.USD, 300L);
  3. Add the unique transaction identifier of the transaction to be refunded and create a transaction reference.

    String originalTxnId = "abc123";
    ECLTransactionInterface transaction = account.getTransactionProcessor().createLinkedRefundTransactionWithTotal(amount, originalTxnId);

Objective-C

Say you performed a credit card sale transaction with an id of "abc123" for $3.00. Now you want to refund $2.00 back to that credit card.

ECLMoney *amount = [[ECLMoney alloc] initWithMinorUnits:200 withCurrencyCode:ECLCurrencyCode_USD];
NSString *originalTxnId = @"abc123"
id<ECLTransactionProtocol> transaction = [[_account transactionProcessor] createLinkedRefundTransactionWithTotal:amount transactionID:originalTxnId];

C#

Money amount = new Money(Money.CurrencyCodefromString(origCurrency), finalAmount);

m_CWS.StartLinkedRefund(m_PaymentGatewayId, origTransId, origTender, origCardType, amount, note, MyNotifyCWSEvent, MyPaymentComplete);