#unclphil-checkout-customercreation

1 messages · Page 1 of 1 (latest)

meager bearBOT
dreamy fjord
#

I was able to create a payment mode session with customer creation set to each value. Are you getting an error when you try this?

#

If you are passing in a Customer ID you can just pass it to the customer parameter, you wouldn't pass in both a customer ID and customer_creation as the customer has already been created

crude forge
#

I had customer_creation="if_required" I thought was would give an option to pass in customer or leave it blank. It gives an error

#

You may only specify one of these parameters: customer, customer_creation.

dreamy fjord
#

Yep, customer_creation is a parameter that tells Stripe that you do not already have a Customer object for the person making this payment. So if you tell us that you don't have a customer for them but also pass an existing customer ID, we don't know what to do with that

crude forge
#

Even if customer id is blank?

#

I see. I guess I need logic to add or remove customer_creation depending on if I have customer.

dreamy fjord
#

Not immediately sure, if you try this with a blank customer ID in test mode that will show you whether we still error or not. But yes, typically it would be best to know which situaiton you are in and pass parameters accordingly

crude forge
#

Yeah, when I try with blank customer id in test mode I get this error in logs.
"You may only specify one of these parameters: customer, customer_creation."

dreamy fjord
#

Gotcha, thank you for testing

meager bearBOT