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

STPAddCardViewController ZIP Code for Canadian Customers #1302

Closed
payshake opened this issue Aug 14, 2019 · 4 comments
Closed

STPAddCardViewController ZIP Code for Canadian Customers #1302

payshake opened this issue Aug 14, 2019 · 4 comments
Assignees
Labels
triaged Issue has been reviewed by Stripe and is being tracked internally

Comments

@payshake
Copy link

payshake commented Aug 14, 2019

Hi all,

I'm having an issue with my Canadian customers being prompted for a ZIP code on the STPAddCardViewController. The number pad and field validation make it impossible for customers to enter a postal code.

After digging around, I've found that the field is dependent on the user's defined Region in their device settings. This causes problems for users who may have moved, improperly setup their device, or are using the app in another country.

Is there any way for me to set the locale on STPAddCardViewController to match the device's current location? Alternatively, is there a way to force the ZIP code field to always be ASCII capable, rather than forced number pad? I'd rather my customers be able to pass a bad value and have the ZIP check fail on creating a token, rather than having them not be able to submit the form at all.

@yuki-stripe
Copy link
Collaborator

Hi @payshake,

Unfortunately I don't see a way to do that using STPAddCardViewController. Internally, it uses STPPaymentCardTextField. You can set its locale (and more) via https://stripe.dev/stripe-ios/docs/Classes/STPPaymentCardTextField.html#/c:objc(cs)STPPaymentCardTextField(py)countryCode.

Setting this value to anything other than "US" causes it to display the default keyboard (

self.postalCodeField.keyboardType = UIKeyboardTypeDefault;
).

@yuki-stripe yuki-stripe self-assigned this Aug 19, 2019
@yuki-stripe yuki-stripe added the triaged Issue has been reviewed by Stripe and is being tracked internally label Aug 19, 2019
@payshake
Copy link
Author

Hi @payshake,

Unfortunately I don't see a way to do that using STPAddCardViewController. Internally, it uses STPPaymentCardTextField. You can set its locale (and more) via https://stripe.dev/stripe-ios/docs/Classes/STPPaymentCardTextField.html#/c:objc(cs)STPPaymentCardTextField(py)countryCode.

Setting this value to anything other than "US" causes it to display the default keyboard (

self.postalCodeField.keyboardType = UIKeyboardTypeDefault;

).

Thanks Yuki,

I can't seem to access the STPPaymentCardTextField property of STPAddCardViewController.

Just to be clear, I will need to replace STPAddCardViewController with our own UI leveraging STPPaymentCardTextField to fix this issue?

@davidme-stripe
Copy link
Contributor

Sorry that this took so long to fix! We're addressing this in #1424.

@davidme-stripe
Copy link
Contributor

This is fixed in v18.1.0!

yuki-stripe pushed a commit that referenced this issue Jul 25, 2022
* Add ownership fields

* mark fields as public
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triaged Issue has been reviewed by Stripe and is being tracked internally
Projects
None yet
Development

No branches or pull requests

3 participants