#unclphil.
1 messages · Page 1 of 1 (latest)
Hello
Yep generally you would use metadata here.
Though really I'm not sure what you mean by the Checkout Session ID not being reliable
I meant the the checkout session ID is not something I can pull then tie to a particular payment_intent
Why not?
You do have to wait until the Session is completed, as you stated, but at that point the PaymentIntent will be associated to the Session
You can then expand it to see full details: https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-payment_intent
For example the very first event when i create a checkout session is payment.intent.created but there is no checkout session id in that event.
At what point is the PaymentIntent associated to the Session?
Yeah you want to ignore payment_intent.created really. It doesn't matter.
The Webhook you want is checkout.session.completed
When you receive that Webhook then you retrieve the Checkout Session and expand the necessary properties
I see that makes sense. I'm not quite understanding when my first opportunity to capture the Checkout Session ID is going to be in that case. because I can see the checkout session id in logs first but not in event webhooks until the end (checkout.session.completed)
directly
Okay then you have the Checkout Session ID already from your creation request.
hmm, ok. I don't see it in events.. Must be doing something wrong
It would be returned from your API request
There is no Event triggered on a Checkout Session creation.
But when your code creates a Checkout Session then the response our API returns is the Checkout Session object.
That is how you redirect your customer to Checkout to begin with
I see. Thanks! I was looking for an event for checkout.session creation since I saw it in logs.