#tounka
1 messages · Page 1 of 1 (latest)
You can't completely rely on the checkout.session.completed event if you accept payment from payment method types that complete async (so it could be a couple of days until the payment is considered successful)
i don't plan on accepted deferred payment options like ACH etc
And if you're working with subscriptions (where you n eed to continually provision access) checkout.session.completed won't be helpful because it's only triggered for the first payment
got you. in the case of a subscription being generated for the first time, since i'm listening to both events i end up provisioning access twice
Can i just solely rely on invoice.paid event to provision access?
Yes, the invoice.paid event should be enough 👍
If you haven't seen these docs (https://stripe.com/docs/billing/subscriptions/webhooks) yet I'd highly recommend checking those out as well
is there any reason why the docs recommend using checkout.session.completed to initially provision access and then using invoice_paid to continuously provision access? especially since i get both events on the first payment
is one event guaranteed to happen before the other?
It really depends on what your integration looks like
For some users who are using checkout for more than just Subscriptions, it may make more sense to listen for checkout.session.completed to handle the one-off payments as well
hmm can you give me some examples?
as of now, i only use checkouts to provision subscriptions
If you're just using Checkout with Subscriptions then it doesn't really apply to you - but we also allow you to use Checkout with mode: payment . People who do that would want to listen for the checkout.session.completed event and see if it was for a one-off payment or a subscription
But again, if you're just looking for an event to provision subscription access the invoice.paid event is what you want
what is mode:payment for?
That's for one-off payments (not recurring)
ahh got you. okay thanks. so sounds like i should just listen for invoice.paid events and that'll allow me to provision access when the checkout session is completed and recurring payments
If i were to able offer one-off payments, would i still receive invoice.paid events?
If you were doing one-off payments with Checkout you'd only receive invoice.paid events if you went through some extra steps to enable it (see https://stripe.com/docs/payments/checkout/post-payment-invoices)
thank you