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

Add validation/inputType option to zip code field #2273

Closed
luismierez opened this issue Mar 9, 2020 · 2 comments · Fixed by #2278
Closed

Add validation/inputType option to zip code field #2273

luismierez opened this issue Mar 9, 2020 · 2 comments · Fixed by #2278
Assignees
Labels
triaged Issue has been reviewed by Stripe and is being tracked internally

Comments

@luismierez
Copy link

Summary

Zip Code field doesn't have any validation. Also, it doesn't seem like we can change the inputType on that field to prevent the user from inputting a bunch of letters.

SDK version

14.1.0

@mshafrir-stripe
Copy link
Collaborator

@luismierez thanks for filing. If you require a valid zip code it will restrict your customers to only those that are US-based. Is that your intention?

@luismierez
Copy link
Author

@mshafrir-stripe yeah, our product is only offered in the US. I just noticed that there is a way to add a TextWatcher to the zip code field, so I could do the validation there, but it would be a better user experience if we could also change the inputType for that field.

@mshafrir-stripe mshafrir-stripe added the triaged Issue has been reviewed by Stripe and is being tracked internally label Mar 10, 2020
@mshafrir-stripe mshafrir-stripe self-assigned this Mar 10, 2020
mshafrir-stripe added a commit that referenced this issue Mar 10, 2020
…idget

Summary
Enable via code:
```
cardMultilineWidget.usZipCodeRequired = true
```

Enable via XML layout:
```
<com.stripe.android.view.CardMultilineWidget
    android:id="@+id/card_multiline_widget"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    app:shouldRequireUsZipCode="true"/>
```

Motivation
Fixes #2273

Testing
Added tests and manually verified
mshafrir-stripe added a commit that referenced this issue Mar 10, 2020
…idget (#2278)

Summary
Enable via code:
```
cardMultilineWidget.usZipCodeRequired = true
```

Enable via XML layout:
```
<com.stripe.android.view.CardMultilineWidget
    android:id="@+id/card_multiline_widget"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    app:shouldRequireUsZipCode="true"/>
```

Motivation
Fixes #2273

Testing
Added tests and manually verified
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

Successfully merging a pull request may close this issue.

2 participants