Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration from stripe 4.0 to latest stripe 8.x #467

Closed
parthadrojasa opened this issue Sep 28, 2016 · 1 comment
Closed

Migration from stripe 4.0 to latest stripe 8.x #467

parthadrojasa opened this issue Sep 28, 2016 · 1 comment
Assignees

Comments

@parthadrojasa
Copy link

I have not updated stripe from a long time and i now it seems that paymentkit is integrated into stripe. So i have used multiple things from paymentkit and i am not able to find proper thing how to migrate the code. I have some queries below.

I am using PTKCardNumber like let cardNumber:PTKCardNumber = PTKCardNumber(string:strCardNumber)
PTKCardTypeAmex like to determine which card is it.
PTKTextField for the card like PTKTextField.textByRemovingUselessSpacesFromString(str as String)
What is used in place of above this all in new stripe?

@0thernet 0thernet self-assigned this Sep 28, 2016
@0thernet
Copy link
Contributor

Hey @parthadrojasa,

  • There's no equivalent for PTKCardNumber in the latest SDK. To determine brand from a card number, you can use STPCardValidator:

STPCardValidator.brandForNumber("4242424242424242")

https://stripe.github.io/stripe-ios/docs/Classes/STPCardValidator.html

  • PTKTextField is now STPPaymentCardTextField. To set the card number of an STPPaymentCardTextField, you can set its cardParams:
let textField = STPPaymentCardTextField()
let cardParams = STPCardParams()
cardParams.number = "4242424242424242"
textField.cardParams = cardParams

https://stripe.github.io/stripe-ios/docs/Classes/STPPaymentCardTextField.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants