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

Fix issue with limited postal code input #5715

Merged
merged 1 commit into from
Oct 17, 2022
Merged

Conversation

tillh-stripe
Copy link
Collaborator

@tillh-stripe tillh-stripe commented Oct 17, 2022

Summary

This pull request fixes an issue where non-US and non-Canadian postal codes were limited to a single character.

Motivation

Resolves: #5714

Testing

  • Added tests
  • Modified tests
  • Manually verified

Screenshots

Before After
before screenshot after screenshot

Changelog

[FIXED] Postal codes for countries other than US and Canada are no longer limited to a single character.

@tillh-stripe tillh-stripe force-pushed the tillh/postal-code-fix branch from e21d20b to a67be4b Compare October 17, 2022 15:50
@github-actions
Copy link
Contributor

github-actions bot commented Oct 17, 2022

Diffuse output:

OLD: paymentsheet-example-release-master.apk (signature: none)
NEW: paymentsheet-example-release-pr.apk (signature: none)

          │         compressed         │         uncompressed         
          ├──────────┬──────────┬──────┼───────────┬───────────┬──────
 APK      │ old      │ new      │ diff │ old       │ new       │ diff 
──────────┼──────────┼──────────┼──────┼───────────┼───────────┼──────
      dex │  5.2 MiB │  5.2 MiB │ +1 B │  13.5 MiB │  13.5 MiB │  0 B 
     arsc │  1.9 MiB │  1.9 MiB │  0 B │   1.9 MiB │   1.9 MiB │  0 B 
 manifest │  4.1 KiB │  4.1 KiB │  0 B │  19.2 KiB │  19.2 KiB │  0 B 
      res │    1 MiB │    1 MiB │  0 B │   1.8 MiB │   1.8 MiB │  0 B 
   native │  2.5 MiB │  2.5 MiB │  0 B │   5.9 MiB │   5.9 MiB │  0 B 
    asset │    3 MiB │    3 MiB │ -1 B │     3 MiB │     3 MiB │ -1 B 
    other │ 82.5 KiB │ 82.5 KiB │  0 B │ 158.5 KiB │ 158.5 KiB │  0 B 
──────────┼──────────┼──────────┼──────┼───────────┼───────────┼──────
    total │ 13.7 MiB │ 13.7 MiB │  0 B │  26.3 MiB │  26.3 MiB │ -1 B 

         │          raw           │           unique            
         ├────────┬────────┬──────┼────────┬────────┬───────────
 DEX     │ old    │ new    │ diff │ old    │ new    │ diff      
─────────┼────────┼────────┼──────┼────────┼────────┼───────────
   files │      2 │      2 │    0 │        │        │           
 strings │  84308 │  84308 │    0 │  70089 │  70089 │ 0 (+0 -0) 
   types │  21696 │  21696 │    0 │  19525 │  19525 │ 0 (+0 -0) 
 classes │  17503 │  17503 │    0 │  17503 │  17503 │ 0 (+0 -0) 
 methods │  93892 │  93892 │    0 │  89915 │  89915 │ 0 (+0 -0) 
  fields │ 101806 │ 101806 │    0 │ 100569 │ 100569 │ 0 (+0 -0) 

 ARSC    │ old  │ new  │ diff 
─────────┼──────┼──────┼──────
 configs │  334 │  334 │  0   
 entries │ 6252 │ 6252 │  0
APK
   compressed   │  uncompressed  │                                
─────────┬──────┼─────────┬──────┤                                
 size    │ diff │ size    │ diff │ path                           
─────────┼──────┼─────────┼──────┼────────────────────────────────
   766 B │ -2 B │   634 B │ -2 B │ ∆ assets/dexopt/baseline.profm 
   8 KiB │ +1 B │ 7.8 KiB │ +1 B │ ∆ assets/dexopt/baseline.prof  
 2.1 MiB │ +1 B │ 5.8 MiB │  0 B │ ∆ classes2.dex                 
─────────┼──────┼─────────┼──────┼────────────────────────────────
 2.1 MiB │  0 B │ 5.8 MiB │ -1 B │ (total)

@tillh-stripe tillh-stripe force-pushed the tillh/postal-code-fix branch from 022ba73 to 3593e19 Compare October 17, 2022 16:24
FieldError(R.string.address_zip_postal_invalid)
}
else -> null
}
}

override fun isFull(): Boolean = input.length >= format.minimumLength
override fun isFull(): Boolean = input.length >= format.maximumLength
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While this doesn’t impact the resolution of the issue, it makes more sense to me than the previous implementation: A field is full when it reaches the maximum length, not when it exceeds the minimum length.

@tillh-stripe tillh-stripe merged commit d1eeeaa into master Oct 17, 2022
@tillh-stripe tillh-stripe deleted the tillh/postal-code-fix branch October 17, 2022 17:57
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.

[BUG] Can't enter UK postcode on payment sheet, only one character allowed
3 participants