In this line, the error was Display. Can someone tell me what mistake was made?
Stripe.createTokenWithCard(card, completion: { (token: STPToken!, error: NSError!) -> Void in
self.handleToken(token)
In this line, the error was Display. Can someone tell me what mistake was made?
Stripe.createTokenWithCard(card, completion: { (token: STPToken!, error: NSError!) -> Void in
self.handleToken(token)
Thanks, @Shali! Your tip is helpful.
For those who are beginners like me, you might still get an error. In case you experience an error indicating either an extra argument in call before adding
sharedClient()
or howcreateTokenWithCard
cannot be invoked aftersharedClient()
is added, it helps to make the completion arguments optional (as inSTPToken?
andNSError?
).As mentioned by Christine, the method now uses Optionals so it looks like the following:
For objective-c using latest stripe pod
I had the same problem after updating Stripe in pods recently. That method is deprecated. Instead, you can use the following code:
It takes the same parameters.
Update
Thanks to @Christine and @Keyhole150
This function in Stripe API has now be changed to