gpt4 book ai didi

ios - 在 Swift 中创建 Stripe 客户

转载 作者:可可西里 更新时间:2023-11-01 02:16:11 24 4
gpt4 key购买 nike

我正在努力将 Stripe 集成到我的 Swift 应用程序中。在阅读文档时,Stripe 建议您在将用户注册到您的应用程序时创建一个新客户(我正在使用 Parse-Server)。并说您的用户此时不需要输入信用卡信息。

We strongly recommend you create this Customer at the same time you create your user on your own backend, so that every user is guaranteed to have an associated Customer (this is fine even if you don't collect your user's payment information when they sign up—it's totally OK to have a Customer without any attached cards).

我已经设置了一个快速服务器来处理请求并创建用户。然而,在 Stripes API 引用 (https://stripe.com/docs/api/node#create_customer) 中,它暗示您需要一个 token 来创建用户。

如果用户没有输入信用卡,我如何在他们的后端创建客户,因此不会生成 token ?

最佳答案

傻我。这很好用。您只需将电子邮件地址作为唯一参数发送。

  stripe.customers.create({ 
email: req.body.email },
function(err, customer) {
err; // null if no error occurred
customer; // the created customer object
}
);

关于ios - 在 Swift 中创建 Stripe 客户,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38422759/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com