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 amount and label to GooglePayLauncher and GooglePayConfiguration #7191

Merged
merged 9 commits into from
Sep 14, 2023

Conversation

tillh-stripe
Copy link
Collaborator

@tillh-stripe tillh-stripe commented Aug 23, 2023

Summary

This pull request adds support for providing a custom amount (for setup intents) and a custom label when opening the Google Pay bottom sheet.

For GooglePayLauncher, we add both properties to presentForSetupIntent() and the label property to presentForPaymentIntent().

For GooglePayPaymentMethodLauncher, we add the label property to present(), as the amount property already exists.

For PaymentSheet.GooglePayConfiguration, we add both properties to the constructor. We also remove one redundant constructor.

(cc @charliecruzan-stripe)

Motivation

MOBILE_APIREVIEW-53

Testing

  • Added tests
  • Modified tests
  • Manually verified

Screenshots

Before After
before screenshot after screenshot

Changelog

@tillh-stripe tillh-stripe force-pushed the tillh/google-pay-custom-amount-and-label branch from 093da55 to 77255c4 Compare August 23, 2023 14:13
@github-actions
Copy link
Contributor

github-actions bot commented Aug 23, 2023

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.5 MiB │   3.5 MiB │ +72 B │   7.7 MiB │   7.7 MiB │ +916 B 
     arsc │   2.2 MiB │   2.2 MiB │   0 B │   2.2 MiB │   2.2 MiB │    0 B 
 manifest │   4.9 KiB │   4.9 KiB │   0 B │  24.2 KiB │  24.2 KiB │    0 B 
      res │ 884.7 KiB │ 884.7 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 │     3 MiB │     3 MiB │  +4 B │     3 MiB │     3 MiB │   +4 B 
    other │ 200.1 KiB │ 200.1 KiB │ -17 B │ 448.2 KiB │ 448.2 KiB │    0 B 
──────────┼───────────┼───────────┼───────┼───────────┼───────────┼────────
    total │  12.3 MiB │  12.3 MiB │ +59 B │  20.7 MiB │  20.7 MiB │ +920 B 

 DEX     │ old   │ new   │ diff       
─────────┼───────┼───────┼────────────
   files │     1 │     1 │  0         
 strings │ 38333 │ 38333 │  0 (+1 -1) 
   types │ 12692 │ 12692 │  0 (+0 -0) 
 classes │ 10716 │ 10716 │  0 (+0 -0) 
 methods │ 55936 │ 55936 │  0 (+8 -8) 
  fields │ 35250 │ 35256 │ +6 (+7 -1) 

 ARSC    │ old  │ new  │ diff 
─────────┼──────┼──────┼──────
 configs │  290 │  290 │  0   
 entries │ 6947 │ 6947 │  0
APK
    compressed    │    uncompressed    │                               
──────────┬───────┼───────────┬────────┤                               
 size     │ diff  │ size      │ diff   │ path                          
──────────┼───────┼───────────┼────────┼───────────────────────────────
  3.5 MiB │ +72 B │   7.7 MiB │ +916 B │ ∆ classes.dex                 
   63 KiB │ -11 B │ 141.6 KiB │    0 B │ ∆ META-INF/CERT.SF            
 48.5 KiB │  -7 B │ 141.5 KiB │    0 B │ ∆ META-INF/MANIFEST.MF        
  5.1 KiB │  +4 B │     5 KiB │   +4 B │ ∆ assets/dexopt/baseline.prof 
  1.2 KiB │  +1 B │   1.2 KiB │    0 B │ ∆ META-INF/CERT.RSA           
──────────┼───────┼───────────┼────────┼───────────────────────────────
  3.6 MiB │ +59 B │     8 MiB │ +920 B │ (total)
DEX
STRINGS:

   old   │ new   │ diff      
  ───────┼───────┼───────────
   38333 │ 38333 │ 0 (+1 -1) 
  + ~~R8{backend:dex,compilation-mode:release,has-checksums:false,min-api:21,pg-map-id:7099102,r8-mode:full,version:8.1.65}
  
  - ~~R8{backend:dex,compilation-mode:release,has-checksums:false,min-api:21,pg-map-id:2a28311,r8-mode:full,version:8.1.65}
  

METHODS:

   old   │ new   │ diff      
  ───────┼───────┼───────────
   55936 │ 55936 │ 0 (+8 -8) 
  + dd.b <init>(long, String, String, String)
  + jc.e0 a(long, String, String, String)
  + jc.i0 <init>(x, String, long, String, String, h0)
  + jc.n <init>(String, e, String)
  + jc.o <init>(String, e, String, Long, String)
  + jc.u d(g5, String, Long, String) → p
  + pd.c2 <init>(int, String, String, Long, String)
  + pd.c2 <init>(String, int)
  
  - dd.b <init>(String, String, String, long)
  - jc.e0 a(String, long, String)
  - jc.i0 <init>(x, String, long, String, h0)
  - jc.n <init>(String, e)
  - jc.o <init>(String, e, String)
  - jc.u d(g5, String) → p
  - pd.c2 <init>()
  - pd.c2 <init>(int, String, String)
  

FIELDS:

   old   │ new   │ diff       
  ───────┼───────┼────────────
   35250 │ 35256 │ +6 (+7 -1) 
  + jc.i0 M: String
  + jc.i0 N: h0
  + jc.n K: String
  + jc.o L: Long
  + jc.o M: String
  + pd.c2 L: Long
  + pd.c2 M: String
  
  - jc.i0 M: h0

@tillh-stripe tillh-stripe force-pushed the tillh/google-pay-custom-amount-and-label branch 2 times, most recently from c143196 to eb07b4a Compare August 29, 2023 00:54
@tillh-stripe tillh-stripe changed the title Add amount and amountLabel to GooglePayLauncher for SI Add amount and label to GooglePayLauncher and GooglePayConfiguration Aug 29, 2023
@tillh-stripe tillh-stripe force-pushed the tillh/google-pay-custom-amount-and-label branch 4 times, most recently from f315259 to 4e7e30b Compare September 8, 2023 15:11
@tillh-stripe tillh-stripe force-pushed the tillh/google-pay-custom-amount-and-label branch from 4e7e30b to f29ee2a Compare September 13, 2023 20:04
@tillh-stripe tillh-stripe marked this pull request as ready for review September 13, 2023 20:04
@tillh-stripe tillh-stripe requested review from a team as code owners September 13, 2023 20:04
CHANGELOG.md Outdated Show resolved Hide resolved
@tillh-stripe tillh-stripe force-pushed the tillh/google-pay-custom-amount-and-label branch 2 times, most recently from 151b078 to 7a2ca50 Compare September 13, 2023 20:18
@tillh-stripe tillh-stripe force-pushed the tillh/google-pay-custom-amount-and-label branch from 7a2ca50 to 34771dd Compare September 13, 2023 20:20
@tillh-stripe tillh-stripe merged commit 90eafb5 into master Sep 14, 2023
9 checks passed
@tillh-stripe tillh-stripe deleted the tillh/google-pay-custom-amount-and-label branch September 14, 2023 17:32
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.

3 participants