stripe-android icon indicating copy to clipboard operation
stripe-android copied to clipboard

Correctly filter out saved PMs that we do not display

Open amk-stripe opened this issue 1 year ago • 1 comments

Summary

Filter out saved payment methods that we don't display in the view model, rather than at the UI layer

Motivation

The current behavior introduces a few bugs if the user has saved link PMs but no other saved PMs, specifically:

  • you can remove the last PM even if allowsRemovalOfLastSavedPM is false
  • the select your payment method screen will be displayed with no saved payment method tabs

Testing

  • [ ] Added tests
  • [ ] Modified tests
  • [X] Manually verified

Screen recordings

Before:

https://github.com/stripe/stripe-android/assets/160939932/597be1b8-12e1-4dd8-b565-8cc995bff20c

After:

https://github.com/stripe/stripe-android/assets/160939932/e75b40d8-b728-443a-815a-3d89dac5c2a3

Changelog

  • [FIXED] Issue where "Select your payment method" screen would be displayed with no saved payment methods to select

amk-stripe avatar May 29 '24 19:05 amk-stripe

Diffuse output:

OLD: identity-example-release-base.apk (signature: V1, V2)
NEW: identity-example-release-pr.apk (signature: V1, V2)

          │          compressed          │         uncompressed         
          ├───────────┬───────────┬──────┼───────────┬───────────┬──────
 APK      │ old       │ new       │ diff │ old       │ new       │ diff 
──────────┼───────────┼───────────┼──────┼───────────┼───────────┼──────
      dex │     2 MiB │     2 MiB │  0 B │   4.3 MiB │   4.3 MiB │  0 B 
     arsc │     1 MiB │     1 MiB │  0 B │     1 MiB │     1 MiB │  0 B 
 manifest │   2.3 KiB │   2.3 KiB │  0 B │   8.1 KiB │   8.1 KiB │  0 B 
      res │ 301.5 KiB │ 301.5 KiB │  0 B │   455 KiB │   455 KiB │  0 B 
   native │   7.3 MiB │   7.3 MiB │  0 B │  18.4 MiB │  18.4 MiB │  0 B 
    asset │   1.5 MiB │   1.5 MiB │  0 B │   1.5 MiB │   1.5 MiB │  0 B 
    other │    87 KiB │    87 KiB │ -5 B │ 161.5 KiB │ 161.5 KiB │  0 B 
──────────┼───────────┼───────────┼──────┼───────────┼───────────┼──────
    total │  12.2 MiB │  12.2 MiB │ -5 B │  25.8 MiB │  25.8 MiB │  0 B 

 DEX     │ old   │ new   │ diff      
─────────┼───────┼───────┼───────────
   files │     1 │     1 │ 0         
 strings │ 21688 │ 21688 │ 0 (+0 -0) 
   types │  6869 │  6869 │ 0 (+0 -0) 
 classes │  5634 │  5634 │ 0 (+0 -0) 
 methods │ 31448 │ 31448 │ 0 (+0 -0) 
  fields │ 18315 │ 18315 │ 0 (+0 -0) 

 ARSC    │ old  │ new  │ diff 
─────────┼──────┼──────┼──────
 configs │  164 │  164 │  0   
 entries │ 3404 │ 3404 │  0
APK
   compressed    │   uncompressed   │                        
──────────┬──────┼───────────┬──────┤                        
 size     │ diff │ size      │ diff │ path                   
──────────┼──────┼───────────┼──────┼────────────────────────
 25.9 KiB │ -4 B │  63.9 KiB │  0 B │ ∆ META-INF/MANIFEST.MF 
 29.1 KiB │ -1 B │    64 KiB │  0 B │ ∆ META-INF/CERT.SF     
──────────┼──────┼───────────┼──────┼────────────────────────
 54.9 KiB │ -5 B │ 127.9 KiB │  0 B │ (total)

github-actions[bot] avatar May 29 '24 19:05 github-actions[bot]