Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/221.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 条带支付:客户客户没有带身份证的链接卡_*****_Android_Stripe Payments - Fatal编程技术网

Android 条带支付:客户客户没有带身份证的链接卡_*****

Android 条带支付:客户客户没有带身份证的链接卡_*****,android,stripe-payments,Android,Stripe Payments,我在Android上使用Stripe,我找不到我做错了什么,所以出现了这个错误: 客户cus_xxx没有ID卡为_yyy的链接源 com.stripe.exception.InvalidRequestException:客户cus_xxx没有ID卡_yyy的链接源 我已经看到,这涉及一个类似的问题,但我的是不同的 以下是我的工作流程: 1.在我的应用程序上,我用此代码创建了一张卡 Stripe stripe = new Stripe(context, PUBLISHABLE_KEY); // S

我在Android上使用Stripe,我找不到我做错了什么,所以出现了这个错误:

客户cus_xxx没有ID卡为_yyy的链接源 com.stripe.exception.InvalidRequestException:客户cus_xxx没有ID卡_yyy的链接源

我已经看到,这涉及一个类似的问题,但我的是不同的

以下是我的工作流程:

1.在我的应用程序上,我用此代码创建了一张卡

Stripe stripe = new Stripe(context, PUBLISHABLE_KEY);
// Stripe API call to get paymentSourceId
stripe.createToken(card, new TokenCallback(){...});
此方法是一个HTTP API请求,我从对此Web服务的响应中获取paymentSourceId=card\u yyy

2.我通过对后端的HTTP API请求获取临时密钥,我从临时密钥中提取paymentSourceCustomerId=cus_xxx

3.最后,我尝试使用此参数创建电荷

{
    "amount":2999,
    "currency":"USD",
    "paymentSourceCustomerId":"cus_xxx",
    "paymentSourceId":"card_yyy"
}
然后我得到了错误。

如果您用paymentSourceCustomerId传递paymentSourceId,则需要将该卡与该CustomerId链接

您有两个选项可以将卡与客户链接:

在创建客户时 将卡链接到已创建的客户 有关详细信息:

事实上,我的问题是我的卡没有与我的客户链接。很多
curl https://api.stripe.com/v1/customers \
   -u sk_test_BQokikJOvBiI2HlWgH4olfQ2: \
   -d description="Customer for emily.harris@example.com" \
   -d source=token
curl https://api.stripe.com/v1/customers/cus_D1p9ZtnrPS4XAR/sources \ 
-u sk_test_BQokikJOvBiI2HlWgH4olfQ2: \   
-d source=token