Skip to content

fix(core): revalidate hosted checkout delivery - #146

Draft
alexasomba wants to merge 2 commits into
emdashCommerce:mainfrom
alexasomba:codex/hosted-shipping-selection
Draft

alexasomba wants to merge 2 commits into
emdashCommerce:mainfrom
alexasomba:codex/hosted-shipping-selection

Conversation

@alexasomba

@alexasomba alexasomba commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Review order

Please review Optional checkout postcode #140 first. That PR was already open and makes the postcode optional. Both PRs edit the cart and checkout handlers, so this one is a draft while we coordinate the rebase. The delivery guard here should preserve the optional-postcode behavior.

The earlier checkout UI work is in Show hosted shipping options once #132 and Start checkout on the shop country #135. The delivery endpoint and regression cases in this PR can be reviewed alongside the stock discussion in EmDash 1.6 stock updates #141 once the ordering is agreed.

What changes

  • Separate a product's shipping requirement from its download grant. A physical product can include a downloadable file.
  • Require a current delivery option after hosted checkout reprices the cart. Removing an old free rate stops checkout before a provider call even when the total stays the same.
  • Expose delivery destinations based on the cart currency and configured zone precedence. Let hosts pass the selected region when setting a shipping location.
  • Release the stock lock if the initial checkout draft write fails.

This is server-side delivery validation. Related hosted form work is in Show hosted shipping options once #132, Start checkout on the shop country #135, and Optional checkout postcode #140. The stock lock regression is also relevant to EmDash 1.6 stock updates #141.

Validation

Core build and typecheck, 367 Core tests and 105 Paystack tests passed. Route regressions cover a withdrawn free rate, country and region filtering, and a draft-write failure after stock was reserved.

@alexasomba
alexasomba marked this pull request as draft December 3, 2026 06:38
@alexasomba

alexasomba commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor Author

@moset15 I should have checked in with you before marking this ready. Your Optional checkout postcode #140 PR was already in progress and both changes touch the same checkout handlers. I've moved this PR to draft so yours can go first. I'll preserve optional postcodes when I rebase the delivery validation. The draft also has a stock-lock cleanup test that I'd be happy to share on EmDash stock update issue #141 if useful.

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