我将Apple Pay实施到我的应用程序中并且工作正常,但是当我使用apple pay时,交易没有链接到用户,当我在我的云代码上添加客户/用户参数时,我收到此错误。
error:
type: "invalid_request_error"
message: "Customer cus_xxx does not have a linked card with ID tok_xxxx."
param: "card"
code: "missing"
Parse.Cloud.define("chargeApplePay", function(request, response){
Stripe.Charges.create({
amount: 100 * 100,
currency: "usd",
customer: request.params.idcustomer,
token: request.params.tokenid
},{
success: function(httpResponse) {
response.success("success");
},
error: function(httpResponse) {
response.error(httpResponse)
}
});
});
答案 0 :(得分:0)
您可以在创建费用时完全省略此参数,而不是传入Comparator<Integer> reverse = Collections.reverseOrder();
SortedSet<Integer> set = new TreeSet<>(reverse);
//same thing here
参数作为您创建的令牌的ID,而只传入token
参数:
https://stripe.com/docs/api/node#create_charge-customer
这假定您已经创建了一个客户并在收取此费用之前将该令牌保存为该客户的付款来源: https://stripe.com/docs/charges#saving-credit-card-details-for-later
如果您确实想要为该客户收取特定卡(而不是记录中的默认卡),您可以将卡ID(card_ *)作为customer
传递:
https://stripe.com/docs/api/node#create_charge-source