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 minimum length to AuBankAccountNumberConfig #9576

Merged
merged 1 commit into from
Nov 8, 2024

Conversation

samer-stripe
Copy link
Collaborator

@samer-stripe samer-stripe commented Nov 8, 2024

Summary

Add minimum length to AuBankAccountNumberConfig.

Motivation

Resolves https://jira.corp.stripe.com/browse/RUN_MOBILESDK-3682

Au Becs can have a minimum of 5 digits (4 for Cuscal (BSB prefix 80)) however the SDK only allows for an account number with 9 digits. This PR allows for 4-5 digit account numbers for Becs.

Testing

  • Added tests
  • Modified tests
  • Manually verified

return TextFieldStateConstants.Valid.Full
}

private companion object {
const val LENGTH = 9
const val MINIMUM_LENGTH = 4
Copy link
Collaborator Author

@samer-stripe samer-stripe Nov 8, 2024

Choose a reason for hiding this comment

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

Ideally, we would only enable a minimum length of 4 for Cuscal but given that LUXE provides these fields separately and we have no way of currently observing other form field values, I haven't been able to think of a solution that doesn't either :

  • Make major changes to element system to observe values coming from other elements.
  • Makes static assumptions on an LPM's elements (ignore LUXE and make a custom Element to handle all of Becs similar to AddressElement).

Copy link
Contributor

github-actions bot commented Nov 8, 2024

Diffuse output:

OLD: paymentsheet-example-release-master.apk (signature: V1, V2)
NEW: paymentsheet-example-release-pr.apk (signature: V1, V2)

          │           compressed           │         uncompressed          
          ├───────────┬───────────┬────────┼───────────┬───────────┬───────
 APK      │ old       │ new       │ diff   │ old       │ new       │ diff  
──────────┼───────────┼───────────┼────────┼───────────┼───────────┼───────
      dex │   3.8 MiB │   3.8 MiB │ -153 B │   8.4 MiB │   8.4 MiB │ +20 B 
     arsc │   2.3 MiB │   2.3 MiB │    0 B │   2.3 MiB │   2.3 MiB │   0 B 
 manifest │     5 KiB │     5 KiB │    0 B │  24.9 KiB │  24.9 KiB │   0 B 
      res │ 902.2 KiB │ 902.2 KiB │    0 B │   1.4 MiB │   1.4 MiB │   0 B 
   native │   2.6 MiB │   2.6 MiB │    0 B │     6 MiB │     6 MiB │   0 B 
    asset │   1.6 MiB │   1.6 MiB │    0 B │   1.6 MiB │   1.6 MiB │   0 B 
    other │ 199.8 KiB │ 199.8 KiB │   +7 B │ 440.1 KiB │ 440.1 KiB │   0 B 
──────────┼───────────┼───────────┼────────┼───────────┼───────────┼───────
    total │  11.4 MiB │  11.4 MiB │ -146 B │  20.2 MiB │  20.2 MiB │ +20 B 

 DEX     │ old   │ new   │ diff      
─────────┼───────┼───────┼───────────
   files │     1 │     1 │ 0         
 strings │ 39758 │ 39758 │ 0 (+1 -1) 
   types │ 13711 │ 13711 │ 0 (+0 -0) 
 classes │ 11403 │ 11403 │ 0 (+0 -0) 
 methods │ 58601 │ 58601 │ 0 (+0 -0) 
  fields │ 38901 │ 38901 │ 0 (+0 -0) 

 ARSC    │ old  │ new  │ diff 
─────────┼──────┼──────┼──────
 configs │  242 │  242 │  0   
 entries │ 6189 │ 6189 │  0
APK
    compressed     │   uncompressed    │                        
──────────┬────────┼───────────┬───────┤                        
 size     │ diff   │ size      │ diff  │ path                   
──────────┼────────┼───────────┼───────┼────────────────────────
  3.8 MiB │ -153 B │   8.4 MiB │ +20 B │ ∆ classes.dex          
   53 KiB │  +11 B │ 117.6 KiB │   0 B │ ∆ META-INF/CERT.SF     
 49.7 KiB │   -3 B │ 117.5 KiB │   0 B │ ∆ META-INF/MANIFEST.MF 
  1.2 KiB │   -1 B │   1.2 KiB │   0 B │ ∆ META-INF/CERT.RSA    
──────────┼────────┼───────────┼───────┼────────────────────────
  3.9 MiB │ -146 B │   8.6 MiB │ +20 B │ (total)
DEX
STRINGS:

   old   │ new   │ diff      
  ───────┼───────┼───────────
   39758 │ 39758 │ 0 (+1 -1) 
  
  + ~~R8{"backend":"dex","compilation-mode":"release","has-checksums":false,"min-api":21,"pg-map-id":"bdb5a7e","r8-mode":"full","version":"8.7.14"}
  
  - ~~R8{"backend":"dex","compilation-mode":"release","has-checksums":false,"min-api":21,"pg-map-id":"7f4827a","r8-mode":"full","version":"8.7.14"}

@samer-stripe samer-stripe marked this pull request as ready for review November 8, 2024 18:21
@samer-stripe samer-stripe requested review from a team as code owners November 8, 2024 18:21
@samer-stripe samer-stripe merged commit 2146f0c into master Nov 8, 2024
16 checks passed
@samer-stripe samer-stripe deleted the samer/au-becs-config-length-fix branch November 8, 2024 18:47
wooj-stripe added a commit to stripe/stripe-ios that referenced this pull request Nov 14, 2024
## Summary
Mirrors change introduced here:
stripe/stripe-android#9576

## Motivation
Au Becs can have a minimum of 5 digits (4 for Cuscal (BSB prefix 80))
however the SDK only allows for an account number with 9 digits. This PR
allows for 4-5 digit account numbers for Becs.

## Testing
Updated unit tests
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.

2 participants