Stripe文档说明以下代码可用于创建新客户。
stripe.customers.create({
description: 'Customer for test@example.com',
source: "tok_16cz9QDmMHdxsE7ezNjoLsUM" // obtained with Stripe.js
}, function(err, customer) {
// asynchronously called
});
但是Stripe.js没有说明如何为客户创建令牌。有没有人知道如何为新客户创建令牌?
答案 0 :(得分:2)
Yes, it does;文档明确指出,基于客户的令牌创建仅适用于Stripe Connect,并且只能与OAuth访问令牌或Stripe-Account标头一起使用。"在该上下文中,您可以传递customer
属性。在任何其他情况下,您只能基于卡片或银行帐户创建令牌。