【问题标题】:Stripe integration with iOS条纹与 iOS 的集成
【发布时间】:2019-01-02 00:41:24
【问题描述】:
    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 文件,但我最初收到关于致命错误的注释代码错误,因此我替换为代码就在上面,现在我得到一个编译错误,上面写着“属性'self.paymentContext'未在 super.init 调用时初始化”如果任何 swift 或 stripe 专家可以提供帮助,那就太好了!

【问题讨论】:

    标签: ios swift stripe-payments


    【解决方案1】:

    更新 let paymentContext: STPPaymentContext

    通过 var paymentContext: STPPaymentContext?

    【讨论】:

      猜你喜欢
      • 2018-08-22
      • 2015-09-23
      • 2019-02-15
      • 2017-10-26
      • 2020-05-23
      • 2016-12-31
      • 2020-12-13
      • 1970-01-01
      • 2023-04-03
      相关资源
      最近更新 更多