#theahmadzai-connect-customers
1 messages · Page 1 of 1 (latest)
like 1 user can have multile customer ids depending on connected store?
Generally you'd have a 'main' customer on the platform, and then you'd clone them across your connected accounts when required
on my side do I have to store each customer id with corrosponding store right
currently we have this
where customer id is stored for each store
Does this also mean if customer attach his credit card to one store it will not be available in other one
yeh it's currently that way
Yep, you'd generally create the Payment Methods on the platform account (saved to the customer) and then clone it to connected accounts. See document on this above
Thanks I'll check it out my last question so do we need to store each customer id on my side right
Oh does this mean
I can create customer on platform
and store a single id of customer
but when charging I can use the store user id
Well you'd likely need the relevant customer ID for the connected account you're charging from, yes
If I store customer on the platform
so my user and customer will have 1 to 1 relation
when charging I just need the customer and the connected account id
So I don't need to maintain customer for each store in that case
I'm using paymentIntent for charge and storing cards via paymentMethods
What kind of Connect charges are you making?
Any migration guide to clone my connected accounts to platform
What do you mean?
I was creating a stripe customer for each store
Instead of a platform
I was directly using this to create customers
const customer = await stripe.customers.create({
source: token.id,
}, {
stripeAccount: '{{CONNECTED_STRIPE_ACCOUNT_ID}}',
});
with connected account id
now when they add pyament method to one store
it's not visible to other stores
I have around 4k users like that
Yup! You need to create the customer and save the PM on the platform
And then clone to connected accounts as needed
right but any migration guide now
to move customers from connected accounts to platform
You can't clone to the platform, no
Can I do it via some script
It's not possible no
right so now I'll do this just to verify in my case I just need this
to store customer on platform
and this to charge it
but I do not add source when creating customer
the paymentmethod is attached via paymentmethod api
so I also need to attach paymentmethod using platform secret and not use the connected id
right
I'd advise against using that endpoint
Using Setup Intents: https://stripe.com/docs/payments/save-and-reuse
Sorry yeah I use setup intents I only use detach list and retreive on paymentMethods
is that safe
Yup!
Thankyou so much, so I can conclude that I can store customers on the platform and they will be accissable across all connected accounts and I can charge them via pyamentIntent using store connected id
Thanks!
they will be accissable across all connected accounts and I can charge them via pyamentIntent using store connected id
No, you'll need to clone them to the connected accounts
How do we clone which api
it would be this one https://stripe.com/docs/payments/payment-methods/connect#cloning-payment-methods
Thanks but @exotic crane advised not to use paymentMethods.create
I advised not to use the attach endpoint
Ow, okay so I have to clone using create but does it clone both card and customer right or I have to clone customer separately?
it only clones the card
there's no way to clone the customer object directly, you have to create a new one and just set any fields on it that you'd like to copy across manually.
Thanks all clear now