title: swift How to get Stripe token?
body: <p>I want to implement <strong>Stripe</strong> Payment gateway. And need to generate token and pass it to backend.</p>
  
  <pre><code>private func getToken(){
          let cardParams = STPCardParams()
          cardParams.number = paymentCardTextField?.cardNumber
          cardParams.expMonth = (paymentCardTextField?.expirationMonth)!
          cardParams.expYear = (paymentCardTextField?.expirationYear)!
          cardParams.cvc = paymentCardTextField?.cvc
          STPAPIClient.shared().createToken(withCard: cardParams) { (token: STPToken?, error: Error?) in
              guard let token = token, error == nil else {
                  // Present error to user...
                  return
              }
              self.dictPayData["stripe_token"] = token.tokenId
              print(self.dictPayData)
  
  
          }
      }
  </code></pre>