#Nick137645

1 messages · Page 1 of 1 (latest)

swift yachtBOT
frosty night
#

Hi there

#

You said: ```$customer = \Stripe\Customer::create([
"email" => $user["email"],
"name" => $user["name"]
]);
$customer_id = $customer->id;

$paymentIntent = \Stripe\PaymentIntent::create([
"customer" => $customer_id,
'amount' => 2999,
'currency' => 'usd',
// .....
]);```

plucky turtle
#

If you do not store customers in your DB (eg MySQL, PG or Mongo

frosty night
#

We don't de-duplicate customers

plucky turtle
#

you can basically do a Search

frosty night
#

You would need to handle that on your end when you create a new Customer

#

Yep thanks for jumping in @plucky turtle.

#

You either want to build an authentication process, or you want to run a Search by email

plucky turtle
#

$stripe->customers->search([
'query' => 'email:'customer@domain.com'
]);

summer osprey
#

Yes, I store the clients in a database locally.

It's more the creation of duplicate clients in Stripe that causes problems

frosty night
#

Yep we don't de-duplicate or prevent duplicates.

#

This is up to you to handle

plucky turtle
#

I've been building with Stripe since it's /dev/payments and I've always stored customers id on my backend 🙂
You should just run a check, and it'll be good

summer osprey
#

Clément and Bismarck: Thanks