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

Take postalCode into account in CardMultilineWidget validation #4574

Merged
merged 3 commits into from
Feb 11, 2022

Conversation

brnunes-stripe
Copy link
Contributor

Summary

Take into account the postalCode field for CardValidCallback validation when it is required in the CardMultilineWidget. Same behavior introduced in #4202 for CardInputWidget.

Motivation

RUN_MOBILESDK-724

Testing

  • Added tests
  • Modified tests
  • Manually verified

}

override fun onAttachedToWindow() {
super.onAttachedToWindow()
postalCodeEditText.config = PostalCodeEditText.Config.Global
cvcEditText.hint = null
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure why this was in onAttachedToWindow, but it seems wrong since it'll overwrite any value set during onCreate, after the view was already created. Moved to the end of init so that doesn't happen.

skyler-stripe
skyler-stripe previously approved these changes Feb 10, 2022
@github-actions
Copy link
Contributor

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 │    12 MiB │    12 MiB │ +339 B │  40.7 MiB │  40.7 MiB │ +84 B 
     arsc │   1.6 MiB │   1.6 MiB │    0 B │   1.6 MiB │   1.6 MiB │   0 B 
 manifest │   2.7 KiB │   2.7 KiB │    0 B │  11.1 KiB │  11.1 KiB │   0 B 
      res │ 697.8 KiB │ 697.8 KiB │    0 B │   1.1 MiB │   1.1 MiB │   0 B 
    asset │    78 KiB │    78 KiB │    0 B │ 109.5 KiB │ 109.5 KiB │   0 B 
    other │  78.3 KiB │  78.3 KiB │   +2 B │   154 KiB │   154 KiB │   0 B 
──────────┼───────────┼───────────┼────────┼───────────┼───────────┼───────
    total │  14.4 MiB │  14.4 MiB │ +341 B │  43.7 MiB │  43.7 MiB │ +84 B 

         │          raw           │            unique             
         ├────────┬────────┬──────┼────────┬────────┬─────────────
 DEX     │ old    │ new    │ diff │ old    │ new    │ diff        
─────────┼────────┼────────┼──────┼────────┼────────┼─────────────
   files │      3 │      3 │    0 │        │        │             
 strings │ 196168 │ 196168 │    0 │ 172484 │ 172484 │ 0 (+12 -12) 
   types │  33381 │  33381 │    0 │  31245 │  31245 │ 0 (+1 -1)   
 classes │  28840 │  28840 │    0 │  28840 │  28840 │ 0 (+1 -1)   
 methods │ 167676 │ 167676 │    0 │ 162675 │ 162675 │ 0 (+6 -6)   
  fields │ 122905 │ 122905 │    0 │ 122186 │ 122186 │ 0 (+1 -1)   

 ARSC    │ old  │ new  │ diff 
─────────┼──────┼──────┼──────
 configs │  298 │  298 │  0   
 entries │ 5394 │ 5394 │  0
APK
   compressed   │  uncompressed   │                                                       
───────┬────────┼─────────┬───────┤                                                       
 size  │ diff   │ size    │ diff  │ path                                                  
───────┼────────┼─────────┼───────┼───────────────────────────────────────────────────────
 3 MiB │ +339 B │ 8.3 MiB │ +84 B │ ∆ classes3.dex                                        
 190 B │   +2 B │     6 B │   0 B │ ∆ META-INF/androidx.activity_activity-compose.version 
───────┼────────┼─────────┼───────┼───────────────────────────────────────────────────────
 3 MiB │ +341 B │ 8.3 MiB │ +84 B │ (total)
DEX
STRINGS:

   old    │ new    │ diff        
  ────────┼────────┼─────────────
   172484 │ 172484 │ 0 (+12 -12) 
  + _r8_lambda_24KfdxqP2iafAwH6zFP-bGup_Rg
  + Lcom/stripe/android/view/CardMultilineWidget__init__lambda-18__inlined_doAfterTextChanged_1;
  + SMAP
  CardMultilineWidget.kt
  Kotlin
  *S Kotlin
  *F
  + 1 CardMultilineWidget.kt
  com/stripe/android/view/CardMultilineWidget
  + 2 Delegates.kt
  kotlin/properties/Delegates
  + 3 _Collections.kt
  kotlin/collections/CollectionsKt___CollectionsKt
  + 4 TextView.kt
  androidx/core/widget/TextViewKt
  + 5 fake.kt
  kotlin/jvm/internal/FakeKt
  + 6 View.kt
  androidx/core/view/ViewKt
  + 7 Context.kt
  androidx/core/content/ContextKt
  *L
  1#1,777:1
  33#2,3:778
  33#2,3:781
  33#2,3:784
  33#2,3:787
  33#2,3:790
  33#2,3:793
  33#2,3:796
  1849#3,2:799
  1849#3:801
  1850#3:828
  1849#3,2:830
  1849#3,2:832
  286#3,2:834
  1849#3,2:836
  58#4,23:802
  93#4,3:825
  1#5:829
  321#6,4:838
  52#7,9:842
  *S KotlinDebug
  *F
  + 1 CardMultilineWidget.kt
  com/stripe/android/view/CardMultilineWidget
  *L
  142#1:778,3
  268#1:781,3
  283#1:784,3
  289#1:787,3
  300#1:790,3
  311#1:793,3
  322#1:796,3
  336#1:799,2
  389#1:801
  389#1:828
  435#1:830,2
  439#1:832,2
  478#1:834,2
  591#1:836,2
  390#1:802,23
  390#1:825,3
  628#1:838,4
  638#1:842,9
  *E
  
  + SMAP
  Delegates.kt
  Kotlin
  *S Kotlin
  *F
  + 1 Delegates.kt
  kotlin/properties/Delegates_observable_1
  + 2 CardMultilineWidget.kt
  com/stripe/android/view/CardMultilineWidget
  *L
  1#1,70:1
  145#2,6:71
  *E
  
  + SMAP
  Delegates.kt
  Kotlin
  *S Kotlin
  *F
  + 1 Delegates.kt
  kotlin/properties/Delegates_observable_1
  + 2 CardMultilineWidget.kt
  com/stripe/android/view/CardMultilineWidget
  *L
  1#1,70:1
  271#2,4:71
  *E
  
  + SMAP
  Delegates.kt
  Kotlin
  *S Kotlin
  *F
  + 1 Delegates.kt
  kotlin/properties/Delegates_observable_1
  + 2 CardMultilineWidget.kt
  com/stripe/android/view/CardMultilineWidget
  *L
  1#1,70:1
  286#2,2:71
  *E
  
  + SMAP
  Delegates.kt
  Kotlin
  *S Kotlin
  *F
  + 1 Delegates.kt
  kotlin/properties/Delegates_observable_1
  + 2 CardMultilineWidget.kt
  com/stripe/android/view/CardMultilineWidget
  *L
  1#1,70:1
  292#2,2:71
  *E
  
  + SMAP
  Delegates.kt
  Kotlin
  *S Kotlin
  *F
  + 1 Delegates.kt
  kotlin/properties/Delegates_observable_1
  + 2 CardMultilineWidget.kt
  com/stripe/android/view/CardMultilineWidget
  *L
  1#1,70:1
  303#2,2:71
  *E
  
  + SMAP
  Delegates.kt
  Kotlin
  *S Kotlin
  *F
  + 1 Delegates.kt
  kotlin/properties/Delegates_observable_1
  + 2 CardMultilineWidget.kt
  com/stripe/android/view/CardMultilineWidget
  *L
  1#1,70:1
  314#2,2:71
  *E
  
  + SMAP
  Delegates.kt
  Kotlin
  *S Kotlin
  *F
  + 1 Delegates.kt
  kotlin/properties/Delegates_observable_1
  + 2 CardMultilineWidget.kt
  com/stripe/android/view/CardMultilineWidget
  *L
  1#1,70:1
  325#2,2:71
  *E
  
  + SMAP
  TextView.kt
  Kotlin
  *S Kotlin
  *F
  + 1 TextView.kt
  androidx/core/widget/TextViewKt_addTextChangedListener_textWatcher_1
  + 2 CardMultilineWidget.kt
  com/stripe/android/view/CardMultilineWidget
  + 3 TextView.kt
  androidx/core/widget/TextViewKt_addTextChangedListener_1
  + 4 TextView.kt
  androidx/core/widget/TextViewKt_addTextChangedListener_2
  *L
  1#1,97:1
  391#2,2:98
  71#3:100
  77#4:101
  *E
  
  + initFocusChangeListeners_lambda-29
  
  - _r8_lambda_QnVP9xznJgEBLlps5sjUNAqb7Ok
  - Lcom/stripe/android/view/CardMultilineWidget__init__lambda-17__inlined_doAfterTextChanged_1;
  - SMAP
  CardMultilineWidget.kt
  Kotlin
  *S Kotlin
  *F
  + 1 CardMultilineWidget.kt
  com/stripe/android/view/CardMultilineWidget
  + 2 Delegates.kt
  kotlin/properties/Delegates
  + 3 _Collections.kt
  kotlin/collections/CollectionsKt___CollectionsKt
  + 4 TextView.kt
  androidx/core/widget/TextViewKt
  + 5 fake.kt
  kotlin/jvm/internal/FakeKt
  + 6 View.kt
  androidx/core/view/ViewKt
  + 7 Context.kt
  androidx/core/content/ContextKt
  *L
  1#1,773:1
  33#2,3:774
  33#2,3:777
  33#2,3:780
  33#2,3:783
  33#2,3:786
  33#2,3:789
  33#2,3:792
  1849#3,2:795
  1849#3:797
  1850#3:824
  1849#3,2:826
  1849#3,2:828
  286#3,2:830
  1849#3,2:832
  58#4,23:798
  93#4,3:821
  1#5:825
  321#6,4:834
  52#7,9:838
  *S KotlinDebug
  *F
  + 1 CardMultilineWidget.kt
  com/stripe/android/view/CardMultilineWidget
  *L
  139#1:774,3
  265#1:777,3
  280#1:780,3
  286#1:783,3
  297#1:786,3
  308#1:789,3
  319#1:792,3
  333#1:795,2
  386#1:797
  386#1:824
  431#1:826,2
  435#1:828,2
  474#1:830,2
...✂

Copy link
Contributor

@michelleb-stripe michelleb-stripe left a comment

Choose a reason for hiding this comment

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

Probably worth a quick check with react native to make sure things are still working there too, given the change to the postal config checking.

@brnunes-stripe brnunes-stripe merged commit cb5d8c5 into master Feb 11, 2022
@brnunes-stripe brnunes-stripe deleted the brnunes/cardmulti branch February 11, 2022 15:50
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

3 participants