#connorRs

1 messages · Page 1 of 1 (latest)

proud krakenBOT
covert mirage
#

Checkout Sessions will always create a payment intent in payment mode

#

Can you tell me what you are trying to do here?

drifting shell
#

I need the payment intent to be created when the checkout session is created, not when it is confirmed. Basically when I send a request to create a checkout session, I need the response to include a payment intent ID. But currently that value is coming back null. I suspect it's related to the notice in the screenshot I attached.

#

Also I don't understand what "when the session is confirmed" actually means 🤔

covert mirage
#

Confirmation is when we submit the payment method details

#

So like when you put in your CC info and click "Pay" that is confirming the Session's PaymentIntent

#

It sounds like having the PI on creation may not be possible in this new API version. Can you tell me why you need it on creation? We might be able to put in a workaround or I could put in a feature request if this cannot be done without that

drifting shell
#

Is it possible to create a payment intent manually and "assign" it to the checkout session when it's created? I would like the payment intent ID prior to the end user actually confirming the session.

#

The use case here is to not need to rely on asynchronous events to capture that payment intent. This will help us avoid out-of-order processing for future events related to that PI

#

Let's say we're storing the PI status in our database. If we are able to store it before we actually send the user to a checkout session, we have a guarantee that it will exist in our system when an event like payment_intent.succeeded is emitted

#

I find it weird that I can send a payment_intent_data field with my request to create a checkout session, but I do not receive back any payment intent

covert mirage
#

Unfortunately not. In that case it would make more sense to listen to events like checkout.session.succeeded. Alternatively you can set the metadata that will appear on the payment intent through the Checkout Session's payment_intent_data.metadata hash and then you will know what will appear later

#

Right, that hash is for the intent that will be created. It does not mean that the intent will be created immediately

drifting shell
#

Alright thank you for your help