feat(ios): update stripe objects for latest sdk

Updates usage of stripe iOS SDK to use latest objects after their refactoring

It's actually important to upgrade to this version of the SDK because they have finally brought the SDK into the present and are using a recent version of the Stripe API (may 2019) instead of one from 2015.
feat/update-stripe-sdk
codinronan 5 years ago committed by GitHub
parent 73820adcc3
commit 146445f882
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -82,7 +82,7 @@ import Stripe
paymentContext.hostViewController = self.viewController
}
customerContext.clearCachedCustomer()
customerContext.clearCache()
}
@ -235,19 +235,20 @@ import Stripe
print("[StripePaymentsPlugin].paymentContextDidChange: \(resultMsg)")
successCallback(paymentStatusCallback, resultMsg, keepCallback: true)
}
// This callback is triggered when requestPayment() completes successfully to create a Source.
// This Source can then be used by the app to process a payment (create a charge, subscription etc.)
func paymentContext(_ paymentContext: STPPaymentContext, didCreatePaymentResult paymentResult: STPPaymentResult, completion: @escaping STPErrorBlock) {
func paymentContext(_ paymentContext: STPPaymentContext, didCreatePaymentResult paymentResult: STPPaymentResult, completion: @escaping STPPaymentStatusBlock) {
// Create charge using payment result
let resultMsg: [String : Any] = [
"status": "PAYMENT_CREATED",
"source": paymentResult.source.stripeID
"source": paymentResult.paymentMethod.stripeId
// "source": paymentResult.source.stripeID
]
print("[StripePaymentsPlugin].paymentContext.didCreatePaymentResult: \(resultMsg)")
successCallback(paymentStatusCallback, resultMsg, keepCallback: true)
completion(nil)
completion(STPPaymentStatus.success, nil)
}
// This callback triggers due to:
@ -313,4 +314,3 @@ import Stripe
}
}

Loading…
Cancel
Save