小编Cha*_*ack的帖子

如何呈现条纹客户的卡片列表?

我只是想在iOS应用中显示用户的默认Stripe付款方式.

我正试图推动STPPaymentMethodsViewController一个viewController.Stripe明确声明我必须创建一个STPCustomerContext.我还必须创建一个STPPaymentContext吗?我不想创建一个STPPaymentContext因为它需要4个方法,我不会在我的应用程序的这一部分使用...这是我拥有的,但没有骰子.

另外,Stripe的文档指示您创建一个customerContext,但是没有说明如何将其传递给STPPaymentMethodsViewController.我错过了什么?

https://stripe.com/docs/mobile/ios/custom

//AppDelegate.swift
var customerContext: STPCustomerContext?

func setupStripe() {
    self.customerContext = STPCustomerContext(keyProvider: MyAPIClient.sharedClient)
}
Run Code Online (Sandbox Code Playgroud)

从用户的设置VC我正在尝试执行以下操作:

    func paymentMethodsButtonTapped() {
    let paymentMethodsViewController = STPPaymentMethodsViewController()
    paymentMethodsViewController.delegate = self // ERROR HERE: Cannot assign to property: 'delegate' is get only
    let navigationController = UINavigationController(rootViewController: paymentMethodsViewController)
    self.present(navigationController, animated: true, completion: nil)
}
Run Code Online (Sandbox Code Playgroud)

ios stripe-payments swift

5
推荐指数
1
解决办法
903
查看次数

标签 统计

ios ×1

stripe-payments ×1

swift ×1