Customer not found error (NodeJS)

瀏覽次數:27 次
跳到第一則未讀訊息

bensam...@gmail.com

未讀,
2018年1月12日 清晨7:47:152018/1/12
收件者:Stripe API Discussion
Hi there,


I'm attempting to get a "buyer" user to purchase items listed by the "seller" user.

My seller users have gone through the OAuth flow and is connected to the platform, it's Stripe Account ID is stored in my "Users" collection.

My buyer users have individually created a stripe customer and I have stored the customer ID locally in my "Users" collection.


The problem is: whenever I create a charge, passing in the customer parameter, I receive the error "No such customer"

However it's clear that if I call stripe.customers.recieve I can see my users customer data and I can also see it in the Stripe Dashboard.

Additionally, I have called stripe.tokens.create, then passing in token.id as the source when creating the charge as stated here.


I hope someone can tell me what is going on here.

Thanks

Remi J.

未讀,
2018年1月12日 上午8:06:092018/1/12
收件者:api-d...@lists.stripe.com
Hey,

The customer being charged has to live on the same account as the charge you're creating. In the scenario you describe, you seem to be creating a customer in the main platform account (your account) while you are creating a charge directly on the connected account [1]. Because of this, we look for a customer in that account and can not find it so we return this error.

There are 2 approaches here to fix this. First off, if you don't need to store all customers in your platform, you can create that customer directly on the connected account instead. This is done by passing the `Stripe-Account` header [2] to the API request the same way you do for the charge. The customer will live on that account and the charge will succeed.

Otherwise, if you want all customers in your platform, for example to let them buy things from different sellers, you need an extra step. You have to use a feature called Shared Customers [3] for this. The idea is that you can take a card in your platform account and create a new token for that card valid on the connected account. This then lets you either charge that token directly or save that card on a new customer in the connected account before charging it.

Hope this clarifies the issue!
Best,
Remi


--
You received this message because you are subscribed to the Google Groups "Stripe API Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to api-discuss+unsubscribe@lists.stripe.com.
To post to this group, send email to api-d...@lists.stripe.com.
Visit this group at https://groups.google.com/a/lists.stripe.com/group/api-discuss/.

回覆所有人
回覆作者
轉寄
0 則新訊息