#Atish
1 messages · Page 1 of 1 (latest)
Could you share what your objective is? If you would like to confirm whether the subscription is created and paid successfully for the first invoice, checkout.session.completed event should be sufficient
I have just two plans: FREE and PRO
For PRO plan user needs to subscribe to pro plan and we have two subscription model: monthly $10 or yearly $100
Once the checkout.session.completed is completed I can upgrade the user to pro plan
I need to know if the payment fails in the next invoice, in that case I need to downgrade the user to free plan again
In short, if the user is paying for monthly or yearly subscription he can get access to pro features else he will be using free features
I see! checkout.session.completed event is only for initial subscription invoice. It won't be sent for remaining future cycles. If you wish to check for the invoice payment failure for next billing cycle, you may listen to invoice.payment_failed event and apply your custom logic accordingly: https://stripe.com/docs/billing/subscriptions/webhooks#payment-failures
How can I test it right now? Is there any way to send invoice.payment_failed?
Hi @kind ether I'm taking over
Thank you!
You can use Stripe CLI to simulate a invoice.payment_failed event
stripe trigger invoice.payment_failed
Is it the way to trigger?
Got it, thank you
Also will you please list out the event I need to listen to for the below scenario. Payment is sensitive and I don't want to miss out anything
I have just two plans: FREE and PRO
For PRO plan user needs to subscribe to pro plan and we have two subscription model: monthly $10 or yearly $100
Once the checkout.session.completed is completed I can upgrade the user to pro plan
I need to know if the payment fails in the next invoice, in that case I need to downgrade the user to free plan again
In short, if the user is paying for monthly or yearly subscription he can get access to pro features else he will be using free features
https://stripe.com/docs/billing/subscriptions/webhooks I'd recommend you go through this doc. It provide comprehensive guidelines on using webhooks for subscription
Thank you! Also stripe will periodically send the event until 200 response is provided right? In case my service is down, we might miss some events and might encounter some bugs
https://stripe.com/docs/api/events/list?lang=java#list_events you can also use this API to retrieve the past events to reconcile
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Also how the subscription ends? Is it related to something like 6 months subscription on monthly basis or when payment fails and current subscription ends?
The subscription will continue unless you cancel it
Or you can use subscription schedule to automatic the process and make the subscription cancelled after 6 months
Will you please clarify about this event, is it sent when the customer cancels the subscription?
Yes, this event happens when the subscription is canceled.
checkout.session.completed
customer.subscription.deleted
invoice.payment_failed
I only found 3 events useful in my context.
You can listen to the events that you think that's helpful to your application.
I just cancelled my plan, but got only customer.subscription.updated, when customer.subscription.deleted will be triggered?
Subscription ID?
Even if I cancelled now, It will be cancelled on may 19
This is the id probably: sub_1MyTmjDfJAkpzIQT4zfzKQ5f
Share with me the subscription ID so that I can take a look
sub_1MyTmjDfJAkpzIQT4zfzKQ5f
You used customer portal to schedule the cancelation. If you want to cancel it immediately, use this API https://stripe.com/docs/api/subscriptions/cancel?lang=java#cancel_subscription
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Is there any way to test all these, by making subscription interval of 5 mins?
what do mean by a subscription interval of 5 mins?