Bethany Bin
Bethany Bin

Reputation: 25

Stripe integration with 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)
    }

I am trying to follow Stripe's standard integration for iOS and I am using their code from https://github.com/stripe/stripe-ios/tree/master/Example/Standard%20Integration%20(Swift), specifically the CheckoutViewController.swift file but I initially got a error with the commented out code regarding the fatal error so I replaced with the code right above and now i get a compile error that says "Property 'self.paymentContext' not initialized at super.init call" If any swift or stripe experts can help out that would be great!

Upvotes: 1

Views: 271

Answers (1)

CZ54
CZ54

Reputation: 5588

Update let paymentContext: STPPaymentContext

by var paymentContext: STPPaymentContext?

Upvotes: 1

Related Questions