Voiding Transactions
You can void transactions that have a status of authorized or submitted_for_settlement. All you need is the transaction ID. When the transaction is voided Braintree will do an authorization reversal if possible so that the customer won’t have a pending charge on their card.
result = Braintree::Transaction.void("the_transaction_id")
Checking the Result
If the transaction is successfully voided, result.success? will return true. Otherwise, check for validation errors.
if result.success?
# transaction successfully voided
else
p result.errors
end
Validations
- To void a transaction, the status must be authorized or submitted for settlement.