You can delete a payment method using its token. All associated subscriptions will also be canceled immediately and the customer will forfeit any remaining days they've already paid for.

Ruby
Copy
Copied
result = gateway.payment_method.delete("the_token")

result.success?
# true
This code snippet now uses gateway instance methods instead of class-level methods. Learn more.

If the payment method can't be found, it will raise a Braintree::NotFoundError.

Arguments
token required, String

The alphanumeric value that references a specific payment method stored in your Vault.

Additional Parameters
:revoke_all_grants bool

When true, all grants of the payment method to other merchants will automatically be revoked. The default value is false.

Still have questions?

If you can’t find an answer, contact our Support team