Removing a payment method (API) should only be done when absolutely certain that the payment method is obsolete. Removed payment method details cannot be recovered because of PCI Compliance requirements but payment method events are kept for audit trail purposes. A payment method with an active subscriptions cannot be removed. However, you can delete a payment method even if it is the only payment method assigned to a customer as long as there are no active subscriptions linked.
For example, if removing a single payment method that is not linked to any other active subscriptions, the payment method and the payment method token are both deleted. In the example shown above, Joe decides to stop his subscription. His payment method is removed from Ezypay and the linked token is permanently deleted from the Ezypay Vault.
However, if any additional payment methods are still linked to the token, the payment method is removed only from the customer but not from the Ezypay Vault. Only when all payment methods linked to the same payment method token are removed will the token be deleted from the Vault. In the example shown above, a parent and child have signed up at same gym but with different packages. The parent pays for both their child and themselves with the same credit card. Thus, two customers with different subscriptions but linked to the same payment method token are created. If the parent decides to stop their gym subscription, the parent's payment method is removed from Ezypay and their subscription stops. However, because their child still has an active subscription, the token in the Ezypay Vault is not deleted.
Only when all the payment methods have no active subscriptions will the token also be deleted. In the example above, only when Joe and his child's subscriptions are both cancelled and both payment methods removed, will the token be permanently deleted from the Vault.
If simply updating an invalid or incorrect payment method, consider replacing a payment method. With Replace, all existing customer, subscription and invoice connections to the payment method are preserved.
Updated over 3 years ago
Scenario 2: Create Invoices or Plans