I'm trying to write an iOS app that uses ApplePay and Stripe in pure Swift with a Parse backend. I've got ApplePay working, and correctly authorizing and tokenizing the information through Stripe, but when the STPToken comes back, I can't get the tokenId string from it, even though I can println() it to the terminal.
func paymentAuthorizationViewController(controller: PKPaymentAuthorizationViewController!, didAuthorizePayment payment: PKPayment!, completion: ((PKPaymentAuthorizationStatus) -> Void)!) {
Stripe.createTokenWithPayment(payment, completion: { (token:STPToken!, error:NSError!) -> Void in
if error == nil {
println(token.tokenId)
var card = token.tokenId as String!
println(card)
Here the first println() prints the token ID but the second one does not. How do I extract it for use? It says it is "var tokenId:String! { get }"