Route Checkout shipping Address Element through CheckoutSessionTaxRegionUpdater - #14357
Draft
cttsai-stripe wants to merge 9 commits into
Draft
Route Checkout shipping Address Element through CheckoutSessionTaxRegionUpdater#14357cttsai-stripe wants to merge 9 commits into
cttsai-stripe wants to merge 9 commits into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Checkout shipping Address Element saves now update the Checkout Session tax region through
CheckoutSessionTaxRegionUpdater. This is a direct comparison alternative to the live CheckoutController registry design in #14353.Motivation
The Checkout shipping flow needs to carry the current
CheckoutSessionResponsethrough the Address Activity, return the tax-updated response with the collected address, persist both in the parent, and refresh controller-visible state before confirmation. This keeps shipping ownership local to the Checkout flow without adding a global registry or shipping callbacks toPaymentElementCallbacks.What changed
LaunchMode.CheckoutShippingcaptures the currentCheckoutSessionResponsewhen the Address Activity is presented.CheckoutSessionTaxRegionUpdaterwithTaxAddressSource.SHIPPING. Its internal result envelope returns the normalAddressLauncherResulttogether with the updated response.shippingNameandshippingAddressinCheckoutCollectedDetails, commits throughCheckoutOperationCoordinator, and reloads throughCheckoutStateLoader.reloadso controllersession, Payment Element state, and confirmation inputs observe the saved shipping details.ShippingAddressElementStateHolderretains onlyisPresenting.flowchart TB P["CheckoutController"] --> L["Checkout shipping AddressLauncher"] L --> A["AddressElementActivity"] A --> U["CheckoutSessionTaxRegionUpdater<br/>source SHIPPING"] U --> E["Activity result envelope<br/>AddressLauncherResult + CheckoutSessionResponse"] E --> S["CheckoutController parent commit"] S --> R["CheckoutStateLoader.reload"] R --> PWhat stays the same
AddressLauncherbehavior and its public result shape remain unchanged.Coverage
TaxAddressSource.SHIPPINGrequest construction.Testing
Focused Paymentsheet tests passed, along with
:paymentsheet:detekt,:paymentsheet:apiCheck, the repository pre-push hook, andgit diff --check.Screenshots
Not applicable. There are no UI appearance changes.
Notes
The child tax request uses the response captured at presentation and runs outside the parent operation lock, matching the existing Checkout Sheet billing handoff. The parent commit is serialized, but applies that returned response to the latest local state. A merchant controller mutation can therefore race with the server-update-to-parent-commit window, and the local response can be temporarily stale. This alternative intentionally does not add versioning, refetching, or mutation blocking.
Changelog
[CHANGED] Checkout shipping Address Element saves now propagate the updated Checkout Session tax region.
Committed and created by Codex.