Skip to content

Add managed Commerce carts and checkout web components - #1448

Open
wcole1-godaddy wants to merge 4 commits into
mainfrom
codex/managed-commerce-elements
Open

Add managed Commerce carts and checkout web components#1448
wcole1-godaddy wants to merge 4 commits into
mainfrom
codex/managed-commerce-elements

Conversation

@wcole1-godaddy

@wcole1-godaddy wcole1-godaddy commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Websites need a consistent way to manage multi-product carts and one-time purchases without rebuilding cart state or assembling React providers. This adds @godaddy/commerce, a framework-independent library over the existing Commerce APIs and an application's OAuth client. Shoppers review a managed cart drawer, then continue to hosted checkout.

  • Declares React and React DOM as 18.x || 19.x peers, with React 19 retained for development, so npm consumers share their host renderer.
  • Keeps typed quantities local until blur or Enter, preserving edits through pending mutations and restoring authoritative values after success or failure.
  • Adds gddy-add-to-cart, gddy-cart-button, gddy-buy-now, and gddy-payment-button, with optional React bindings and a headless client.
  • Creates a draft on the first add, adds the selected SKU ID and quantity using server-resolved pricing, and reuses the draft for later additions and cart checkout. Manages scoped persistence, serialized mutations, and server-provided totals. Buy now and application-resolved standalone charges preserve the saved cart.
  • Provides a compact right-side drawer with product images and fallback placeholders, complete variant/add-on selections, quantity and removal controls, a collapsed promo form, a fixed checkout footer, and the teal GoDaddy mark.
  • Redirects cart checkout, Buy now, and standalone payments to the hosted session URL. Removes inline checkout from the managed package and releases transient session state during handoff so failed navigation or browser Back does not leave the cart locked. Navigation does not establish payment success or clear the saved cart.
  • Adds a browser-compatible @godaddy/react/client export. Supporting @godaddy/react changes include embedded completion callbacks, session-scoped authentication storage, and style/portal scoping for that component's consumers; the managed Commerce elements use hosted checkout.
  • Documents the integration contract for developers and coding agents, including OAuth, attributes, SSR, customization, and authoritative payment confirmation. Includes changesets for both packages.

Validation of the latest changes:

  • Commerce package: 34 tests across five files, typecheck, Biome check, build, and git diff --check passed.
  • A separate React 18.3.1 consumer installed local package tarballs and verified shared React/ReactDOM resolution, useCart, the cart button, drawer rendering, and typed quantity commits. The regular Commerce suite runs on React 19.
  • Eight GraphQL operations and 26 freshly captured requests passed document validation and variable coercion against checked-in schemas. Orders and Checkout were also checked against the schema files in checkout-api main at 0d8c7d5e80c2413937f92c536c339266599a9655.
  • Coverage includes SKU additions, quantity changes/removal, discounts, all three hosted checkout inputs, request headers, appearance conversion, image fallbacks, selected variants, and navigation failure recovery.
  • The earlier full monorepo build/test run passed with 576 React tests, 19 Commerce tests, and 25 app-connect tests. That full run predates the latest Commerce changes; the targeted results above cover this update.

This remains a draft and the npm package is unreleased. The protected checkout repository owns CDN bundling, infrastructure, and release automation; this PR does not deploy a CDN release. Schema verification used synthetic data and snapshot contracts, including a downstream Orders snapshot. Real-store authorization, deployed API compatibility, and live payments remain untested. Draft creation still sends accepted but deprecated zero-valued totals; this is a non-blocking schema finding.

@changeset-bot

changeset-bot Bot commented Sep 8, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 1eaddb7

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@godaddy/commerce Patch
@godaddy/react Patch
nextjs Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@wcole1-godaddy
wcole1-godaddy marked this pull request as ready for review September 8, 2026 18:45
@wcole1-godaddy
wcole1-godaddy requested a review from a team as a code owner September 8, 2026 18:45
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.

2 participants