#marvi
1 messages · Page 1 of 1 (latest)
So for (1): I would recommend listening for payment_intent.succeeded in order to update DB entries related to the Payment Intent: https://stripe.com/docs/api/events/types#event_types-payment_intent.succeeded
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
For (2), I'm not sure I follow. The customer will always be returned to the success_url specified on the Checkout Session if payment is successful, so that has nothing to do with webhooks
It appears that I didn't explain it very well for (1) so let me try again.
- I "transport data" betwen /create-checkout-session and /webhook by storing them in a table
- I listen for "chekout.session.completed" to get the payment_intent and store it where the checkout session ID matches
- I listen for "payment_intent.succeded" to store the entries in my main table where payment_intent matches
- I delete the data in the table that I used to transport
sometimes checkout.session.completed comes after payment_intent.succeded and my method fails to store the data
Thanks for (2)
Hi there. Taking over for two-shoes as they have to step out
Give me a bit to catch up on context
Yeah so our events aren't guaranteed to come in any sort of order: https://stripe.com/docs/webhooks/best-practices#event-ordering. So, you'll have to rethink your approach to this a bit where you don't rely on an order for the events
Is there anything that references checkour session object and event
payment succeded
Like how can i know which checkout session corresponds to which event
checkout session completed event already indicates a successful payment
and correlates the session to the payment
So basically I can in use it instead of payment_intent.succeded?
Yeah
Thanks very much!