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

Pass billing details in ElementsSessionContext #9446

Merged
merged 3 commits into from
Oct 28, 2024

Conversation

tillh-stripe
Copy link
Collaborator

@tillh-stripe tillh-stripe commented Oct 15, 2024

Summary

This pull request adds the billing address to the ElementsSessionContext, allowing us to pass it along when creating the PaymentMethod in either the web or native view.

Motivation

BANKCON-15709

Testing

  • Added tests
  • Modified tests
  • Manually verified

Screenshots

Before After
before screenshot after screenshot

Changelog

Copy link
Contributor

github-actions bot commented Oct 15, 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 │     4 MiB │     4 MiB │ +3 KiB │ 8.7 MiB │ 8.7 MiB │ +4 KiB 
     arsc │   2.3 MiB │   2.3 MiB │    0 B │ 2.3 MiB │ 2.3 MiB │    0 B 
 manifest │     5 KiB │     5 KiB │    0 B │  25 KiB │  25 KiB │    0 B 
      res │ 932.6 KiB │ 932.6 KiB │    0 B │ 1.5 MiB │ 1.5 MiB │    0 B 
   native │   2.6 MiB │   2.6 MiB │    0 B │   6 MiB │   6 MiB │    0 B 
    asset │   2.9 MiB │   2.9 MiB │  -17 B │ 2.9 MiB │ 2.9 MiB │  -17 B 
    other │ 201.2 KiB │ 201.2 KiB │   +4 B │ 443 KiB │ 443 KiB │    0 B 
──────────┼───────────┼───────────┼────────┼─────────┼─────────┼────────
    total │    13 MiB │    13 MiB │ +3 KiB │  22 MiB │  22 MiB │ +4 KiB 

 DEX     │ old   │ new   │ diff            
─────────┼───────┼───────┼─────────────────
   files │     1 │     1 │   0             
 strings │ 42085 │ 42099 │ +14 (+47 -33)   
   types │ 14321 │ 14326 │  +5 (+37 -32)   
 classes │ 11932 │ 11935 │  +3 (+7 -4)     
 methods │ 61585 │ 61602 │ +17 (+827 -810) 
  fields │ 40315 │ 40332 │ +17 (+704 -687) 

 ARSC    │ old  │ new  │ diff 
─────────┼──────┼──────┼──────
 configs │  242 │  242 │  0   
 entries │ 6271 │ 6271 │  0
APK
    compressed     │    uncompressed    │                                           
──────────┬────────┼───────────┬────────┤                                           
 size     │ diff   │ size      │ diff   │ path                                      
──────────┼────────┼───────────┼────────┼───────────────────────────────────────────
    4 MiB │ +3 KiB │   8.7 MiB │ +4 KiB │ ∆ classes.dex                             
  8.5 KiB │  -17 B │   8.4 KiB │  -17 B │ ∆ assets/dexopt/baseline.prof             
 50.4 KiB │   +3 B │ 118.9 KiB │    0 B │ ∆ META-INF/MANIFEST.MF                    
    272 B │   +1 B │     120 B │    0 B │ ∆ META-INF/version-control-info.textproto 
──────────┼────────┼───────────┼────────┼───────────────────────────────────────────
    4 MiB │ +3 KiB │   8.8 MiB │ +4 KiB │ (total)
DEX
STRINGS:

   old   │ new   │ diff          
  ───────┼───────┼───────────────
   42085 │ 42099 │ +14 (+47 -33) 
  
  + , billingAddress=
  + , billingEmailAddress=
  + , city=
  + Address(line1=
  + BillingDetails(name=
  + LN5/L;
  + LN5/M;
  + Lk7/g;
  + Lo6/F;
  + Lr6/o;
  + Lu7/C;
  + Lz6/M;
  + [LN5/e;
  + [LN5/h;
  + [LN5/p;
  + [LN5/u;
  + [LN5/x;
  + [La5/g;
  + [Lcom/google/android/material/datepicker/c;
  + [Lcom/google/android/material/datepicker/e;
  + [Lf7/K2;
  + [Lf7/V1;
  + [Lf7/Z1;
  + [Lf7/k1;
  + [Lf7/m1;
  + [Lf7/t;
  + [Lf7/u0;
  + [Lk7/d;
  + [Lo6/A;
  + [Lo6/c;
  + [Lo6/y;
  + [Lo8/e;
  + [Lo8/j;
  + [Lr6/o;
  + [Lr7/m;
  + [Ls6/n1;
  + [Ls6/t1;
  + [Ls8/s;
  + [Lu7/z;
  + [Lw5/c;
  + [Lw5/f;
  + [Lz6/L;
  + administrative_area
  + billing_phone
  + line_1
  + line_2
  + ~~R8{"backend":"dex","compilation-mode":"release","has-checksums":false,"min-api":21,"pg-map-id":"b3d061a","r8-mode":"full","version":"8.7.14"}
  
  - Ll3/a;
  - Lo8/k;
  - Lr7/u;
  - Lw5/i;
  - [LN5/m;
  - [LN5/n;
  - [LN5/r;
  - [La5/d;
  - [Lcom/google/android/material/datepicker/b;
  - [Lcom/google/android/material/datepicker/d;
  - [Lf7/I2;
  - [Lf7/T1;
  - [Lf7/X1;
  - [Lf7/j1;
  - [Lf7/l1;
  - [Lf7/r;
  - [Lf7/s0;
  - [Lk7/b;
  - [Lo6/b;
  - [Lo6/x;
  - [Lo6/z;
  - [Lo8/i;
  - [Lo8/k;
  - [Lr6/m;
  - [Lr7/n;
  - [Ls6/m1;
  - [Ls6/s1;
  - [Ls8/q;
  - [Lu7/y;
  - [Lw5/d;
  - [Lw5/g;
  - [Lz6/K;
  - ~~R8{"backend":"dex","compilation-mode":"release","has-checksums":false,"min-api":21,"pg-map-id":"c26f708","r8-mode":"full","version":"8.7.14"}
  

TYPES:

   old   │ new   │ diff         
  ───────┼───────┼──────────────
   14321 │ 14326 │ +5 (+37 -32) 
  
  + LN5/L;
  + LN5/M;
  + Lk7/g;
  + Lo6/F;
  + Lr6/o;
  + Lu7/C;
  + Lz6/M;
  + [LN5/e;
  + [LN5/h;
  + [LN5/p;
  + [LN5/u;
  + [LN5/x;
  + [La5/g;
  + [Lcom/google/android/material/datepicker/c;
  + [Lcom/google/android/material/datepicker/e;
  + [Lf7/K2;
  + [Lf7/V1;
  + [Lf7/Z1;
  + [Lf7/k1;
  + [Lf7/m1;
  + [Lf7/t;
  + [Lf7/u0;
  + [Lk7/d;
  + [Lo6/A;
  + [Lo6/c;
  + [Lo6/y;
  + [Lo8/e;
  + [Lo8/j;
  + [Lr6/o;
  + [Lr7/m;
  + [Ls6/n1;
  + [Ls6/t1;
  + [Ls8/s;
  + [Lu7/z;
  + [Lw5/c;
  + [Lw5/f;
  + [Lz6/L;
  
  - Ll3/a;
  - Lo8/k;
  - Lr7/u;
  - Lw5/i;
  - [LN5/m;
  - [LN5/n;
  - [LN5/r;
  - [La5/d;
  - [Lcom/google/android/material/datepicker/b;
  - [Lcom/google/android/material/datepicker/d;
  - [Lf7/I2;
  - [Lf7/T1;
  - [Lf7/X1;
  - [Lf7/j1;
  - [Lf7/l1;
  - [Lf7/r;
  - [Lf7/s0;
  - [Lk7/b;
  - [Lo6/b;
  - [Lo6/x;
  - [Lo6/z;
  - [Lo8/i;
  - [Lo8/k;
  - [Lr6/m;
  - [Lr7/n;
  - [Ls6/m1;
  - [Ls6/s1;
  - [Ls8/q;
  - [Lu7/y;
  - [Lw5/d;
  - [Lw5/g;
  - [Lz6/K;
  

METHODS:

   old   │ new   │ diff            
  ───────┼───────┼─────────────────
   61585 │ 61602 │ +17 (+827 -810) 
  
  + A8.d <init>(e, W1, d, Set)
  + A8.d <init>(j)
  + C.D e(j, int, Bundle) → boolean
  + C.e t(JSONObject) → h
  + C.f o(String, m1, S1) → q
  + E5.p1 h(String, V1, c) → Object
  + E <init>(int, String, String, n1)
  + E <init>(String, String, n1)
  + G5.I c(String, V1, F0) → Object
  + G5.m <init>(v, d)
  + G5.n c(String, V1, F0) → Object
  + G5.w <init>(x, String, V1, d)
  + G5.x c(String, V1, F0) → Object
  + G6.e <init>(Context, i, g, boolean, boolean, f, f, d)
  + G6.e <init>(Context, i, g, boolean, boolean, f, d)
  + I4.c t(JSONObject) → h
  + I <init>(int, String, String, n1, c)
  + I <init>(String, String, n1, c)
  + N5.A <init>(String)
  + N5.A equals(Object) → boolean
  + N5.A hashCode() → int
  + N5.A toString() → String
  + N5.B <init>(a, K2, h)
  + N5.B equals(Object) → boolean
  + N5.B hashCode() → int
  + N5.B toString() → String
  + N5.C <init>(Object, int)
  + N5.C a() → Bundle
  + N5.D <clinit>()
  + N5.D <init>(int, int)
  + N5.D g(Object) → Object
  + N5.E <init>(M, y, d)
  + N5.F <init>(M, y, d)
  + N5.G <init>(M, d)
  + N5.H <init>(M, Intent, d)
  + N5.I <init>(M, d)
  + N5.I f(Object, Object) → Object
  + N5.I m(Object, d) → d
  + N5.I q(Object) → Object
  + N5.J <init>(M, d)
  + N5.K <init>(String, int)
  + N5.K g(Object) → Object
  + N5.L <init>(M, y, d)
  + N5.L f(Object, Object) → Object
  + N5.L m(Object, d) → d
  + N5.L q(Object) → Object
  + N5.M <clinit>()
  + N5.M <init>(String, j0, C, t, a, d, a, l, w, e, Q, y)
  + N5.M e(Object) → c
  + N5.M g(M, y, Uri)
  + N5.M h(M, y, h, boolean, int)
  + N5.b <init>(String, String, String, String, String, String)
  + N5.c <init>(String, String, String, b)
  + N5.e <clinit>()
  + N5.e <init>(String)
  + N5.e describeConte
...✂

@tillh-stripe tillh-stripe force-pushed the tillh/instant-debits-billing-details branch 2 times, most recently from 7958cbe to 1d58dc0 Compare October 16, 2024 20:44
@tillh-stripe tillh-stripe force-pushed the tillh/instant-debits-billing-details branch 11 times, most recently from f8fb987 to 799f952 Compare October 18, 2024 16:54
@tillh-stripe tillh-stripe changed the base branch from master to tillh/bank-billing-details-collection October 18, 2024 16:54
@tillh-stripe tillh-stripe force-pushed the tillh/instant-debits-billing-details branch from 799f952 to e09b969 Compare October 18, 2024 19:20
@tillh-stripe tillh-stripe changed the base branch from tillh/bank-billing-details-collection to tillh/link-card-brand-and-billing-details October 18, 2024 19:21
Base automatically changed from tillh/link-card-brand-and-billing-details to master October 21, 2024 13:21
@tillh-stripe tillh-stripe force-pushed the tillh/instant-debits-billing-details branch 7 times, most recently from 908f679 to 6beddeb Compare October 23, 2024 19:06
@tillh-stripe tillh-stripe force-pushed the tillh/instant-debits-billing-details branch from 6beddeb to 21bae0d Compare October 23, 2024 19:45
@tillh-stripe tillh-stripe marked this pull request as ready for review October 23, 2024 20:00
@tillh-stripe tillh-stripe requested a review from a team as a code owner October 23, 2024 20:00
@tillh-stripe tillh-stripe force-pushed the tillh/instant-debits-billing-details branch 3 times, most recently from e2496f1 to 65ac9c8 Compare October 25, 2024 14:06
1. Rename `BillingAddress` to `BillingDetails` and add email
2. Move extension to separate file and add comments
3. Remove duplicate `billing_phone` param
@tillh-stripe tillh-stripe force-pushed the tillh/instant-debits-billing-details branch from 65ac9c8 to 2179a68 Compare October 25, 2024 14:36
@tillh-stripe tillh-stripe mentioned this pull request Oct 28, 2024
3 tasks
@tillh-stripe tillh-stripe merged commit 0f3d653 into master Oct 28, 2024
16 checks passed
@tillh-stripe tillh-stripe deleted the tillh/instant-debits-billing-details branch October 28, 2024 18:53
toluo-stripe pushed a commit that referenced this pull request Oct 29, 2024
* Pass billing address in `ElementsSessionContext`

* Address code review feedback

1. Rename `BillingAddress` to `BillingDetails` and add email
2. Move extension to separate file and add comments
3. Remove duplicate `billing_phone` param

* Put changes behind feature flag
mats-stripe added a commit to stripe/stripe-ios that referenced this pull request Oct 29, 2024
…ails API (#4148)

Android equivalent: stripe/stripe-android#9446

## Summary

This passes the billing address model and a billing email to the
`/consumers/payment_details/` API. More details:
https://docs.google.com/document/d/1IP66DkxVK6DzeGCmuw00Gt9okFhEHQgM3lqBZSA-M4E/edit?usp=sharing

## Motivation

BANKCON-15711

## Testing

Unit tests, and I've verified the billing fields are correctly passed
from MPE to the API call:

<img width="1246" alt="Screenshot 2024-10-16 at 3 12 25 PM"
src="https://github.com/user-attachments/assets/1d780fdd-bc69-45ba-9b22-0cf3f3295683">

## Changelog

N/a
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.

2 participants