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

Enable BDCC for cards #6415

Merged
merged 19 commits into from
Mar 29, 2023
Merged

Enable BDCC for cards #6415

merged 19 commits into from
Mar 29, 2023

Conversation

eurias-stripe
Copy link
Contributor

@eurias-stripe eurias-stripe commented Mar 22, 2023

Summary

Enabling Billing Details Collection Configuration for cards.

Motivation

https://docs.google.com/document/d/1eBKVqbdhky_b8ux5f_eKp1HdHxgbV1WdF_XQWp0kdk0/edit#

Testing

  • Added tests
  • Modified tests
  • Manually verified

Screenshots

Screenshot_20230323_131010
Screenshot_20230323_131006

@github-actions
Copy link
Contributor

github-actions bot commented Mar 22, 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.3 MiB │   3.3 MiB │    +4 KiB │   7.1 MiB │   7.2 MiB │ +13.3 KiB 
     arsc │   2.1 MiB │   2.2 MiB │  +7.1 KiB │   2.1 MiB │   2.2 MiB │  +7.1 KiB 
 manifest │   4.4 KiB │   4.4 KiB │      +3 B │  21.1 KiB │  21.1 KiB │       0 B 
      res │     1 MiB │     1 MiB │    +722 B │   1.8 MiB │   1.8 MiB │  +9.1 KiB 
   native │   2.6 MiB │   2.6 MiB │       0 B │     6 MiB │     6 MiB │       0 B 
    asset │     3 MiB │     3 MiB │  +1.3 KiB │     3 MiB │     3 MiB │  +1.3 KiB 
    other │ 200.2 KiB │ 200.2 KiB │     +15 B │ 454.1 KiB │ 454.1 KiB │       0 B 
──────────┼───────────┼───────────┼───────────┼───────────┼───────────┼───────────
    total │  12.2 MiB │  12.2 MiB │ +13.1 KiB │  20.5 MiB │  20.5 MiB │ +30.7 KiB 

 DEX     │ old   │ new   │ diff              
─────────┼───────┼───────┼───────────────────
   files │     1 │     1 │   0               
 strings │ 35302 │ 35356 │ +54 (+71 -17)     
   types │ 11561 │ 11579 │ +18 (+28 -10)     
 classes │  9698 │  9714 │ +16 (+18 -2)      
 methods │ 51920 │ 51989 │ +69 (+1221 -1152) 
  fields │ 32792 │ 32863 │ +71 (+652 -581)   

 ARSC    │ old  │ new  │ diff         
─────────┼──────┼──────┼──────────────
 configs │  333 │  333 │   0          
 entries │ 6871 │ 6906 │ +35 (+35 -0)
APK
      compressed      │     uncompressed      │                                
──────────┬───────────┼───────────┬───────────┤                                
 size     │ diff      │ size      │ diff      │ path                           
──────────┼───────────┼───────────┼───────────┼────────────────────────────────
  2.2 MiB │  +7.1 KiB │   2.2 MiB │  +7.1 KiB │ ∆ resources.arsc               
  3.3 MiB │    +4 KiB │   7.2 MiB │ +13.3 KiB │ ∆ classes.dex                  
  6.3 KiB │  +1.2 KiB │   6.2 KiB │  +1.2 KiB │ ∆ assets/dexopt/baseline.prof  
  3.1 KiB │    +353 B │  21.1 KiB │  +4.5 KiB │ ∆ res/dn.xml                   
  3.2 KiB │    +352 B │  21.4 KiB │  +4.5 KiB │ ∆ res/s0.xml                   
 65.4 KiB │     +10 B │ 146.7 KiB │       0 B │ ∆ META-INF/CERT.SF             
 50.5 KiB │      +9 B │ 146.6 KiB │       0 B │ ∆ META-INF/MANIFEST.MF         
    741 B │      +5 B │     609 B │      +5 B │ ∆ assets/dexopt/baseline.profm 
    566 B │      -4 B │   1.5 KiB │       0 B │ ∆ res/DV.xml                   
  1.2 KiB │      -4 B │   3.4 KiB │       0 B │ ∆ res/e1.xml                   
    618 B │      -4 B │   1.2 KiB │       0 B │ ∆ res/jH.xml                   
    805 B │      +4 B │   1.7 KiB │       0 B │ ∆ res/wf.xml                   
  1.2 KiB │      -4 B │   1.2 KiB │       0 B │ ∆ META-INF/CERT.RSA            
  4.4 KiB │      +3 B │  21.1 KiB │       0 B │ ∆ AndroidManifest.xml          
    429 B │      +3 B │     736 B │       0 B │ ∆ res/1J.xml                   
    950 B │      +3 B │   2.5 KiB │       0 B │ ∆ res/5d.xml                   
    997 B │      -3 B │   2.8 KiB │       0 B │ ∆ res/AE.xml                   
    886 B │      -3 B │   2.4 KiB │       0 B │ ∆ res/C7.xml                   
    738 B │      -3 B │   1.5 KiB │       0 B │ ∆ res/Ig.xml                   
    753 B │      +3 B │   1.5 KiB │       0 B │ ∆ res/M6.xml                   
    698 B │      -3 B │   2.7 KiB │       0 B │ ∆ res/R0.xml                   
    827 B │      -3 B │   2.4 KiB │       0 B │ ∆ res/dI.xml                   
    643 B │      -3 B │   1.3 KiB │       0 B │ ∆ res/fL.xml                   
    477 B │      +3 B │     904 B │       0 B │ ∆ res/th.xml                   
    502 B │      -3 B │     956 B │       0 B │ ∆ res/va.xml                   
    382 B │      +2 B │     556 B │       0 B │ ∆ res/1g.xml                   
    615 B │      -2 B │   1.2 KiB │       0 B │ ∆ res/38.xml                   
    380 B │      +2 B │     724 B │       0 B │ ∆ res/3n.xml                   
    759 B │      -2 B │   1.7 KiB │       0 B │ ∆ res/4L.xml                   
    490 B │      +2 B │     892 B │       0 B │ ∆ res/50.xml                   
    808 B │      -2 B │   1.8 KiB │       0 B │ ∆ res/75.xml                   
    350 B │      +2 B │     496 B │       0 B │ ∆ res/7F.xml                   
    870 B │      -2 B │   2.4 KiB │       0 B │ ∆ res/AK.xml                   
    353 B │      +2 B │     524 B │       0 B │ ∆ res/Ah.xml                   
    638 B │      -2 B │   1.2 KiB │       0 B │ ∆ res/Am.xml                   
    407 B │      +2 B │     592 B │       0 B │ ∆ res/DC.xml                   
    618 B │      +2 B │   1.1 KiB │       0 B │ ∆ res/EF.xml                   
    716 B │      -2 B │   1.5 KiB │       0 B │ ∆ res/Ey.xml                   
    596 B │      +2 B │   1.1 KiB │       0 B │ ∆ res/Gh.xml                   
    567 B │      -2 B │   1.2 KiB │       0 B │ ∆ res/LN.xml                   
    358 B │      -2 B │     440 B │       0 B │ ∆ res/SH.xml                   
    535 B │      -2 B │     984 B │       0 B │ ∆ res/WT.xml                   
    902 B │      -2 B │     2 KiB │       0 B │ ∆ res/XS.xml                   
    596 B │      +2 B │   1.1 KiB │       0 B │ ∆ res/_n.xml                   
    438 B │      -2 B │     816 B │       0 B │ ∆ res/dV.xml                   
    656 B │      +2 B │   1.5 KiB │       0 B │ ∆ res/em.xml                   
    535 B │      +2 B │   1.3 KiB │       0 B │ ∆ res/hE1.xml                  
    620 B │      +2 B │   1.1 KiB │       0 B │ ∆ res/ib1.xml                  
    415 B │      -2 B │     624 B │       0 B │ ∆ res/iw.xml                   
    443 B │      +2 B │     752 B │       0 B │ ∆ res/lQ.xml                   
    440 B │      +2 B │     708 B │       0 B │ ∆ res/pq.xml                   
  1.3 KiB │      +2 B │   4.5 KiB │       0 B │ ∆ res/q6.xml                   
    380 B │      +2 
