#IGBenetts-pre-fill

1 messages · Page 1 of 1 (latest)

bold lagoon
#

Hello! How are you currently collecting this info? Checkout? Elements?

wicked plaza
#

Checkout

#

I call a PHP file that does the Stripe Checkout method

bold lagoon
wicked plaza
#

Really?!

#

Wow

bold lagoon
#

Yep yep

wicked plaza
#

But How do I collect his customer ID?

#

Can I retrieve it with the PaymentIntent?

bold lagoon
#

When the Checkout Session first completes?

#

That will be customer directly on the Checkout Session. I think the PI will have it too, let me check

#

Yes it will

wicked plaza
#

Okay. So can I retrieve it with the next code (?):

bold lagoon
#

If you are retrieving it like that, yes

wicked plaza
#

I was wrong, it was the CheckOutSession

#

My bad

#

Another question, Can I send the customer_id on the success_url? Or I can only send the CheckOutSession?

bold lagoon
#

Yes, you can set it on the success_url if you want. success_url will take whatever valid URL string you give it

wicked plaza
#

Ok, so in this succes_url. How do I add the customer_id at the end?

bold lagoon
#

If you already have a customer object yes

#

You can add the customer ID cus_123 yourself

#

Unfortunately this is not like the {CHECKOUT_SESSION_ID} parameter where Stripe fills it out automatically

wicked plaza
#

Oh okay

#

Again in this case. Where do I put the customer_id?

#

Next to 'mode' => 'payment',?

bold lagoon
#

Yes, the customer parameter is at the same level as the mode parameter

#

And to be clear, the first time you create the session, you will not have a customer object to put in that param. Once the session completes, you can store that customer ID and if you know that customer is back, that is when you can provide it.

wicked plaza
#

Okay! Thank you so much!

bold lagoon
#

Of course, happy to help