#karan_api
1 messages · Page 1 of 1 (latest)
👋 Welcome to your new thread!
⏲️ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).
⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can start a new thread if you have another question.
🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1254754677434748938
📝 Have more to share? Add details, code, screenshots, videos, etc. below.
It's true that pending updates (via payment_behaviour: 'pending_if_incomplete') don't support bank debits: https://docs.stripe.com/billing/subscriptions/pending-updates#:~:text=Pending updates aren’t,for the subscription.
If you've a customer where their default payment method is SEPA or similar, then you'd need to omit that parameter and handle the 'rollback' manually if the payment fails
How to handle rollbacks manually? You mean like human intervention and continuous monitoring for such usecases? Is there a better option?
No. If you want to revert the subscription back to it's previous state if the payment fails then you'll need to handle that yourself in the case of banking payments
So in that case, you recommend listening to invoice.payment_failed events in the webhook and use those for rollback?
Yes seems like a logical approach!
In these cases, we receive the customer.subscription.updated events with status: PAST_DUE or ACTIVE in the initial webhook event?
And if payment fails, is it automatically moved to CANCELED in Stripe?
In these cases, we receive the customer.subscription.updated events with status: PAST_DUE or ACTIVE in the initial webhook event?
You'll immediately receive acustomer.subscription.updatedevent yes, withstatus: 'past_due': https://docs.stripe.com/billing/subscriptions/overview#failed-payments
And if payment fails, is it automatically moved to CANCELED in Stripe?
Depends on your settings configured here: https://dashboard.stripe.com/settings/billing/automatic
This is how our billing settings look. So based on this it would cancel the subscription correct?
In that case, basically the customer tried to upgrade, we did upgrade them at the start while trying to collect the payment, then their payment failed and they now don't have their original subscription also (one before the upgrade)?
Correct ad we can't automatically retry SEPA payments it'd immediately be cancelled per your settings
Should be easy enough for you to test with a clock: https://docs.stripe.com/billing/testing/test-clocks
Okay got it. This is an issue with only SEPA payments or other payment method types also we should look out for? Like is there an explicit list of payment methods which don't work with pending updates, which we can add a case in the code to modify this behaviour?
Any 'bank debit': https://docs.stripe.com/payments/bank-debits
So basically we can check for these 5 payment methods in code and trigger different behaviour, correct?
Yep
Okay cool. Thanks!