首页 > 解决方案 > 与 iOS 的条纹集成

问题描述

    let paymentContext: STPPaymentContext

    init(product: String, price: Int, settings: Settings) {
       //some other code

        super.init(nibName: nil, bundle: nil)
        self.paymentContext.delegate = self
        paymentContext.hostViewController = self
    }

//    required init?(coder aDecoder: NSCoder) {
//        fatalError("init(coder:) has not been implemented")
//    }

    required init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
    }

我正在尝试遵循 Stripe 的 iOS 标准集成,我正在使用来自https://github.com/stripe/stripe-ios/tree/master/Example/Standard%20Integration%20(Swift)的代码,特别是 CheckoutViewController。 swift 文件,但我最初收到关于致命错误的注释代码错误,所以我用上面的代码替换,现在我收到一个编译错误,显示“Property 'self.paymentContext' not initialized at super.init call”如果任何 swift 或 Stripe 专家都可以提供帮助,那就太好了!

标签: iosswiftstripe-payments

解决方案


更新 let paymentContext: STPPaymentContext

经过 var paymentContext: STPPaymentContext?


推荐阅读