#Zarbi4734
1 messages · Page 1 of 1 (latest)
Hi there
okay so I don't have to force it by sending a req to stripe, I just need to cancel it on my side right ?
yes
Ah no you don't have to if you don't want to. Up to you how you want to handle it really
okay thanks !
Just one last question:
When the customer have an error when automatically paying (like invoice.payment_failed or even invoice.finalization_failed I know that I need to "pause" the subscription on my side but my question is: when the customer update his payment method and that the payment go throw, does the invoice.paid event is fired ?
Yep invoice.paid will always fire when a successful payment is made
Mostly you just want to focus on the status of the Subscription object
I'd recommend using the customer.subscription.updated event to track that status
humm yeah but it's not fired for new subscriptions
True, you would use customer.subscription.created for that
Okay, but what about the end date of the subscription ?
I track the end date by updating it with the current_period_end in the paid invoice
That exists on the Subscription object as well: https://stripe.com/docs/api/subscriptions/object#subscription_object-current_period_end
It is mostly up to you. Using invoice.paid is fine, it is just less all-encompassing in my opinion
okay So I can do everything with the invoice after all ?
tracking new subscriptions and updated ones (like when a cust changes his plan)
No you can't track updated Subs via invoice.paid 🙂
I meant you can track renewal
But that is why I recommend customer.subscription.updated
Because you can track everything with just that event (and customer.subscription.created)
But when a customer update his plan, it generate an invoice right ?
Not always. Depends on your integration and what update is occurring
okay, so if I resume, I can track new subscriptions with the invoice.paid and renewal, but if I want to track plan update/downgrade I should use the customer.subscription.updated
Yep that would work fine
okay thanks a lot !