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

[MOBILESDK-2681] [MOBILESDK-2682] Default Payment Method Label #9824

Closed
wants to merge 10 commits into from

Conversation

tianzhao-stripe
Copy link
Contributor

@tianzhao-stripe tianzhao-stripe commented Dec 23, 2024

Summary

Added feature flag for default payment method
Added Default Payment Method Label

This will be added to
SavedPaymentMethodTab
PaymentMethodRowButton.RowInnerContent

to show is a payment method is default

Motivation

https://jira.corp.stripe.com/browse/MOBILESDK-2681
https://jira.corp.stripe.com/browse/MOBILESDK-2682

Testing

  • Added tests
  • Modified tests
  • Manually verified

Screenshots

image
image

Changelog

N.A.

Copy link
Contributor

github-actions bot commented Dec 23, 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.9 MiB │   3.9 MiB │ -174 B │  8.6 MiB │  8.6 MiB │ +12 B 
     arsc │   2.2 MiB │   2.2 MiB │    0 B │  2.2 MiB │  2.2 MiB │   0 B 
 manifest │     5 KiB │     5 KiB │    0 B │ 24.9 KiB │ 24.9 KiB │   0 B 
      res │ 906.3 KiB │ 906.3 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 │   +2 B │  1.6 MiB │  1.6 MiB │  +2 B 
    other │   1.4 MiB │   1.4 MiB │   -5 B │  1.6 MiB │  1.6 MiB │   0 B 
──────────┼───────────┼───────────┼────────┼──────────┼──────────┼───────
    total │  12.6 MiB │  12.6 MiB │ -177 B │ 21.5 MiB │ 21.5 MiB │ +14 B 

 DEX     │ old   │ new   │ diff       
─────────┼───────┼───────┼────────────
   files │     1 │     1 │  0         
 strings │ 40595 │ 40595 │  0 (+2 -2) 
   types │ 14008 │ 14008 │  0 (+0 -0) 
 classes │ 11682 │ 11682 │  0 (+0 -0) 
 methods │ 59616 │ 59616 │  0 (+0 -0) 
  fields │ 39806 │ 39807 │ +1 (+1 -0) 

 ARSC    │ old  │ new  │ diff 
─────────┼──────┼──────┼──────
 configs │  243 │  243 │  0   
 entries │ 6207 │ 6207 │  0
APK
    compressed     │   uncompressed    │                               
──────────┬────────┼───────────┬───────┤                               
 size     │ diff   │ size      │ diff  │ path                          
──────────┼────────┼───────────┼───────┼───────────────────────────────
  3.9 MiB │ -174 B │   8.6 MiB │ +12 B │ ∆ classes.dex                 
 50.1 KiB │   -4 B │ 118.3 KiB │   0 B │ ∆ META-INF/MANIFEST.MF        
  6.4 KiB │   +2 B │   6.3 KiB │  +2 B │ ∆ assets/dexopt/baseline.prof 
  1.2 KiB │   -1 B │   1.2 KiB │   0 B │ ∆ META-INF/CERT.RSA           
──────────┼────────┼───────────┼───────┼───────────────────────────────
    4 MiB │ -177 B │   8.7 MiB │ +14 B │ (total)
DEX
STRINGS:

   old   │ new   │ diff      
  ───────┼───────┼───────────
   40595 │ 40595 │ 0 (+2 -2) 
  
  + Default Payment Method
  + ~~R8{"backend":"dex","compilation-mode":"release","has-checksums":false,"min-api":21,"pg-map-id":"49fdae1","r8-mode":"full","version":"8.7.14"}
  
  - default_payment_method
  - ~~R8{"backend":"dex","compilation-mode":"release","has-checksums":false,"min-api":21,"pg-map-id":"455f645","r8-mode":"full","version":"8.7.14"}
  

FIELDS:

   old   │ new   │ diff       
  ───────┼───────┼────────────
   39806 │ 39807 │ +1 (+1 -0) 
  
  + i5.d d: t

Copy link
Collaborator

@amk-stripe amk-stripe left a comment

Choose a reason for hiding this comment

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

The new label UI here LGTM!

Can we update this PR to just make one conceptual change? In this case, I think that should be adding the new payment method label.

The new feature flag and one usage of it is kind of orthogonal to the creation of the new label (since the label isn't being used yet), so I don't think those changes belong in this PR.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think we need this test -- this doesn't seem to be testing anything custom about our code. We can use UI tests in later PRs to verify that the label is shown when we expect (in the actual horizontal and vertical UIs)

Copy link
Collaborator

Choose a reason for hiding this comment

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

In another comment, I suggested that we move this code to another PR, so this shouldn't affect this PR, but for the future -- I think we should read the feature flag outside of the JSON parser. Currently, this parser is only responsible for parsing, not for any logic. We should determine whether we want to read the defaultPaymentMethod value elsewhere in the code, not directly within the parser

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants