I am using stripe for checkout and i want to create an order in my data base when the chechout succeed. Do you know how can I run a callback function when the checkout succeed? All I know is that there is a successUrl for the checkout...
If you use Checkout Session to collect payment, customer will be redirected to the success_url
declared after completing the payment. In addition, Stripe will also send checkout.session.completed
event via Webhook. I'd recommend listening to checkout.session.completed
to create and fulfil customer's order: https://stripe.com/docs/payments/checkout/fulfill-orders