#dettol_not_sponsored

1 messages · Page 1 of 1 (latest)

raven pilotBOT
turbid nova
#

I'm trying to pass it through the success url in the "after payment" section if that helps

dusk nova
#

The best approach is listening to checkout.session.completed webhook event

turbid nova
#

Do webhooks work for the stripe checkout pages that run through stripe.com? Or is that only for completely integrated stripe code?

dusk nova
#

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

turbid nova
#

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

dusk nova
#

Yep basically it. You can store some information that you can retrieve from the checkout.session.completed event in its metadata

turbid nova
#

Thank you! And lastly, will that keep track of subscriptions running out? For example if a user cancels

dusk nova
#

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