Repository navigation
Conversation
This was referenced Dec 3, 2026
Shipping zones match on country and region only, and many addresses have no postcode, but cart/shipping-location answered 400 without one and checkout/create-session refused a ship-to address without one. Both now need only the country; a postcode that is given is still stored for postcode-prefix tax rates. The postcode fields in HostedCheckoutForm and the starter's embedded form (shipping and billing) are marked optional and no longer required. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
moset15
force-pushed
the
fix/checkout-postcode-optional
branch
from
December 5, 2026 22:53
cec44fa to
11d2ff3
Compare
moset15
marked this pull request as ready for review
December 5, 2026 22:53
Contributor
Author
|
#107 has landed, so this is rebased onto main and ready for review. |
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.
Part of the roadmap in #108.
Problem
Shipping zones match on country and region only (
matchesZone); the postcode never picks a rate. Many addresses have no postcode (most Kenyan ones, for example), yet checkout requires one:cart/shipping-locationanswers 400postalCode required;checkout/create-sessionanswers 409 "Pick a ship-to country and postal code before paying."Change
HostedCheckoutForm: the postcode field is marked "(optional)" and is no longerrequired; the hint reads "Enter your country, and your postal code if you have one".cart/contactnever checked the postcode and is unchanged.Tests
packages/core/test/postcode-optional.test.ts, through the real routes:cart/shipping-locationaccepts{ country: "ke" }and storesKEwith an empty postcode (fails without the change);checkout/create-sessionstarts a payment for a shipped cart with no postcode (fails without the change);Rebased on current
main: core 440 pass (the 4 localrouting-response-adapterfailures pass on CI), typecheck clean;bun.lockis unchanged.Tested by hand: a Kenyan address with no postcode got shipping options and a paid Paystack order.