#hajoshi
1 messages · Page 1 of 1 (latest)
Hii Jack Tan
as i already described i have some miss configuration with checkout session
Hi there, so what behaviour do you intent to implement?
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
You should just create a customer object upfront and pass this customer object in when creating a checkout session
So instead of passing customer_email, you should pass a customer
let me try
You may only specify one of these parameters: customer, customer_creation."
getting this error message
remove the customer_creation
No such customer: 'hardik@gmail.com
error message look in this kind of situation i wanna to create new customer instead of this error
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
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.
No, you need create a new customer first, you can also specify the email address when creating it.
are you able to share code
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
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.
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
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
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
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
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.
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
No you don't get it
you shouldn't create another customer when creating the second checkout session
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
but i don't want to create new one
i wanna with same
you shouldn't create another customer when creating the second checkout session -> I didn't ask you to create a new customer
then what on second time ?
it will automatically fetch customer details by used email ?
You need to specify it. Either you save the customer ID in your DB, or you can use the list API to retrieve it (https://stripe.com/docs/api/customers/list?lang=php#list_customers-email)
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
hmm it will make some hassle process let me check it with higher team