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

[CardInputWidget] Fix CardValidCallback not firing on postal code changes #4504

Merged
merged 1 commit into from
Jan 19, 2022

Conversation

skyler-stripe
Copy link
Contributor

Summary

This fixes a bug where we had a user adding a postal code requirement after setting their CardValidCallback. It resulted in changes to the postal code not triggering the callback. This should make it so you can set (or remove) the postal code requirement anytime and your custom callback will be triggered upon changes to the text field. Previously it was required that you set the postal code requirement before setting your callback.

Motivation

https://jira.corp.stripe.com/browse/RUN_MOBILESDK-653

Testing

  • Added tests
  • Modified tests
  • Manually verified

@skyler-stripe skyler-stripe changed the title Fix CardValidCallback not firing on postal code changes [CardInputWidget] Fix CardValidCallback not firing on postal code changes Jan 13, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Jan 13, 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 │  11.8 MiB │  11.8 MiB │ -88 B │  40.1 MiB │  40.1 MiB │ +72 B 
     arsc │   1.4 MiB │   1.4 MiB │   0 B │   1.4 MiB │   1.4 MiB │   0 B 
 manifest │   2.6 KiB │   2.6 KiB │   0 B │  10.8 KiB │  10.8 KiB │   0 B 
      res │ 653.2 KiB │ 653.2 KiB │   0 B │     1 MiB │     1 MiB │   0 B 
    asset │  77.7 KiB │  77.7 KiB │ +15 B │ 109.2 KiB │ 109.2 KiB │ +15 B 
    other │  78.3 KiB │  78.3 KiB │  -6 B │   154 KiB │   154 KiB │   0 B 
──────────┼───────────┼───────────┼───────┼───────────┼───────────┼───────
    total │    14 MiB │    14 MiB │ -79 B │  42.8 MiB │  42.8 MiB │ +87 B 


         │          raw           │             unique             
         ├────────┬────────┬──────┼────────┬────────┬──────────────
 DEX     │ old    │ new    │ diff │ old    │ new    │ diff         
─────────┼────────┼────────┼──────┼────────┼────────┼──────────────
   files │      3 │      3 │    0 │        │        │              
 strings │ 183541 │ 183541 │    0 │ 168773 │ 168773 │  0 (+15 -15) 
   types │  32821 │  32821 │    0 │  30821 │  30821 │  0 (+1 -1)   
 classes │  28437 │  28437 │    0 │  28437 │  28437 │  0 (+1 -1)   
 methods │ 164864 │ 164865 │   +1 │ 159985 │ 159986 │ +1 (+9 -8)   
  fields │ 115694 │ 115694 │    0 │ 115074 │ 115074 │  0 (+1 -1)   


 ARSC    │ old  │ new  │ diff 
─────────┼──────┼──────┼──────
 configs │  295 │  295 │  0   
 entries │ 4370 │ 4370 │  0
APK
   compressed    │  uncompressed   │                                                       
─────────┬───────┼─────────┬───────┤                                                       
 size    │ diff  │ size    │ diff  │ path                                                  
─────────┼───────┼─────────┼───────┼───────────────────────────────────────────────────────
 2.8 MiB │ -88 B │ 7.8 MiB │ +72 B │ ∆ classes3.dex                                        
 5.5 KiB │ +15 B │ 5.3 KiB │ +15 B │ ∆ assets/dexopt/baseline.prof                         
   184 B │  -6 B │     6 B │   0 B │ ∆ META-INF/androidx.activity_activity-compose.version 
─────────┼───────┼─────────┼───────┼───────────────────────────────────────────────────────
 2.8 MiB │ -79 B │ 7.8 MiB │ +87 B │ (total)
