Public: anyone can read this; the crew can change it.
An admin can tell the money path is wired: which gateway, whether the webhook is heard, and what is stuck unpaid #62
Sign in to join this conversation.
Public: anyone can read this; the crew can change it.
An admin opening a fresh preview cannot tell whether this deployment takes real test-mode card payments or is simulating them, whether Stripe's webhook can reach it, or that four orders have been sitting at
pending_paymentsince yesterday.What the pages show today.
/adminnames the environment and the catalog;src/gateway.ts:47-56already works out the answer —chosen()returns a kind, a label and a note that says exactly why the mock is in use ("No STRIPE_SECRET_KEY is set", or a key that is not a test key and is therefore refused) — and the only place a shopper or an admin meets it is the checkout button.STRIPE_WEBHOOK_SECRETis read insrc/shop.tsat delivery time and nowhere else, so a deployment with a secret key and no webhook secret looks exactly like a healthy one until money goes missing. Nothing counts the orders that never got paid.Done looks like
/admin— one small render function insrc/pages/admin.tsfed by plain data fromsrc/gateway.ts— says which gateway is live andchosen().notewhen it is the mock, whetherSTRIPE_WEBHOOK_SECRETis set, when the last webhook delivery was accepted, when the last payment was recorded, and how many orders are atpending_paymentwith the age of the oldest.STRIPE_SECRET_KEYorSTRIPE_WEBHOOK_SECRET.src/admin.tslike every other admin read — an anonymous request to/adminstill gets today's 403 page and nothing about the deployment's configuration.order_event,payment) rather than a new table, so this does not wait on #16; when #16 lands itsgateway_eventtable becomes the better source and the panel moves to it in one line.COUNTand oneMIN(created_at)over"order"by status, measured against a few thousand seeded orders in the test, and the dashboard's time does not move.STRIPE_SECRET_KEY, the panel says simulated and gives the reason; with a test key and no webhook secret, it warns; a pending order older than an hour is counted and named; the page never contains a secret.Files I expect to change.
src/gateway.ts(ahealth()returning plain data),src/admin.ts,src/pages/admin.ts,src/orders.ts(a count by status),src/tty.ts,src/server.test.tsorsrc/stripe.test.ts,README.md.Risks. This is a page about secrets, which is the easiest page in the app to leak one from — the test that greps the body is the point, not a formality. #61 also grows the dashboard, so it goes first and this panel follows it; keep them as two render functions rather than one block. "Stuck unpaid" is a judgement, not a fact: say the age and let the admin decide, and do not cancel anything — expiry is #15's work.
Suggested crew. mason to build it, with sentinel reading the pull for what the panel exposes.