Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/111.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 我们如何获得斯威夫特条纹的客户ID_Ios_Swift_Stripe Payments - Fatal编程技术网

Ios 我们如何获得斯威夫特条纹的客户ID

Ios 我们如何获得斯威夫特条纹的客户ID,ios,swift,stripe-payments,Ios,Swift,Stripe Payments,我想在保存我获得STPToken的卡后获得条带的Customerid。我无法从Swift的STPToken创建Customerid。请帮忙。这是我的代码片段 let paymentConfig = STPPaymentConfiguration.init(); paymentConfig.requiredBillingAddressFields = STPBillingAddressFields.none; paymentConfig.publishableKey

我想在保存我获得STPToken的卡后获得条带的Customerid。我无法从Swift的STPToken创建Customerid。请帮忙。这是我的代码片段

let paymentConfig = STPPaymentConfiguration.init();
        paymentConfig.requiredBillingAddressFields = STPBillingAddressFields.none;
        paymentConfig.publishableKey = "pk_test_whRD827lMXvFb1MtY9T7bRzW"
        let theme = STPTheme.default();
        let addCardViewController = STPAddCardViewController.init(configuration: paymentConfig, theme: theme);
        addCardViewController.delegate = self;
        let navigationController = UINavigationController(rootViewController: addCardViewController);
        self.present(navigationController, animated: true, completion: nil);


   func addCardViewController(_ addCardViewController: STPAddCardViewController, didCreateToken token: STPToken, completion: @escaping STPErrorBlock) {
        print(token)
        dismiss(animated: true)


    }

您无法从客户端获取客户id。它应该在您的服务器上生成。以下是服务器生成客户的参考

您应该有一个API来在服务器上发送
stptoken
,然后服务器应该创建一个
customer
,并在响应中返回
customerId