mirror of
https://github.com/bitbaum/evig.git
synced 2026-12-04 18:58:49 +01:00
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>
11 lines
184 B
SYSTEMD
11 lines
184 B
SYSTEMD
[Unit]
|
|
Description=Schedule RevampIT cron: release-escrow (daily 04:00 UTC)
|
|
|
|
[Timer]
|
|
OnCalendar=*-*-* 04:00:00
|
|
Persistent=true
|
|
RandomizedDelaySec=120
|
|
|
|
[Install]
|
|
WantedBy=timers.target
|