Closed greggmojica closed 4 years ago
Hi @greggmojica,
Could you share the version of the SDK you're using? didCreateToken
was deprecated in v16
@yuki-stripe I'm using the latest version from cocoapods. If this method is deprecated, how can one generate a token using the STPAddCardViewController currently?
@greggmojica It's no longer possible - since version 16, STPAddCardViewController
and other UI components migrated from Tokens/Sources to PaymentMethods. I recommend you migrate to the Payment Methods + Payment Intents API. This is especially important if you're affected by SCA.
If you can't migrate to PaymentMethods, I recommend you use a version prior to v16.
@yuki-stripe Hi , I also have the same issue. I used 15.0.1 ios Stripe sdk and use method -
(void)addCardViewController:(STPAddCardViewController )addCardViewController didCreateToken:(STPToken )token completion:(STPErrorBlock)completion
I need token.tokenId
but starting from Xcode 11.4 - ios Stripe SDK doesn't compile.
You fix this only in 19.0.1
Could you please help me?
Can I somehow get token.tokenId ( which I get in didCreateToken method) from paymentMethod ???
// Pass it to STPAPIClient to create a Token STPAPIClient.shared().createToken(withCard: cardParams) { token, error in guard let token = token else { // Handle the error return } let tokenID = token.tokenId // Send the token identifier to your server... print(token) } this method returns token but you have to add card values Manually
I'm building a simple app that needs to use stripe for payments. In my viewDidLoad() method I have the following code:
I have the following delegate methods:
However, the didCreateToken method is never invoked and I'm not sure why. Help would be appreciated!