...✂
DEX
STRINGS:

   old   │ new   │ diff          
  ───────┼───────┼───────────────
   35302 │ 35356 │ +54 (+71 -17) 
  + , attachDefaults=
  + , attachDefaultsToPaymentMethod=
  + , billingDetailsCollectionConfiguration=
  + , collectAddress=
  + , collectEmail=
  + , collectName=
  + , collectPhone=
  + , collectionMode=
  + Always
  + AttachDefaults
  + BillingDetailsCollectionConfiguration(name=
  + CollectAddress
  + CollectEmail
  + CollectName
  + CollectPhone
  + ContactInformationSpec(collectName=
  + Lse/o;
  + Lse/p;
  + Lue/a6;
  + Lue/b6;
  + Lue/c6;
  + Lue/d6;
  + Lue/e6;
  + Lue/f6;
  + Lue/g6;
  + Lue/h6;
  + Lue/i6;
  + Lue/j6;
  + Lue/k6;
  + Lue/l6;
  + Lue/m6;
  + Lue/z5;
  + Lx2/p;
  + Lzb/e5;
  + Never
  + No enum constant com.stripe.android.ui.core.BillingDetailsCollectionConfiguration.CollectionMode.
  + PhoneSpec(apiPath=
  + T2
  + VIIILZ
  + VIZZZL
  + VLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL
  + VLLLLLLLLLLZZZZZZ
  + VLLLLLLZZLLL
  + VLLLZZLLLLZZZZLLLLL
  + VLZZLLLLLL
  + [Lhf/a1;
  + [Lhf/h1;
  + [Lhf/l1;
  + [Lse/b;
  + [Lse/c;
  + [Lue/g6;
  + [Lue/p2;
  + [Lue/p3;
  + [Lzb/b5;
  + [Lzb/e5;
  + attachDefaults
  + auto
  + billingDetailsCollectionConfiguration
  + collectAddress
  + collectEmail
  + collectName
  + collectPhone
  + collect_email
  + collect_name
  + collect_phone
  + collectionMode
  + collection_mode
  + com.stripe.android.ui.core.BillingDetailsCollectionConfiguration.AddressCollectionMode
  + com.stripe.android.ui.core.elements.ContactInformationSpec
  + com.stripe.android.ui.core.elements.PhoneSpec
  + ~~R8{backend:dex,compilation-mode:release,has-checksums:false,min-api:21,pg-map-id:68abd07,r8-mode:full,version:4.0.52}
  
  - Lx9/d0;
  - Lzd/n1;
  - VLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL
  - VLLLLLLZZLL
  - VLLLLLLZZZZZ
  - VLLLLZZLLI
  - VLLLZZLLLLZZZL
  - VLZZLLLLL
  - [Lhf/g1;
  - [Lhf/k1;
  - [Lhf/z0;
  - [Lue/e2;
  - [Lue/s5;
  - [Lue/t2;
  - [Lzb/a5;
  - [Lzb/c5;
  - ~~R8{backend:dex,compilation-mode:release,has-checksums:false,min-api:21,pg-map-id:e2b2f19,r8-mode:full,version:4.0.52}
  

TYPES:

   old   │ new   │ diff          
  ───────┼───────┼───────────────
   11561 │ 11579 │ +18 (+28 -10) 
  + Lse/o;
  + Lse/p;
  + Lue/a6;
  + Lue/b6;
  + Lue/c6;
  + Lue/d6;
  + Lue/e6;
  + Lue/f6;
  + Lue/g6;
  + Lue/h6;
  + Lue/i6;
  + Lue/j6;
  + Lue/k6;
  + Lue/l6;
  + Lue/m6;
  + Lue/z5;
  + Lx2/p;
  + Lzb/e5;
  + [Lhf/a1;
  + [Lhf/h1;
  + [Lhf/l1;
  + [Lse/b;
  + [Lse/c;
  + [Lue/g6;
  + [Lue/p2;
  + [Lue/p3;
  + [Lzb/b5;
  + [Lzb/e5;
  
  - Lx9/d0;
  - Lzd/n1;
  - [Lhf/g1;
  - [Lhf/k1;
  - [Lhf/z0;
  - [Lue/e2;
  - [Lue/s5;
  - [Lue/t2;
  - [Lzb/a5;
  - [Lzb/c5;
  

METHODS:

   old   │ new   │ diff              
  ───────┼───────┼───────────────────
   51920 │ 51989 │ +69 (+1221 -1152) 
  + a0.a A(e, int) → a
  + a0.a B(String, String, String, String) → e
  + a0.a C(Class, String, String, int, x) → m
  + a0.a D(int, c, z1, h, w, int)
  + a0.a E(Object)
  + a0.a F(c, String, e2, String, a0, String)
  + a0.a G(b)
  + a0.a L(int) → String
  + a0.a M(String) → int
  + a0.a z(String, String, String, String, String) → StringBuilder
  + a8.c F1() → int
  + cf.e1 <init>(g, d)
  + cf.e2 <init>(g, d)
  + cf.e <init>(g, d)
  + cf.f1 <init>(g, d)
  + cf.f2 <init>(g, d)
  + cf.s0 <init>()
  + com.stripe.android.paymentsheet.example.playground.activity.PaymentSheetPlaygroundActivity o() → int
  + com.stripe.android.paymentsheet.example.playground.activity.PaymentSheetPlaygroundActivity p() → int
  + com.stripe.android.paymentsheet.example.playground.activity.PaymentSheetPlaygroundActivity q() → int
  + com.stripe.android.paymentsheet.example.playground.activity.PaymentSheetPlaygroundActivity r() → a
  + com.stripe.android.paymentsheet.example.playground.activity.PaymentSheetPlaygroundActivity s() → k1
  + com.stripe.android.paymentsheet.example.playground.activity.PaymentSheetPlaygroundActivity t() → b
  + com.stripe.android.paymentsheet.example.playground.activity.PaymentSheetPlaygroundActivity u() → int
  + com.stripe.android.paymentsheet.example.playground.activity.PaymentSheetPlaygroundActivity v() → b
  + com.stripe.android.paymentsheet.example.playground.activity.PaymentSheetPlaygroundActivity w() → f
  + com.stripe.android.paymentsheet.example.playground.activity.PaymentSheetPlaygroundActivity x() → g1
  + com.stripe.android.paymentsheet.example.playground.activity.PaymentSheetPlaygroundActivity y(g)
  + com.stripe.andro
...✂
ARSC
ENTRIES:

   old  │ new  │ diff         
  ──────┼──────┼──────────────
   6871 │ 6906 │ +35 (+35 -0) 
  + id/attach_defaults
  + id/attach_defaults_off_button
  + id/attach_defaults_on_button
  + id/attach_defaults_radio_group
  + id/collect_address
  + id/collect_address_radio_auto
  + id/collect_address_radio_full
  + id/collect_address_radio_group
  + id/collect_address_radio_never
  + id/collect_email
  + id/collect_email_radio_always
  + id/collect_email_radio_auto
  + id/collect_email_radio_group
  + id/collect_email_radio_never
  + id/collect_name
  + id/collect_name_radio_always
  + id/collect_name_radio_auto
  + id/collect_name_radio_group
  + id/collect_name_radio_never
  + id/collect_phone
  + id/collect_phone_radio_always
  + id/collect_phone_radio_auto
  + id/collect_phone_radio_group
  + id/collect_phone_radio_never
  + string/always
  + string/attach_default_billing_address
  + string/auto
  + string/collect_address
  + string/collect_email
  + string/collect_name
  + string/collect_phone
  + string/contact_information
  + string/full
  + string/name_on_card
  + string/never

Copy link
Contributor

@jameswoo-stripe jameswoo-stripe left a comment

Choose a reason for hiding this comment

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

Mostly looks good, there are a few minor things. We should be adding some tests for this work as well. We should probably add some tests to TransformSpecToElementsTest, LpmRepositoryTest, and add a UI test in TestHardCodedLpms (or equivalent).

@eurias-stripe
Copy link
Contributor Author

Mostly looks good, there are a few minor things. We should be adding some tests for this work as well. We should probably add some tests to TransformSpecToElementsTest, LpmRepositoryTest, and add a UI test in TestHardCodedLpms (or equivalent).

I will be for sure adding tests, I wanted to get eyes on this before working on adding tests in case I needed to change the approach.

@eurias-stripe eurias-stripe marked this pull request as ready for review March 23, 2023 20:10
@eurias-stripe eurias-stripe requested review from a team as code owners March 23, 2023 20:10
Copy link
Collaborator

@tillh-stripe tillh-stripe left a comment

Choose a reason for hiding this comment

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

Added a few comments, but overall the approach seems right to me.

Also, we should look into redesigning our playground. It gets busier and busier 😅

@eurias-stripe eurias-stripe enabled auto-merge (squash) March 29, 2023 21:15
@@ -282,8 +283,8 @@ public final class com/stripe/android/paymentsheet/PaymentSheet$Configuration :
public final fun component7 ()Z
public final fun component8 ()Z
public final fun component9 ()Lcom/stripe/android/paymentsheet/PaymentSheet$Appearance;
public final fun copy (Ljava/lang/String;Lcom/stripe/android/paymentsheet/PaymentSheet$CustomerConfiguration;Lcom/stripe/android/paymentsheet/PaymentSheet$GooglePayConfiguration;Landroid/content/res/ColorStateList;Lcom/stripe/android/paymentsheet/PaymentSheet$BillingDetails;Lcom/stripe/android/paymentsheet/addresselement/AddressDetails;ZZLcom/stripe/android/paymentsheet/PaymentSheet$Appearance;Ljava/lang/String;)Lcom/stripe/android/paymentsheet/PaymentSheet$Configuration;
public static synthetic fun copy$default (Lcom/stripe/android/paymentsheet/PaymentSheet$Configuration;Ljava/lang/String;Lcom/stripe/android/paymentsheet/PaymentSheet$CustomerConfiguration;Lcom/stripe/android/paymentsheet/PaymentSheet$GooglePayConfiguration;Landroid/content/res/ColorStateList;Lcom/stripe/android/paymentsheet/PaymentSheet$BillingDetails;Lcom/stripe/android/paymentsheet/addresselement/AddressDetails;ZZLcom/stripe/android/paymentsheet/PaymentSheet$Appearance;Ljava/lang/String;ILjava/lang/Object;)Lcom/stripe/android/paymentsheet/PaymentSheet$Configuration;
public final fun copy (Ljava/lang/String;Lcom/stripe/android/paymentsheet/PaymentSheet$CustomerConfiguration;Lcom/stripe/android/paymentsheet/PaymentSheet$GooglePayConfiguration;Landroid/content/res/ColorStateList;Lcom/stripe/android/paymentsheet/PaymentSheet$BillingDetails;Lcom/stripe/android/paymentsheet/addresselement/AddressDetails;ZZLcom/stripe/android/paymentsheet/PaymentSheet$Appearance;Ljava/lang/String;Lcom/stripe/android/ui/core/BillingDetailsCollectionConfiguration;)Lcom/stripe/android/paymentsheet/PaymentSheet$Configuration;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Very unfortunate that we’re using data classes for this. I’ll investigate a way to mediate this before our next release.

@eurias-stripe eurias-stripe merged commit 46ffd60 into master Mar 29, 2023
@eurias-stripe eurias-stripe deleted the eurias/billing-configuration branch March 29, 2023 21:17
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