Resilient WooCommerce Commerce System
WOOCOMMERCE · INTEGRATION SAFETY
A storefront can look finished while checkout, inventory, tax, shipping and third-party webhooks stay brittle. This system ignores styling entirely and hardens the revenue-critical boundaries with idempotency and explicit, tested invariants.
- Maintainer
- Pixy Puala
- Vertical
- E-commerce · Revenue integrity
- Year
- 2026
- Role
- Open source
- Stack
- WordPress
- Status
- ● Public repo
- Verified
- Source on GitHub
Problem
Revenue is lost at the seams, not on the product page. A retried webhook double-books an order; two concurrent checkouts oversell the last unit; float arithmetic drifts a tax total by a penny per line; a refund path lets you return more than was captured. Each is invisible in a design review and expensive in production.
Constraints
Decisions
Webhooks land in a replay-safe inbox
Every inbound webhook is signature-verified and written to an atomic dedup store backed by a database unique constraint. A replayed delivery is accepted and ignored, not processed twice — and the E2E test proves it against a real MySQL.
Money is integer minor units, never floats
The tax calculator works in pence/cents throughout. Float arithmetic is not "close enough" on a line-item total that gets multiplied and summed hundreds of times a day.
Invariants are enforced, not documented
Stock cannot go oversold, a refund can never exceed what was captured, and order-state transitions are a closed set. These are unit-tested rules in code rather than notes in a wiki.
Build
Stack
- ▸ WordPress · WooCommerce extension APIs
- ▸ PHP 8.1+ · Composer
- ▸ $wpdb-backed atomic dedup store · MySQL
- ▸ HMAC signature verification · timestamp window
- ▸ REST API route · webhook inbox
- ▸ PHPUnit · Playwright · wp-env
- ▸ GitHub Actions · dedicated E2E workflow
Tooling
- ✓ kept Composer · wp-env · GitHub Actions · MySQL fixture
Results · Measured
The webhook path is proven against a booted WordPress + MySQL via tests/e2e/webhook-e2e.sh in CI, with the dedup table asserted at the database level. Audit trail in docs/audit/.
Tradeoffs
Only the webhook path is live-tested. The order-sync adapter against real WC_Order objects, calculators bound to live carts, an operations console UI and Playwright checkout journeys are documented as unbuilt. Stating that boundary is the point: the tested surface is exactly as wide as the claim.