#aeu1999-Custom flow
1 messages · Page 1 of 1 (latest)
ll ask a different question, using the prebuilt checkout, how can we save the details of our form on our database before the user is directed to the success page
by listening to the webhooks checkout.session.completed
if you're listening to that event the user will not be directly redirected to the success page until we receive a HTTP 200 response from your webhook
Hey, taking over here. Let me know if there's any follow-up Qs I can answer!
how can we use it on the PHP side?
And will it be compatible with our form
Can you show an example php script for the processes before the checkout and success page?
Thanks
Not sure I understand the Q. What are you trying to achieve?
After sending the form, before the user is directed to the success page we want to save the form details as order details on our database. After the order details are saved on our database we want to redirect the user to the success page.
You'd subscribe to the checkout.session.completed webhook event as my colleague stated. That will contain all the details pertinent to the Checkout payment and you can persist those details as you need
Checkout will wait up to 10 seconds for a 200 response from your webhook before redirecting to success_url
Are there any tutorials regarding this (using JS or PHP)