Void

This transaction removes a Sale, Standalone Refund or Force Sale transaction from the Open batch.

Funds will not be deposited to the merchant’s bank account if the transaction is voided before settlement.

note

You can only perform this transaction type on unsettled batches.

Code Samples

CWS

Request

PropertyDescription
method
string | required
startPaymentTransaction
requestId
string | required
Transaction Request ID
targetType
string | required
paymentGatewayConverge
parameters
JSONObject | required
All relevant parameters for Void transactions.
paymentGatewayId
string | required
Payment Gateway ID
Unique identifier of the payment gateway as returned in the openPaymentGateway transaction response.
transactionType
string | required
Transaction Type
Valid value: VOID
originalTransId
string | required
Transaction ID
Unique transaction identifier of the Sale, Stand Alone Refund or Force Sale transaction.
tenderType
string | required
Tender Type
Valid value: CARD

Example

Request
{
  "method" : "startPaymentTransaction",
  "requestId" : "130281068",
  "targetType" : "paymentGatewayConverge",
  "version" : "1.0",
  "parameters" : {
    "paymentGatewayId" : "d60f8f23-5403-405a-9ec0-8482ff8b3676",
    "transactionType" : "VOID",
    "originalTransId" : "070316A15-4D1CBECE-79C1-4BF1-87DB-EAC9E24BCD13",    /* Void this one */
    "tenderType" : "CARD",
  }
}
Response
{
  "requestId" : "130281070",
  "statusDetails" : "REQUEST_ACCEPTED",
  "data" : {
    "paymentGatewayCommand" : {
      "completed" : true,
      "eventQueue" : [ ],
      "chanId" : "592b6664-ac1a-4431-bb94-d092a3b3267c",
      "paymentTransactionData" : {
        "result" : "APPROVED",
        "authCode" : null,
        "date" : "Mon Mar 07 09:23:02 MST 2016",
        "cardEntryType" : "UNKNOWN",
        "resultMessage" : "APPROVED",
        "cardScheme" : "VISA",
        "amount" : {
          "currencyCode" : "USD",
          "value" : 8800
        },
        "id" : "070316A15-770CF503-2A1B-467F-BDF1-95E137FCA6F4",
        "transactionType" : "VOID",
        "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 money object by specifying a currency code and an amount.

    ECLMoney amount = new ECLMoney(ECLCurrencyCode.USD, 300L);
    
  3. Add the unique transaction identifier of the authorized Sale, Standalone Refund or Force Sale transaction and create a transaction reference.

    String originalTxnId = "abc123";
    ECLVoidTransactionInterface transaction = account.getTransactionProcessor().createVoidTransactionWithTotal(amount, originalTxnId);
    

Objective-C

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

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

    ECLMoney *amount = [[ECLMoney alloc] initWithMinorUnits:300 withCurrencyCode:ECLCurrencyCode_USD];
    
  3. Add the unique transaction identifier of the authorized Sale, Standalone Refund or Force Sale transaction and create a transaction protocol.

    NSString *originalTxnId = @"abc123";
    id<ECLVoidTransactionProtocol> voidTransaction = [[_account transactionProcessor] createVoidTransactionWithTotal:amount transactionID:originalTxnId];
    

C#

Request

PaymentArgs bea = new PaymentArgs();
bea.transactionType = TransactionType.VOID;
bea.originalTransId = origTrandId.
bea.paymentGatewayId = m_PaymentGatewayId;
bea.tenderType = dlg.getOrigTender();
bea.baseTransactionAmount = new Money(Money.CurrencyCodefromString(origCurrency), origAmount);

m_CWS.StartPaymentTransaction(bea, MyNotifyCWSEvent, MyPaymentComplete);