Transaction

Transaction: Void

You can void transactions that have a status of authorized, submitted for settlement, or - for PayPal - settlement pending. The only required information is the transaction ID. When the transaction is voided, we will perform an authorization reversal, if possible, to remove the pending charge from the customer's card.

Refer to the Transaction response object for more information.

  1. Java
Result<Transaction> result = gateway.transaction().voidTransaction("the_transaction_id");

The result will return true if the transaction is successfully voided. Otherwise, check for validation errors.

  1. Java
if (result.isSuccess()) {
  // transaction successfully voided
} else {
  for (ValidationError error : result.getErrors().getAllDeepValidationErrors()) {
    System.out.println(error.getMessage());
  }
}
Arguments
transactionIdrequired, string

The unique transaction identifier. You can only void transactions that have a of: