-
Notifications
You must be signed in to change notification settings - Fork 658
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
callback for postal code complete #4424
Conversation
Diffuse output: |
Would it be wrong to say a Global zip code is complete when it is not blank? This might give a more consistent feel across US and Global zip codes? |
payments-core/src/main/java/com/stripe/android/view/CardInputListener.kt
Outdated
Show resolved
Hide resolved
There is no algorithm to tell if a global zip is complete or not, atm we only have the algorithm to tell if it's valid for US, GB and CA. This listener is used in CardWidget, which doesn't have access to country information other than US. |
I think a Global zip code is complete as long as it has text in it. A blank global zip code is not valid if it is indicated to be required. |
hmm this would end up passing valid callback each time text changed - "1" , "12" and "123" will all return true to user three times in a row - not sure how useful it is. Also in our codebase we have a formal PostalCodeValidator, which doesn't have an algorithm for "if it's global, always return true for any unempty text" |
@michelleb-stripe just realized we already have a similar change on CardInputWidget for validCallback, since it's already there, it makes sense to keep the logic in sync. Will update the callback accordingly |
Summary
Introduce
CardInputListener#onPostalCodeComplete
Note: Since there is no matching standard for Global, any non empty global postal is considered valid.
Motivation
https://jira.corp.stripe.com/browse/RUN_MOBILESDK-549
Testing
Screenshots