Files
evig/docs/operations
GandClaude Opus 4.8 0a01a8727e fix(payments): make Payrexx truly plug-and-play (webhook signature, capture, partial-config guard) (#191)
Audit of the Payrexx integration found gaps that would break live payments the
moment real credentials are added. Closes them so go-live is config-only:

G1 (critical) — webhook signature header. The handler read `payrexx-signature`,
but Payrexx signs with `X-Webhook-Signature` (lowercase-hex SHA-256 HMAC of the
raw body, key as UTF-8 — which the code already computes correctly). With the
wrong header every live webhook was rejected (fail-closed) → customers charged
but orders never advance. One-line header fix.

G2 — capture for workshops/appointments. Gateways only RESERVE funds (authorize);
capture was wired only for marketplace. Non-escrow workshop/appointment payments
were authorized but never captured → the hold expires (~7 days) and the money is
never collected. The webhook now captures non-escrow generic payments immediately
on the reserved event (after the state commit, with loud logging on failure so a
user is never locked out of what they paid for). Escrow payments stay held.

G3 — escrow auto-release. The old `scripts/auto-release-escrow.js` was dead
frankenstein code (Stripe + retired Neon DB_* vars) — deleted. Replaced with a
real `GET /api/cron/release-escrow` that captures any escrow still held past its
deadline (Payrexx), + a `revampit-cron@release-escrow.timer` (daily 04:00). Tested.

G4 — partial-config guard. `isPayrexxConfigured()` ignores the webhook secret, so
a config with INSTANCE+SECRET but no WEBHOOK_SECRET silently charges customers
while rejecting every webhook. `createGateway` now logs a loud error in that exact
state (`isPayrexxPartiallyConfigured()`).

Also: `reservation` now sent as the documented `1` (the string "true" is coerced
to 0 by Payrexx's PHP backend → reservation silently disabled); removed dead
`getBaseUrl()`; rewrote docs/operations/PAYREXX_SETUP.md as the precise
plug-and-play go-live checklist.

Verified live behavior unchanged in mock mode; typecheck + lint + umlauts clean;
full suite 530/7688 green.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-30 15:52:58 +02:00
..