#dettol_not_sponsored
1 messages · Page 1 of 1 (latest)
I'm trying to pass it through the success url in the "after payment" section if that helps
The best approach is listening to checkout.session.completed webhook event
Do webhooks work for the stripe checkout pages that run through stripe.com? Or is that only for completely integrated stripe code?
Yes, but you would need to setup webhook endpoint to listen to webhook events. The reason webhook is better, is ie. if your customer accidentally close the tabs, lost their internet connectivity, or simply in a train getting into a tunnel
Webhook is async and Stripe will send you events notice anything happens with any transaction to your server separately
Thanks so much, so in my php I could just do something like if(checkout.session.completed = true){ $sub = true}. Something like that?
And then process it with my other code
Yep basically it. You can store some information that you can retrieve from the checkout.session.completed event in its metadata
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Thank you! And lastly, will that keep track of subscriptions running out? For example if a user cancels
What step you described is basically covered here: https://stripe.com/docs/payments/checkout/fulfill-orders
When an user never complete payment, you won't get this checkout.session.completed event
So you can focus on fulfill on successful paid user