#Bernard Paulet
1 messages · Page 1 of 1 (latest)
we don't support Flutter here unfortunately, it's a third-party developed library.
I receive the following error : error: No such customer: 'cus_NRNnvtzUxZp9Lp'
that means that you're passing a customer who exists on your plaform account, which won't work. If you're using Direct Charges, you need to create all the related objects on the connected account. So wherever you havestripe.customers.create(..)on the backend, you also need to pass{stripeAccount:....}on that call as well so the object is created on the right account.
Thanks !
I will try
So, on the server, when I call
const customerList = await stripe.customers.list({
email: req.body.email,
limit: 1,
});
I have to add the account there?
yes, if you want to list the Customers that exist on the connected account
I think the syntax is
await stripe.customers.list({
email: req.body.email,
limit: 1,
}, {stripeAccount:'acct_xxxx'}
);
OK, thanks!
Just to make it clear to me (i am not a pro developer)... my key to retrieve a customer is the email. It won't cause any problem if the customer is customer of several accounts?
email addresses do not have to be unique across customers , or customers on multiple Stripe accounts, no
you can have 100 customers with email:john@gmail.com on one account and 26 customers with email:john@gmail.com on another account
Ok, I try it
So, you're telling me that to be sure to retrieve the correct customer I should work with the customer id (even if te email address is normally unique)?
usually you store the cus_xxx Id in your database yes
Thanks,
It doesn't seem to work (same error). Tu go back to
await stripe.customers.list({ email: req.body.email, limit: 1, }, {stripeAccount:'acct_xxxx'} );
does it mean that I make a search on the email AND the account (true if email and account are met)?
it means search on account acct_xxxx, look for customers with email address in the variable req.body.email, and return an array with the most recently created customer matching
Sorry if I look stupid but does it mean that it will first look in the account acct_xxx object and then look in this account object wether it retrieves a metadata with email req.body.email ?
acct_xxx is the ID of another Stripe merchant account(the connected account)
so it's the same as what happens when you ran that code on your own account; just that it's running on the data that exists in that account instead.
OK, thanks...