openova/core/services
e3mrah 8edb485caf
fix(billing): wire /api/v1/billing/purchase route (TBD-C15, Closes #1750) (#1924)
The close-audit DoD validator on a Sovereign host
(e.g. console.t32.omani.works) probes POST /api/v1/billing/purchase
+ POST /api/v1/sme/billing/purchase during the marketplace
customer-journey re-walk (Step 15 — "Purchase" button). On t32 both
returned 404 because the route was never registered on catalyst-api
or the billing service — distinct from the prior 502 class which
was a billing-service-Pod-stale / NATS-connection failure (TBD-A1

The canonical purchase wire has always been
POST /api/billing/checkout (marketplace gateway → billing service
Checkout handler — see CheckoutStep.svelte:722 + handlers.go +
routes.go); the validator vocabulary diverged from the in-cluster
naming. Rather than renaming the canonical handler or migrating
every existing caller, this PR registers two thin aliases:

  - billing service (core/services/billing/handlers/routes.go):
    POST /billing/purchase → existing Checkout handler. Same
    promo-code application, same Stripe-session creation, same
    paid_by_credit shortcut. Semantic alias only.

  - catalyst-api (products/catalyst/bootstrap/api/...):
    POST /api/v1/billing/purchase + POST /api/v1/sme/billing/purchase
    → proxy to SME gateway /api/billing/purchase → billing
    service /billing/purchase. Mirrors sme_billing_vouchers.go
    proxy shape — same mintSMEBridgeToken RS256→HS256 bridge,
    same 503 sme-gateway-unreachable graceful-degradation on a
    Sovereign without the SME services tier.

Marketplace UI continues to call /api/billing/checkout unchanged
(no FE migration), so every existing customer-journey GREEN path
remains stable. The new aliases exist primarily so the
operator-side DoD validator on console.<sov-fqdn> stops 404'ing.

Chart bump: 1.4.188 → 1.4.189 + bootstrap-kit pin synced.

Tests: routes_test.go asserts both /billing/purchase and
/billing/checkout resolve (regression guard for accidental
rename / removal). All existing billing + catalyst-api handler
tests pass.

Co-authored-by: hatiyildiz <hatiyildiz@users.noreply.github.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-19 11:20:53 +04:00
..
auth fix(ci): bump sme-services Containerfiles golang 1.22 → 1.26 (unblock 5 stranded fixes) (#1691) 2026-05-18 16:36:39 +04:00
billing fix(billing): wire /api/v1/billing/purchase route (TBD-C15, Closes #1750) (#1924) 2026-05-19 11:20:53 +04:00
catalog fix(catalyst-api+catalog): SME bridge token for publish toggle + chroot RBAC assign wrapper (#1789) 2026-05-18 21:50:24 +04:00
catalyst-catalog fix(ci): bump sme-services Containerfiles golang 1.22 → 1.26 (unblock 5 stranded fixes) (#1691) 2026-05-18 16:36:39 +04:00
domain fix(ci): bump sme-services Containerfiles golang 1.22 → 1.26 (unblock 5 stranded fixes) (#1691) 2026-05-18 16:36:39 +04:00
gateway fix(ci): bump sme-services Containerfiles golang 1.22 → 1.26 (unblock 5 stranded fixes) (#1691) 2026-05-18 16:36:39 +04:00
metering-sidecar fix(ci): bump sme-services Containerfiles golang 1.22 → 1.26 (unblock 5 stranded fixes) (#1691) 2026-05-18 16:36:39 +04:00
notification fix(notification): exponential backoff + circuit breaker on 503 5.5.1 SMTP rate-limit (TBD-X1, Refs #1793) (#1914) 2026-05-19 10:38:22 +04:00
provisioning fix(provisioning): create Organization CR on tenant.created (C16 root cause) (#1860) 2026-05-19 01:26:57 +04:00
shared feat(sandbox): tier-bound MCP capabilities (Free/Pro/Ent plans gate tool access) (#1690) 2026-05-18 16:30:00 +04:00
tenant test(tenant): wire round-trip for tenant.created owner_email contract (#1863) 2026-05-19 01:47:38 +04:00