#chirp
1 messages · Page 1 of 1 (latest)
Hi there! my teammate had to step away. How can I help?
Hi.
Im trying to find a one stop shop on subscriptions with checkout and im seeing a lot of different topics but its never clear how they relate to checkout. Like I can see docs and videos on subscriptions but they are all seemingly talking about it from the pov of a fully integrated payment system .
I guess my topline questions are
-
how do I handle subscription payments. (I have a webhook that listens for
checkout.session.completedbut what else should I listen for. -
how do I know when a user cancels their subscription. How do I enable them to cancel their subscription with a checkout link.
-
how do I know if a monthly renewal payment worked? Or failed?
-
How do I test all of these?
- We recommend listening to three event types if you're using Checkout, though there are a few other subscription-related webhooks you can listen to:
checkout.session.completed,invoice.paid, andinvoice.payment_failed- https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=checkout#provision-and-monitor
Other subscription events: https://stripe.com/docs/billing/subscriptions/webhooks#events
- If you're looking for a low-code way for customers to manage their subscriptions, I recommend looking into the customer portal: https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=checkout#configure-portal
Changes to a customer's subscription will trigger customer.subscription.updated. event customer.subscription.deleted will be triggered when a subscription ends
- I recommend listening for
invoice.paidandinvoice.payment_failed
- If you haven't already, I recommend playing around with test clocks: https://stripe.com/docs/billing/testing/test-clocks
You can create billing simulations, advance a test clock to test successful and failed payments, etc. We also have a testing guide for subscriptions as well: https://stripe.com/docs/billing/testing
thanks
btw - im not getting discord dings....
Oh - I think I might have suppressed notifications to just @. I've changed that. we'll see.
Ah, I see!
so ... session.complete is the first signup event? Is it fair to say that I would expect "invoice.paid" to what happens with the monthly subscriptions?
Or is it possible that I will get a session.complete that isnt paid and instead I have to wait for the invoice.paid.
session.complete means they've completed the Checkout session. you should also see a customer.subscription.created event (a brand-new subscription should be created when the Checkout session is completed)
yes, if a monthly renewal is successfully paid for, you should see invoice.paid
can I just listen for checkout.session.completed and not worry about customer.subscription.created?
Also how would I test all of this? Especially the renewal cycle with success and failure patterns.
Yep, you could. The checkout.session.completed event will return a Checkout session object. If that's all the information you need for your fulfillment process, then you're good! customer.subscription.created is the Subscription object, so that will include all details about the subscription itself (not just the subscription ID)
I recommend starting with test clocks: https://stripe.com/docs/billing/testing#test-clocks
You can also use the test card numbers here to simulate failed payments: https://stripe.com/docs/testing