#theryanmark
1 messages · Page 1 of 1 (latest)
You should do this fulfillment when you get confirmation of payment success via the Checkout webhook:
https://stripe.com/docs/payments/checkout/fulfill-orders#create-event-handler
If you want to show something synchronously on your return page, you can get the Session ID in the URL and retrieve the status via your server:
https://stripe.com/docs/payments/checkout/custom-success-page#modify-success-url
I was looking at that.
So here is what I am thinking let me know if its no good:
collect user credentials => store in DB table temporarily => Send Stripe Checkout URL to client => User Checks out => once checkout.session.completed hits webhook move user credentials to active status in DB => send email to User that account is active
Yep that sounds reasonable
And if you had a landing / thank you page after Checkout, the other option I mentioned would let you go retrieve that Session by ID to get details about whether it was successful etc
Got it. is there a web hook event list somewhere? or is there an checkout.session.declined and checkout.session.canceled event?
nvm i just found it.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
☝️ incase someone else reads this
So I was thinking there should be a hook for payment failure and cancel just to clear out the database of failed and canceled attempts
checkout.session.expired probably the best for both?
Yea depends on exactly the case you're trying to cover (eg, not finishing Checkout vs an async payment failure after they finish checkout)