ios - 与 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 专家都可以提供帮助,那就太好了!
解决方案
更新
let paymentContext: STPPaymentContext
经过
var paymentContext: STPPaymentContext?
推荐阅读
- java - 是否可以调试 Intellij IDEA 本身?
- ios - 'Character' 类型的值没有成员 'isUppercase'
- python - 忽略 Vigenere Cipher 中的空格
- flutter - Flutter - 定时器意外暂停
- angular - 增加模态的大小
- ios - 滚动类型为水平时的UICollectionview拖放问题
- javascript - 仅当省略号处于活动状态时才显示工具提示
- maven - 上传到 Nexus 的自定义 JAR 未从 settings.xml 中定义的 Nexus 公共组解析
- c# - 如何从 ASP.Net 核心 API 共享上传的文件
- php - 注册为服务的 Symfony 3.4 控制器抛出弃用警告