简体   繁体   中英

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. Can any one please tell me how to get the customer Id(For eg: cus_asjdfhask234234ajsdf).

Customer ID's are generated on the server side. 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.

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

To generate customer id , we can also call stripe curl api at app side , as we call other rest apis.

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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