Skip to content

Instantly share code, notes, and snippets.

@felixdkatt
Created September 22, 2015 17:26
Show Gist options
  • Save felixdkatt/0ce3f01643541e6bc884 to your computer and use it in GitHub Desktop.
Save felixdkatt/0ce3f01643541e6bc884 to your computer and use it in GitHub Desktop.
ios xcode 7 issue with this method call in stripe
func paymentAuthorizationViewController(controller: PKPaymentAuthorizationViewController, didAuthorizePayment payment: PKPayment, completion: ((PKPaymentAuthorizationStatus) -> Void)) {
STPAPIClient.sharedClient().createTokenWithPayment(payment, completion: { (token: STPToken!, error: NSError!) -> Void in
if (error != nil) {
print(error)
completion(PKPaymentAuthorizationStatus.Failure)
}else{
completion(PKPaymentAuthorizationStatus.Success)
}
})
}
@felixdkatt
Copy link
Author

error highlights the stripe call

PaymentController.swift:209:75: Invalid conversion from throwing function of type '(STPToken!, NSError!) throws -> Void' to non-throwing function type 'STPCompletionBlock' (aka '(Optional, Optional) -> ()')

@felixdkatt
Copy link
Author

STPAPIClient.sharedClient().createTokenWithPayment(payment, completion: { (token, error) -> Void in
did not fix the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment