Skip to content

Spwig 1.7.0

Choose a tag to compare

@dayyanj dayyanj released this 26 Jul 13:00
· 8 commits to main since this release
988dbdc

Spwig 1.7.0 — the stored-value release, with agentic commerce built in.

This is a substantial release, please review the CHANGELOG.md for full details. In this release, gift cards become a first-class part of the platform, sold on the storefront, delivered by email, spendable at checkout and at the POS, and handled cleanly through refunds, now modelled as true payment tenders rather than discounts. The customer wallet graduates to spendable store credit, loyalty rewards pay out into it, and the payment/refund/reward paths gain substantial hardening, auditability, and test coverage. Alongside it, this release adds Agentic Commerce (opt-in, built into the core), a built-in Test Gateway for first-run checkout, scoped API tokens, and a reworked checkout.

Highlights

💳 Stored value (gift cards & wallet)

  • Gift cards purchasable on the storefront (fixed/custom denominations, recipient, gift message, scheduled delivery) — paid orders mint funded cards and email them, on web and POS, with idempotent issuance and a reconciler.
  • Gift cards are now payment tenders, not discounts — a card settles the full post-tax, post-shipping total and writes a real payment record. Multiple tenders combine on one order; a fully covered order completes without a gateway.
  • Customer wallet is spendable store credit at checkout (hold-based double-spend protection, single-currency rule). Loyalty fixed-value rewards credit store credit exactly once (DB-enforced).
  • Tender-aware refunds: value returns to the gift card before the gateway; refunds to a dead/expired card mint a replacement. Automatic loyalty clawback + affiliate reversal on full refunds.

🤖 Agentic Commerce (AI Shopping) — opt-in, built-in

  • Off by default; every agent surface returns 404 until a merchant deliberately enables it.
  • Discovery + read-only catalogue over the Universal Commerce Protocol (/.well-known/ucp) and a storefront MCP endpoint (search_catalog/get_product).
  • Agent auth via HTTP Message Signatures (RFC 9421): directory-resolved keys, trust-on-first-use with per-assistant spending caps, and a tamper-evident append-only activity log.
  • UCP checkout sessions place real, paid orders through the same pricing/tax/shipping/payment paths (no parallel checkout), with AP2 merchant-signed mandates (SD-JWT) as dispute evidence. Optional ACP product feed.
  • Plain-language AI Shopping admin: readiness verdict, per-product visibility switch, assistant registry, emergency stop.

🧪 Built-in Test Gateway

  • A fully local simulated payment provider (magic cards for success/decline/insufficient-funds/3-DS/AVS, webhook-delayed capture) with a strict validation mode enforcing what real gateways require (email, name, ISO-2 country, phone, per-currency minimums, zero-decimal correctness). Auto-installed, active only in sandbox mode.

🔑 Scoped API tokens & analytics

  • Merchant API tokens can be granted Read or Read & Write access to specific admin APIs from a grouped scope picker. Fail-closed and least-privilege: a token reaches only what it holds a scope for and never exceeds its creator's role.
  • New web traffic analytics API (GET /api/admin/analytics/traffic/) reachable by a scoped token.

🛒 Checkout

  • Session-auth storefront cart/checkout (guest cart merges into the account on login), reworked express checkout (email-first, collapsible summary, pre-mounted default provider), auto-selected shipping method, digital/booking-only carts skip shipping steps, and voucher entry in the payment section across all templates.

Security

Independent cryptographic + security review of Agentic Commerce (SSRF-guarded key fetches, double-charge/price-drift protection, signature-verified rate-limited agent activity, private keys never exposed). CSRF enforced for session-auth storefront APIs. Least-privilege API tokens (fail-closed). Bundled component packages are checksum-verified. Dependency refresh incl. Django and Pillow security releases.

⚠️ Breaking changes

  • Gift cards are tenders, not discounts (full-balance settlement; historical figures preserved).
  • Headless TypeScript SDK / React hooks → 2.0.0 (tender endpoints, loyalty redemption by UUID).

Full details in CHANGELOG.md under [1.7.0]. Licensed under AGPL-3.0-or-later.