I initially purchased a subscription for $199 using a valid card. Subsequently, I changed my payment method to an expired card and upgraded the subscription quantity using the expired card, which I also set as the default. Strangely, although I received an error from Stripe indicating that the card is invalid or has insufficient funds, the quantity update is reflected on the Stripe server. Additionally, payments are marked as overdue in the Stripe dashboard.
Is there a Stripe feature or method to restrict changes to a user's account if a payment fails? I'm seeking advice on how to resolve this issue, especially when the server reflects the quantity update despite the payment error. Any insights or solutions would be greatly appreciated.
You can leverage pending updates to rollback updates if the associated payment fails.
Add the
payment_behavior: 'pending_if_complete'parameter to your API call to update the existing Subscription object(s).