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.

Python
result = gateway.payment_method.delete("the_token")

result.is_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 throw a NotFoundError exception.

Arguments
token required, str

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.