DEX
STRINGS:

   old    │ new    │ diff        
  ────────┼────────┼─────────────
   168773 │ 168773 │ 0 (+15 -15) 
  
  + _r8_lambda_YxhQAJvf1D7ISoFgjHX-y5Ob-LE
  + _r8_lambda_wMCBfa25b2DOsEGhU4GN56c60BU
  + Lcom/stripe/android/view/CardInputWidget_initView_lambda-33__inlined_doAfterTextChanged_1;
  + SMAP
  CardInputWidget.kt
  Kotlin
  *S Kotlin
  *F
  + 1 CardInputWidget.kt
  com/stripe/android/view/CardInputWidget
  + 2 Delegates.kt
  kotlin/properties/Delegates
  + 3 fake.kt
  kotlin/jvm/internal/FakeKt
  + 4 _Collections.kt
  kotlin/collections/CollectionsKt___CollectionsKt
  + 5 View.kt
  androidx/core/view/ViewKt
  + 6 Context.kt
  androidx/core/content/ContextKt
  + 7 TextView.kt
  androidx/core/widget/TextViewKt
  *L
  1#1,1261:1
  33#2,3:1262
  33#2,3:1265
  33#2,3:1268
  1#3:1271
  764#4:1272
  855#4,2:1273
  1849#4,2:1275
  1849#4,2:1277
  1849#4,2:1279
  1741#4,3:1281
  1849#4,2:1284
  1849#4,2:1286
  1720#4,3:1288
  1849#4,2:1304
  1849#4:1306
  1850#4:1333
  1849#4,2:1343
  321#5,4:1291
  52#6,9:1295
  52#6,9:1334
  58#7,23:1307
  93#7,3:1330
  *S KotlinDebug
  *F
  + 1 CardInputWidget.kt
  com/stripe/android/view/CardInputWidget
  *L
  283#1:1262,3
  309#1:1265,3
  321#1:1268,3
  231#1:1272
  231#1:1273,2
  232#1:1275,2
  388#1:1277,2
  392#1:1279,2
  462#1:1281,3
  466#1:1284,2
  475#1:1286,2
  514#1:1288,3
  714#1:1304,2
  784#1:1306
  784#1:1333
  972#1:1343,2
  656#1:1291,4
  691#1:1295,9
  839#1:1334,9
  785#1:1307,23
  785#1:1330,3
  *E
  
  + SMAP
  CardInputWidget.kt
  Kotlin
  *S Kotlin
  *F
  + 1 CardInputWidget.kt
  com/stripe/android/view/CardInputWidget_CardNumberSlideEndAnimation
  + 2 View.kt
  androidx/core/view/ViewKt
  *L
  1#1,1261:1
  321#2,4:1262
  *S KotlinDebug
  *F
  + 1 CardInputWidget.kt
  com/stripe/android/view/CardInputWidget_CardNumberSlideEndAnimation
  *L
  1137#1:1262,4
  *E
  
  + SMAP
  CardInputWidget.kt
  Kotlin
  *S Kotlin
  *F
  + 1 CardInputWidget.kt
  com/stripe/android/view/CardInputWidget_CardNumberSlideStartAnimation
  + 2 View.kt
  androidx/core/view/ViewKt
  *L
  1#1,1261:1
  321#2,4:1262
  *S KotlinDebug
  *F
  + 1 CardInputWidget.kt
  com/stripe/android/view/CardInputWidget_CardNumberSlideStartAnimation
  *L
  1063#1:1262,4
  *E
  
  + SMAP
  CardInputWidget.kt
  Kotlin
  *S Kotlin
  *F
  + 1 CardInputWidget.kt
  com/stripe/android/view/CardInputWidget_CvcSlideEndAnimation
  + 2 View.kt
  androidx/core/view/ViewKt
  *L
  1#1,1261:1
  321#2,4:1262
  *S KotlinDebug
  *F
  + 1 CardInputWidget.kt
  com/stripe/android/view/CardInputWidget_CvcSlideEndAnimation
  *L
  1165#1:1262,4
  *E
  
  + SMAP
  CardInputWidget.kt
  Kotlin
  *S Kotlin
  *F
  + 1 CardInputWidget.kt
  com/stripe/android/view/CardInputWidget_CvcSlideStartAnimation
  + 2 View.kt
  androidx/core/view/ViewKt
  *L
  1#1,1261:1
  321#2,4:1262
  *S KotlinDebug
  *F
  + 1 CardInputWidget.kt
  com/stripe/android/view/CardInputWidget_CvcSlideStartAnimation
  *L
  1091#1:1262,4
  *E
  
  + SMAP
  CardInputWidget.kt
  Kotlin
  *S Kotlin
  *F
  + 1 CardInputWidget.kt
  com/stripe/android/view/CardInputWidget_ExpiryDateSlideEndAnimation
  + 2 View.kt
  androidx/core/view/ViewKt
  *L
  1#1,1261:1
  321#2,4:1262
  *S KotlinDebug
  *F
  + 1 CardInputWidget.kt
  com/stripe/android/view/CardInputWidget_ExpiryDateSlideEndAnimation
  *L
  1150#1:1262,4
  *E
  
  + SMAP
  CardInputWidget.kt
  Kotlin
  *S Kotlin
  *F
  + 1 CardInputWidget.kt
  com/stripe/android/view/CardInputWidget_ExpiryDateSlideStartAnimation
  + 2 View.kt
  androidx/core/view/ViewKt
  *L
  1#1,1261:1
  321#2,4:1262
  *S KotlinDebug
  *F
  + 1 CardInputWidget.kt
  com/stripe/android/view/CardInputWidget_ExpiryDateSlideStartAnimation
  *L
  1076#1:1262,4
  *E
  
  + SMAP
  CardInputWidget.kt
  Kotlin
  *S Kotlin
  *F
  + 1 CardInputWidget.kt
  com/stripe/android/view/CardInputWidget_PostalCodeSlideEndAnimation
  + 2 View.kt
  androidx/core/view/ViewKt
  *L
  1#1,1261:1
  321#2,4:1262
  *S KotlinDebug
  *F
  + 1 CardInputWidget.kt
  com/stripe/android/view/CardInputWidget_PostalCodeSlideEndAnimation
  *L
  1182#1:1262,4
  *E
  
  + SMAP
  CardInputWidget.kt
  Kotlin
  *S Kotlin
  *F
  + 1 CardInputWidget.kt
  com/stripe/android/view/CardInputWidget_PostalCodeSlideStartAnimation
  + 2 View.kt
  androidx/core/view/ViewKt
  *L
  1#1,1261:1
  321#2,4:1262
  *S KotlinDebug
  *F
  + 1 CardInputWidget.kt
  com/stripe/android/view/CardInputWidget_PostalCodeSlideStartAnimation
  *L
  1108#1:1262,4
  *E
  
  + SMAP
  TextView.kt
  Kotlin
  *S Kotlin
  *F
  +
...✂

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