Skip to content

feat(admin): payment health card on Integration credentials - #227

Merged
thunpisit merged 2 commits into
mainfrom
feat/payment-health
Oct 25, 2026
Merged

thunpisit merged 2 commits into
mainfrom
feat/payment-health

Conversation

@thunpisit

Copy link
Copy Markdown
Contributor

Phase 2.7. Stacked on #226: merge that first; this then retargets to main.

What

A Payment health card at the top of /admin/settings/secrets (super_admin only):

  • Mode: Live / Playground (test, no real money) / custom API host, from BEAM_BASE_URL.
  • Credentials: all three resolve, or which are not set / saved but can't be decrypted, plus Worker env vars that look like Beam keys but aren't read (BEAM_SECRET_KEY).
  • Last webhook: when a verified Beam webhook last arrived (KV, written after the signature check), or registration instructions with this site's URL.
  • Test connection: one read-only GET /api/v1/charges?limit=1; accepted / rejected (401/403) / unreachable.

Names and timestamps only, never values.

Verified on a local worker (wrangler dev, fake Beam at BEAM_BASE_URL, throwaway local super admin)

Tests

payment-health.node.test.ts (9): mode mapping; configured + no webhook; last-webhook timestamp; lookalike flagged; recording never throws; test connection 200 / 401 / unreachable with one GET; route records only after verification.
Gate: lint 0 errors · check 0 · 1183/1183 · build · contract-guard · css-inventory +2 classes.

🤖 Generated with Claude Code

What a merchant otherwise learns only when a customer can't pay —
bactrack.in.th had an undecryptable key and an unregistered webhook,
both invisible until a test purchase:

- Beam mode: Live / Playground / custom API host (from BEAM_BASE_URL).
- Credentials: all resolve, or which are not set / can't be decrypted,
  plus env vars that look like Beam keys but aren't read.
- Last webhook: when a VERIFIED Beam webhook last arrived (recorded in
  KV by the webhook route after the signature check), or how to
  register one if none ever has.
- Test connection: one read-only GET /api/v1/charges?limit=1 with the
  stored credentials; reports accepted / rejected / unreachable.

Names and timestamps only; super_admin only, like the rest of the page.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@thunpisit
thunpisit changed the base branch from fix/payment-config-diagnostics to main October 25, 2026 12:45
@thunpisit
thunpisit merged commit 2699c95 into main Oct 25, 2026
2 checks passed
@thunpisit thunpisit mentioned this pull request Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant