#hajoshi

1 messages · Page 1 of 1 (latest)

quartz ermineBOT
timid aurora
#

Hii Jack Tan

#

as i already described i have some miss configuration with checkout session

buoyant tapir
#

Hi there, so what behaviour do you intent to implement?

timid aurora
#

see if the customer already exist with the same email which is used in checkout session for another time payment then it will not create new customer

#

see this it will creating new customers with same email

buoyant tapir
#

You should just create a customer object upfront and pass this customer object in when creating a checkout session

timid aurora
#

here is my code for this

#

are you there!

buoyant tapir
#

So instead of passing customer_email, you should pass a customer

timid aurora
#

let me try

#

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

#

getting this error message

buoyant tapir
#

remove the customer_creation

timid aurora
#

No such customer: 'hardik@gmail.com

#

error message look in this kind of situation i wanna to create new customer instead of this error

buoyant tapir
#

yes, you need to create a customer first.

You should just create a customer object upfront and pass this customer object in when creating a checkout session

timid aurora
#

with empty value right ?

#

error message : You passed an empty string for 'customer'. We assume empty values are an attempt to unset a parameter; however 'customer' cannot be unset. You should remove 'customer' from your request or supply a non-empty value.

buoyant tapir
#

No, you need create a new customer first, you can also specify the email address when creating it.

timid aurora
#

are you able to share code

timid aurora
#

where i have to implement it

buoyant tapir
#

This is the API that you should use to create a customer

#

Once you've created the customer, you can then pass the customer ID to the checkout session creation API.

timid aurora
#

ohkay got it

#

and what if the email is already used ?

#

at that time i think customer creation api will throw the error and am not able to pass the customer id

buoyant tapir
#

I don't think it would throw an error. Stripe allows you to create customers with the same email address.

Share with me request ID if there's an error. Here's how you can find it: https://support.stripe.com/questions/finding-the-id-for-an-api-request

timid aurora
#

look see the issue am having

#

i don't want same email used customers

#

the current code having same thing it will create new customers with already used email

#

I want to stope that thing

buoyant tapir
#

As I said earlier, you should create the customer upfront before creating a checkout session, so that you can avoid duplicate customer creation.

#

So basically
Step 1. Create a customer
Step 2. Create a checkout session with the customer

When you want to create a new checkout session with the same customer, just repeat Step 2.

timid aurora
#

brother see, i created customer with exampl@demo.com email okay and the payment was done. another time customer go throv for second payment and pass same email then it will also create new customer with same email

#

and I didn't want it

buoyant tapir
#

No you don't get it

#

you shouldn't create another customer when creating the second checkout session

timid aurora
#

i want simple flow like

demo@gmail.com is used first time then it will create new customer

if it will used second time then it will not update the customer or not create new obe

#

one

timid aurora
#

i wanna with same

buoyant tapir
#

you shouldn't create another customer when creating the second checkout session -> I didn't ask you to create a new customer

timid aurora
#

then what on second time ?

#

it will automatically fetch customer details by used email ?

buoyant tapir
timid aurora
#

hmm it will make some hassle process let me check it with higher team