Transaction
Transaction: Void
See also the Transaction response object.
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.
- PHP
$result = $gateway->transaction()->void('the_transaction_id');
If the transaction is successfully voided, the result will return true. Otherwise, check for validation errors.
- PHP
if ($result->success) {
# Transaction successfully voided
} else {
print_r($result->errors);
}
Arguments
transactionId
required, stringThe unique transaction identifier. You can only void transactions that have a of:
- authorized
- submitted_for_settlement
- settlement_pending (only for certain PayPal transactions)