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

callback for postal code complete #4424

Merged
merged 4 commits into from
Dec 9, 2021
Merged

callback for postal code complete #4424

merged 4 commits into from
Dec 9, 2021

Conversation

ccen-stripe
Copy link
Collaborator

@ccen-stripe ccen-stripe commented Nov 30, 2021

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

  • Added tests
  • Modified tests
  • Manually verified

Screenshots

Before After
before screenshot after screenshot

@github-actions
Copy link
Contributor

github-actions bot commented Nov 30, 2021

Diffuse output:

@michelleb-stripe
Copy link
Contributor

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?

@ccen-stripe
Copy link
Collaborator Author

ccen-stripe commented Dec 2, 2021

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?

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.

@michelleb-stripe
Copy link
Contributor

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?

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.

@ccen-stripe
Copy link
Collaborator Author

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?

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"

@ccen-stripe
Copy link
Collaborator Author

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?

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

@ccen-stripe ccen-stripe changed the title callback for us zip code complete callback for postal code complete Dec 3, 2021
@ccen-stripe ccen-stripe merged commit c75cef9 into master Dec 9, 2021
@ccen-stripe ccen-stripe deleted the postal branch December 9, 2021 17:02
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

Successfully merging this pull request may close these issues.

None yet

4 participants