Skip to content

Share automatic-tax billing address primitives (MOBILESDK-4667) - #13717

Merged
cttsai-stripe merged 3 commits into
masterfrom
cttsai/mobilesdk-4667-shared-tax-address
Aug 5, 2026
Merged

Share automatic-tax billing address primitives (MOBILESDK-4667)#13717
cttsai-stripe merged 3 commits into
masterfrom
cttsai/mobilesdk-4667-shared-tax-address

Conversation

@cttsai-stripe

@cttsai-stripe cttsai-stripe commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Rename and generalize the card billing-address element as BillingAddressElement, with explicit collection modes for no address, full address, and country-first collection.

Card behavior is unchanged. cardBillingAddressCollectionMode retains Automatic-mode AVS postal-code collection for US, GB, and CA, then additively applies the Checkout Session automatic-tax requirements when applicable. The implementation uses an API-23-compatible map update.

This PR deliberately keeps the nested country element at IdentifierSpec.Country. It does not add countryElementIdentifier or change card call sites. #13723 adds that required parameter when CountrySpec first needs its own API path.

Motivation

Card Automatic collection is not a safe default for a country-only LPM because it asks for postal code in the US, GB, and CA even when automatic tax is disabled. Separating the card policy from generic country-first collection keeps that LPM work in the following PRs.

No automatic-tax policy, saved-PM behavior, or saved-card-editing behavior changes in this PR.

Testing

  • Added tests
  • Modified tests
  • Manually verified

CardBillingAddressElementTest covers retained card AVS behavior, additive automatic-tax fields, country-only collection without AVS defaults, Full collection, and country changes. Focused verification passed:

./gradlew :payments-ui-core:lintRelease :payments-ui-core:detekt :payments-ui-core:apiCheck :payments-ui-core:testDebugUnitTest :paymentsheet:lintRelease :paymentsheet:detekt :paymentsheet:apiCheck :paymentsheet:testDebugUnitTest

Screenshots

N/A: refactor only.

Changelog

N/A: internal/library-group implementation.

@cttsai-stripe cttsai-stripe changed the title Generalize automatic-tax billing address primitives (MOBILESDK-4667) Share automatic-tax billing address primitives (MOBILESDK-4667) Aug 3, 2026
@cttsai-stripe
cttsai-stripe force-pushed the cttsai/mobilesdk-4667-shared-tax-address branch 2 times, most recently from 6a83cba to cbf2e78 Compare August 3, 2026 20:06
@cttsai-stripe
cttsai-stripe force-pushed the cttsai/mobilesdk-4667-shared-tax-address branch 2 times, most recently from 2ca18e7 to ec9398c Compare August 3, 2026 20:22
@cttsai-stripe
cttsai-stripe force-pushed the cttsai/mobilesdk-4667-shared-tax-address branch 2 times, most recently from adfe109 to 1265162 Compare August 3, 2026 21:58
@cttsai-stripe
cttsai-stripe force-pushed the cttsai/mobilesdk-4667-shared-tax-address branch 2 times, most recently from 354f22e to 924554b Compare August 3, 2026 23:46
@cttsai-stripe
cttsai-stripe force-pushed the cttsai/mobilesdk-4667-shared-tax-address branch from bca787f to 06aa548 Compare August 4, 2026 18:16
@cttsai-stripe
cttsai-stripe force-pushed the cttsai/mobilesdk-4667-shared-tax-address branch from 06aa548 to 0c2381a Compare August 4, 2026 19:26
@cttsai-stripe
cttsai-stripe marked this pull request as ready for review August 4, 2026 22:18
@cttsai-stripe
cttsai-stripe requested review from a team as code owners August 4, 2026 22:18
@cttsai-stripe
cttsai-stripe force-pushed the cttsai/mobilesdk-4667-shared-tax-address branch from 0c2381a to f2ccba5 Compare August 4, 2026 22:18
@cttsai-stripe
cttsai-stripe force-pushed the cttsai/mobilesdk-4667-shared-tax-address branch from f2ccba5 to 57dc676 Compare August 4, 2026 22:34
CountryConfig(countryCodes),
rawValuesMap[IdentifierSpec.Country]
),
countryElementIdentifier: IdentifierSpec,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

why did we introduce this parameter? Looks like it's always set to IdentifierSpec.Country so seems unnecessary. Can we revert?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Deferred to later PRs.

Base automatically changed from cttsai/mobilesdk-4667-stable-tax-billing-signal to master August 4, 2026 23:20
@cttsai-stripe
cttsai-stripe force-pushed the cttsai/mobilesdk-4667-shared-tax-address branch from 57dc676 to 5b971dd Compare August 4, 2026 23:20
@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

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.6 MiB │   4.6 MiB │   +253 B │   9.8 MiB │   9.8 MiB │ +1.1 KiB 
     arsc │   3.8 MiB │   3.8 MiB │      0 B │   3.8 MiB │   3.8 MiB │      0 B 
 manifest │   5.8 KiB │   5.8 KiB │      0 B │  30.9 KiB │  30.9 KiB │      0 B 
      res │     1 MiB │     1 MiB │      0 B │   1.7 MiB │   1.7 MiB │      0 B 
   native │   2.7 MiB │   2.7 MiB │      0 B │   2.7 MiB │   2.7 MiB │      0 B 
    asset │  19.4 KiB │    21 KiB │ +1.6 KiB │  29.5 KiB │    31 KiB │ +1.6 KiB 
    other │ 245.5 KiB │ 245.5 KiB │     -1 B │ 505.4 KiB │ 505.4 KiB │      0 B 
──────────┼───────────┼───────────┼──────────┼───────────┼───────────┼──────────
    total │  12.4 MiB │  12.4 MiB │ +1.8 KiB │  18.5 MiB │  18.5 MiB │ +2.7 KiB 

 DEX     │ old   │ new   │ diff              
─────────┼───────┼───────┼───────────────────
   files │     1 │     1 │   0               
 strings │ 45643 │ 45647 │  +4 (+29 -25)     
   types │ 14403 │ 14407 │  +4 (+26 -22)     
 classes │ 11718 │ 11722 │  +4 (+4 -0)       
 methods │ 63816 │ 63829 │ +13 (+1213 -1200) 
  fields │ 41710 │ 41712 │  +2 (+445 -443)   

 ARSC    │ old  │ new  │ diff 
─────────┼──────┼──────┼──────
 configs │  320 │  320 │  0   
 entries │ 7500 │ 7500 │  0
APK
     compressed      │     uncompressed     │                                           
──────────┬──────────┼───────────┬──────────┤                                           
 size     │ diff     │ size      │ diff     │ path                                      
──────────┼──────────┼───────────┼──────────┼───────────────────────────────────────────
    9 KiB │ +1.6 KiB │   8.9 KiB │ +1.6 KiB │ ∆ assets/dexopt/baseline.prof             
  4.6 MiB │   +253 B │   9.8 MiB │ +1.1 KiB │ ∆ classes.dex                             
    271 B │     -1 B │     120 B │      0 B │ ∆ META-INF/version-control-info.textproto 
  1.2 KiB │     -1 B │   1.1 KiB │     -1 B │ ∆ assets/dexopt/baseline.profm            
 58.9 KiB │     -1 B │ 130.8 KiB │      0 B │ ∆ META-INF/CERT.SF                        
  1.2 KiB │     +1 B │   1.2 KiB │      0 B │ ∆ META-INF/CERT.RSA                       
──────────┼──────────┼───────────┼──────────┼───────────────────────────────────────────
  4.7 MiB │ +1.8 KiB │    10 MiB │ +2.7 KiB │ (total)
DEX
STRINGS:

   old   │ new   │ diff         
  ───────┼───────┼──────────────
   45643 │ 45647 │ +4 (+29 -25) 
  
  + Country(additionalFieldsByCountry=
  + Lxl/h5;
  + Lxl/i5;
  + Lxl/j5;
  + Lxl/k5;
  + [Lxl/b0;
  + [Lxl/f2;
  + [Lxl/g3;
  + [Lxl/h4;
  + [Lxl/i2;
  + [Lxl/i3;
  + [Lxl/i4;
  + [Lxl/i5;
  + [Lxl/k5;
  + [Lxl/l2;
  + [Lxl/l3;
  + [Lxl/n1;
  + [Lxl/o2;
  + [Lxl/o3;
  + [Lxl/p0;
  + [Lxl/q1;
  + [Lxl/r4;
  + [Lxl/s0;
  + [Lxl/u4;
  + [Lxl/y2;
  + [Lxl/y3;
  + [Lxl/y;
  + r8-map-id-c9c8142623ba2f13860b1e119f53db181ea5b15a487cf1b4378bf289a1788d6f
  + ~~R8{"backend":"dex","compilation-mode":"release","has-checksums":false,"min-api":23,"pg-map-id":"c9c8142623ba2f13860b1e119f53db181ea5b15a487cf1b4378bf289a1788d6f","r8-mode":"full","version":"8.13.19"}
  
  - VLLLLLLLZI
  - [Lxl/a0;
  - [Lxl/b2;
  - [Lxl/c3;
  - [Lxl/e2;
  - [Lxl/e3;
  - [Lxl/e4;
  - [Lxl/g5;
  - [Lxl/h2;
  - [Lxl/h3;
  - [Lxl/i0;
  - [Lxl/j1;
  - [Lxl/k2;
  - [Lxl/k3;
  - [Lxl/l0;
  - [Lxl/m1;
  - [Lxl/m2;
  - [Lxl/n4;
  - [Lxl/q3;
  - [Lxl/q4;
  - [Lxl/v3;
  - [Lxl/w4;
  - [Lxl/x;
  - r8-map-id-e2483eb43d30669ddf6655f20f0086aabd29af9ed17c7165f650c02d63e4ea67
  - ~~R8{"backend":"dex","compilation-mode":"release","has-checksums":false,"min-api":23,"pg-map-id":"e2483eb43d30669ddf6655f20f0086aabd29af9ed17c7165f650c02d63e4ea67","r8-mode":"full","version":"8.13.19"}
  

TYPES:

   old   │ new   │ diff         
  ───────┼───────┼──────────────
   14403 │ 14407 │ +4 (+26 -22) 
  
  + Lxl/h5;
  + Lxl/i5;
  + Lxl/j5;
  + Lxl/k5;
  + [Lxl/b0;
  + [Lxl/f2;
  + [Lxl/g3;
  + [Lxl/h4;
  + [Lxl/i2;
  + [Lxl/i3;
  + [Lxl/i4;
  + [Lxl/i5;
  + [Lxl/k5;
  + [Lxl/l2;
  + [Lxl/l3;
  + [Lxl/n1;
  + [Lxl/o2;
  + [Lxl/o3;
  + [Lxl/p0;
  + [Lxl/q1;
  + [Lxl/r4;
  + [Lxl/s0;
  + [Lxl/u4;
  + [Lxl/y2;
  + [Lxl/y3;
  + [Lxl/y;
  
  - [Lxl/a0;
  - [Lxl/b2;
  - [Lxl/c3;
  - [Lxl/e2;
  - [Lxl/e3;
  - [Lxl/e4;
  - [Lxl/g5;
  - [Lxl/h2;
  - [Lxl/h3;
  - [Lxl/i0;
  - [Lxl/j1;
  - [Lxl/k2;
  - [Lxl/k3;
  - [Lxl/l0;
  - [Lxl/m1;
  - [Lxl/m2;
  - [Lxl/n4;
  - [Lxl/q3;
  - [Lxl/q4;
  - [Lxl/v3;
  - [Lxl/w4;
  - [Lxl/x;
  

METHODS:

   old   │ new   │ diff              
  ───────┼───────┼───────────────────
   63816 │ 63829 │ +13 (+1213 -1200) 
  
  + a8.j a(g)
  + ai.p0 <init>(b, t4, f0, c, g7, a8, m7, g0, boolean, i0, boolean, Boolean, v, l0, u0, c)
  + ai.p0 <init>(b, c, v, c, int)
  + ai.q0 <init>(b, t4, LinkedHashMap, g0, Map, boolean, String, c, t1, boolean, boolean, c, a, b, boolean, i0, f0, boolean, Boolean, v, l0, u0, c)
  + ai.s0 c(f0, a5, c) → a
  + ai.s0 f(f0, a5) → g
  + ai.s0 h(f0, a5, v, q0) → List
  + androidx.fragment.app.d0 m() → r2
  + androidx.fragment.app.u m() → r2
  + androidx.fragment.app.x0 b(h0, r2, d0)
  + androidx.lifecycle.n <init>(boolean, boolean, boolean, v)
  + b9.a j(Context, Looper, c, Object, g, h) → c
  + b9.a k(Context, Looper, c, Object, k, k) → c
  + bi.h c(f0, a5, c) → a
  + bi.h f(f0, a5) → g
  + bi.h h(f0, a5, v, q0) → List
  + bi.h k(f0, a5, v) → ArrayList
  + bi.q <init>(boolean, m0, e2, s, int)
  + cl.z <init>(n, a, f, b, a, f, g, k, d, a, v2, o, g, q1, a, String, f, h0, d, f, g0, a, u0, a, e, d)
  + com.stripe.android.financialconnections.FinancialConnectionsSheetActivity E(FinancialConnectionsSheetActivity, l, k, c) → Object
  + da.c Q(View) → int
  + da.c X(View, int)
  + da.c Y(int)
  + da.c Z(View, int, int)
  + da.c a0(View, float, float)
  + da.c l0(View, int) → boolean
  + da.c o(View, int) → int
  + da.c p(View, int) → int
  + dl.m1 <init>(s, boolean, boolean, String, String, c, k4, x4, a, int)
  + fa.c Q(View) → int
  + fa.c R() → int
  + fa.c Y(int)
  + fa.c Z(View, int, int)
  + fa.c a0(View, float, float)
  + fa.c l0(View, int) → boolean
  + fa.c o(View, int) → int
  + fa.c p(View, int) → int
  + ga.a L(Object, float)
  + ga.a x(Object) → float
  + gf.c <init>(z0, l4, t1, boolean, boolean, s, int)
  + gm.r3 <init>(j0)
  + ha.c b(t, float) → float
  + ka.b L0(int)
  + ka.b M0(Typeface, boolean)
  + ka.b f1(int)
  + o3.g A(int) → float
  + o3.g B(g, c, c) → boolean
  + o3.g C(g, Object, Object) → boolean
  + o3.g D(g, f, f) → boolean
  + o3.g E(q, h, int) → q
  + o3.g F(Intent, String, Parcelable_Creator) → b
  + o3.g G(b, a, String) → a
  + o3.g H(b, d, Object) → a
  + o3.g I(ViewGroup_MarginLayoutParams) → int
  + o3.g J() → int
  + o3.g K() → int
  + o3.g L() → int
  + o3.g M() → int
  + o3.g N(View) → int
  + o3.g O(CoordinatorLayout) → int
  + o3.g P() → int
  + o3.g Q(Throwable) → boolean
  + o3.g R(g) → boolean
  + o3
...✂

@cttsai-stripe
cttsai-stripe force-pushed the cttsai/mobilesdk-4667-shared-tax-address branch 2 times, most recently from 57dc676 to eea2b61 Compare August 5, 2026 00:18
cttsai-stripe and others added 3 commits August 5, 2026 09:51
Committed-By-Agent: codex
Co-authored-by: codex <noreply@openai.com>
Committed-By-Agent: codex
Co-authored-by: codex <noreply@openai.com>
Committed-By-Agent: codex
Co-authored-by: codex <noreply@openai.com>
Committed-By-Agent: codex
Co-authored-by: codex <noreply@openai.com>
Committed-By-Agent: codex
Co-authored-by: codex <noreply@openai.com>
Committed-By-Agent: codex
Co-authored-by: codex <noreply@openai.com>
Committed-By-Agent: codex
Co-authored-by: codex <noreply@openai.com>
Committed-By-Agent: codex
Co-authored-by: codex <noreply@openai.com>
Committed-By-Agent: codex
Co-authored-by: codex <noreply@openai.com>
@cttsai-stripe
cttsai-stripe force-pushed the cttsai/mobilesdk-4667-shared-tax-address branch from eea2b61 to defc3de Compare August 5, 2026 16:51
@cttsai-stripe
cttsai-stripe merged commit 821e101 into master Aug 5, 2026
55 checks passed
@cttsai-stripe
cttsai-stripe deleted the cttsai/mobilesdk-4667-shared-tax-address branch August 5, 2026 17:46
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