#Last-subscription
1 messages · Page 1 of 1 (latest)
hi, it's just calling https://stripe.com/docs/api/subscriptions/cancel really, you could listen to webhooks for the failing payments and call it then. But usually this is accomplished by changing the settings on https://dashboard.stripe.com/settings/billing/automatic to disable retries and cancel immediately
I don't want to change the overall behaviour, I just want to allow the user to cancel the subscription if their card fails and they want to cancel it.
So what's the way to "end it now" when calling cancel subscription?
For that one specific subscription?
it's the same thing
cancelling the subscription is ending it , I'm not sure I follow you or what the distinction would be
Well this is what happened in my case:
- User was in trial period 20th May - 20th June 2022
- At the end of the trial period the card charge failed
- The subscription now says it's active until 20th June 2023 (yearly plan) but it's past_due
- Canceling that subscription cancels it but it's still active until 20th June 2023 and the card is retried
But if I cancel it immediately through a button in Stripe Dashboard it does what I expect - no more charge attempts
Canceling that subscription cancels it but it's still active until 20th June 2023 and the card is retried
that feels like you didn't cancel it with that API then
sounds more like you updated cancel_at_period_end:true for example. What's the sub_xxx subscription ID where this happened?
I think it was this one sub_JVvrCnITlV6fco
This was the cancellation attempt through the API evt_1LFYebEsLWYRGjLPNQTKQTRq
And this was my manual immediate cancellation through the dashboard evt_1LFYhzEsLWYRGjLPesdoNs1N
So how should I call the API to achieve the same thing?
yep so that's exactly what I said https://dashboard.stripe.com/logs/req_BRznu3b3NYNwXw
sounds more like you updated cancel_at_period_end:true for example
you use Lavarel so probably whatever function wrapper they have for cancelling the subscription uses cancel_at_period_end:true by default instead of actually cancelling it
you should check their docs for their library to see how you can make it cancel instantly(basically how you make it use that Stripe Subscription Cancel API)
https://laravel.com/docs/9.x/billing#cancelling-subscriptions cancelNow for example