#david-Elements
1 messages · Page 1 of 1 (latest)
Hi Jack. No, at the moment the only data being passed during the creation of the payment intent is the amount and currency
Ok, you can create and specify a customer so that Dashboard won't display the customer as guest customer
Okay Jack
Just to clarify, my process for creating the payment intent is in an API route (Next.js).
So would I just need to use the customers.create API (https://stripe.com/docs/api/customers/create?lang=node) (before creating the payment intent), then pass the returned id in the 'customer' field when creating the intent, all within the same Next API route?
Is there anything I need to do to handle potential duplicate customers?
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
You should pass an existing customer (if any), or create a new old if necessary.
How do I handle that situation? Do I need to query the API by email address or something to see if the customer already exists?
Hi! I'm taking over this thread.
Ideally you would keep track of customers on your end, for example by storing the Stripe customer ID in your own database.
We don't have the infrastructure set up for this as our setup is serverless and we don't have a database.
Is it a problem to create a duplicate customer?
Is it a problem to create a duplicate customer?
From Stripe point's of view: no. You can create as many customers as you want.
Another option is to use this endpoint to list all customers with a specific email address: https://stripe.com/docs/api/customers/list
Okay that's useful thanks. It seems that this should work for us.
I can see that there is also an 'update customer' part of the API too so we can update details (address etc.) if required.
Another semi-related question.
We also allow the customer to set up subscription payments on our form.
This process works as follows:
• Create payment method on the front end using card elements
• Pass payment method to Next API route, within which we:
• Create the customer (using the payment method id from the created payment method)
• Create the subscription, using the customer id
We're not using payment intent in there, but it seems to be working fine. Is this set up okay?
This works, this is basically the old way to implement Stripe.
The new way is to use PaymentIntent (or SetupIntent) + the Payment Element.
Is there a problem with using the old way?
Not really. You can see the main differences between the Card Element and the Payment Element here: https://stripe.com/docs/payments/payment-card-element-comparison
Thanks 🙂