Skip to content

Instantly share code, notes, and snippets.

Marwan Elwaraki melwaraki

Block or report user

Report or block melwaraki

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Stripe VC Crash.swift
//class that generates the ephermal key
class StripeCustomerSessionManager: NSObject, STPEphemeralKeyProvider {
func createCustomerKey(withAPIVersion apiVersion: String, completion: @escaping STPJSONResponseCompletionBlock) {
let parameters = [
"api_version": apiVersion
//this runs async, could this be causing an issue? i think the app crashes before it runs though
View Settings.swift
//function that presents STPPaymentMethodsViewController
func handlePaymentMethodsButtonTapped() {
// Setup customer context
let customerKeyProvider = StripeCustomerSessionManager()
let customerContext = STPCustomerContext(keyProvider: customerKeyProvider)
// Setup payment methods view controller
let paymentMethodsViewController = STPPaymentMethodsViewController(configuration: STPPaymentConfiguration.shared(), theme: STPTheme.default(), customerContext: customerContext, delegate: self)
// Present payment methods view controller
You can’t perform that action at this time.