简体   繁体   English

如何从iOS中的Stripe获取客户ID-目标C

[英]How to get customer id from Stripe in iOS - Objective C

I have got STPToken, Card id from STPCard but I could not get the Customer id from STPCustomer in Stripe. 我已经从STPCard获得了STPToken,卡ID,但是我无法从Stripe的STPCustomer获得客户ID。 Can any one please tell me how to get the customer Id(For eg: cus_asjdfhask234234ajsdf). 谁能告诉我如何获取客户ID(例如:cus_asjdfhask234234ajsdf)。

Customer ID's are generated on the server side. 客户ID在服务器端生成。 The app should collect the users credit card info and get a STPToken and then send that token to the server and the server will create you a Customer ID and send it back to the app then you can use that customer for making purchases which also happen on server side. 该应用程序应收集用户的信用卡信息并获取STPToken,然后将该令牌发送到服务器,服务器将为您创建一个客户ID,然后将其发送回该应用程序,然后您可以使用该客户进行购买,该交易也会在服务器端。

https://stripe.com/docs/api#create_customer https://stripe.com/docs/api#create_customer

It is not possible to charge customers inside the app. 无法在应用内向客户收费。

https://support.stripe.com/questions/can-you-charge-a-card-through-a-mobile-application https://support.stripe.com/questions/can-you-charge-a-card-through-a-mobile-application

To generate customer id , we can also call stripe curl api at app side , as we call other rest apis. 为了生成客户ID,我们还可以在应用程序端调用stripe curl api,就像我们调用其他rest api一样。

You can refer Stripe's own document from below URL https://stripe.com/docs/api#create_customer Even one can do any stripe operation by Stripe's APIs. 您可以从以下URL(网址为https://stripe.com/docs/api#create_customer)引用Stripe自己的文档。即使Stripe的API可以执行任何Stripe操作。

You just need to pass customer id to your back end , as if you logout at app side & at login time you don't get old one customer id & you try to create new one by using same email then stripe will allow it & provide you new customer id. 您只需要将客户ID传递到后端,就好像您在应用程序侧和登录时注销时一样,您不会得到一个旧的客户ID,而您尝试使用同一封电子邮件创建新的客户ID,那么Stripe会允许它并提供您的新客户ID。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM