Skip to content

Reshape Checkout Session tax - #6922

Open
yuki-stripe wants to merge 4 commits into
yuki/checkout-session-statusfrom
yuki/checkout-session-tax
Open

Reshape Checkout Session tax#6922
yuki-stripe wants to merge 4 commits into
yuki/checkout-session-statusfrom
yuki/checkout-session-tax

Conversation

@yuki-stripe

@yuki-stripe yuki-stripe commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

Match the reviewed Checkout Elements API by separating tax computation state from aggregate tax amounts.

The Checkout Playground continues to use totals for its compact order summary and exposes the named taxAmounts breakdown from an info button in both UIKit and SwiftUI.

Before

Session
`-- tax: Checkout.Tax
    +-- status
    `-- taxAmounts?

After

Session
+-- tax: Session.Tax?
|   `-- status
`-- taxAmounts: [Session.TaxAmount]?

taxAmounts describes the individual aggregate tax lines, while totals groups their values by tax treatment:

taxAmounts
+-- State Tax:  $5 exclusive
+-- County Tax: $2 exclusive
`-- VAT:        $1 inclusive

totals.taxExclusive = $7
totals.taxInclusive = $1

Tax computation state maps as follows:

automatic + complete                   -> Tax(.ready)
automatic + requires shipping address  -> Tax(.requiresShippingAddress)
automatic + requires billing address   -> Tax(.requiresBillingAddress)
missing, failed, or unsupported         -> nil
non-automatic tax                       -> Tax(.ready)

tax == nil means that no valid public computation status is available. It does not mean that no tax applies or that tax computation succeeded.

Testing

CleanShot.2026-08-14.at.17.06.48.mp4

Added test coverage confirming:

  • Aggregate tax amounts preserve their formatted amount, minor-unit amount, inclusive flag, display name, and percentage.
  • An absent aggregate tax amount list remains nil, while an explicitly empty list remains empty.
  • Completed automatic tax maps to the ready state.
  • Automatic tax that needs an address requests the configured shipping or billing address.
  • Failed, unsupported, or incomplete automatic-tax metadata produces no public tax state.
  • Non-automatic tax maps to the ready state.

Manually verified the Checkout Playground tax summary and tax-details presentation in both UIKit and SwiftUI.

Stack

Depends on the Checkout Session status PR (yuki/checkout-session-status).

@yuki-stripe
yuki-stripe requested review from a team as code owners August 14, 2026 03:35
@yuki-stripe
yuki-stripe requested review from joyceqin-stripe and removed request for a team August 14, 2026 03:35
@yuki-stripe
yuki-stripe force-pushed the yuki/checkout-session-status branch from 70c982c to cec2851 Compare August 14, 2026 19:19
@yuki-stripe
yuki-stripe force-pushed the yuki/checkout-session-tax branch from 161ad7f to 4f7c460 Compare August 14, 2026 19:23
@yuki-stripe
yuki-stripe force-pushed the yuki/checkout-session-status branch from cec2851 to cbdfbc9 Compare August 14, 2026 23:17
@yuki-stripe
yuki-stripe force-pushed the yuki/checkout-session-tax branch 2 times, most recently from 070a7b3 to 238473e Compare August 14, 2026 23:37
@yuki-stripe
yuki-stripe force-pushed the yuki/checkout-session-status branch from cbdfbc9 to a46686c Compare August 14, 2026 23:41
@yuki-stripe
yuki-stripe force-pushed the yuki/checkout-session-tax branch 3 times, most recently from f86d8dc to aa5802d Compare August 15, 2026 00:06
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>
@yuki-stripe
yuki-stripe force-pushed the yuki/checkout-session-tax branch 4 times, most recently from 14babb3 to 6e8ad03 Compare August 15, 2026 05:07
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>
@yuki-stripe
yuki-stripe force-pushed the yuki/checkout-session-tax branch from 6e8ad03 to ece7c54 Compare August 15, 2026 05:13
yuki-stripe and others added 2 commits August 14, 2026 22:17
Committed-By-Agent: codex
Co-authored-by: codex <noreply@openai.com>
Committed-By-Agent: codex
Co-authored-by: codex <noreply@openai.com>
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.

1 participant