CluPilotCloud/app/Services
nexxo 32a8bd9a88 Refuse the sale instead of reaching Stripe without a key
Task 5: Billing::purchase() now checks SecretVault for a stripe.secret before
touching anything else — no customer, no plan lookup, no Order row — and the
customer reads a plain sentence instead of a 500 page. HttpStripeClient's own
secret() throws the same StripeNotConfigured exception rather than sending a
request with an empty bearer token and letting Stripe's 401 stand in for the
real cause.

isConfigured() was fixed alongside it: it used to call secret() too, which
would have turned every "is Stripe set up?" check (the checkout controller,
the catalogue sync commands) into an uncaught exception the moment a key went
missing — the opposite of what this task is for. It now reads the vault
directly.

The new guard is unconditional, including for the cart-only purchase types
(storage, addon, plan changes) that never call Stripe themselves — a cart
order nobody can ever pay for is pointless to create. That broke every
existing Billing/Cart/Downgrade test that calls purchase() without a stored
key; each affected fixture now deposits one via the new withStripeSecret()
Pest helper. A few of those tests (CustomDomainAccessTest, DowngradeTest) were
passing already but for the wrong reason — the new guard, not the check they
were named for — since both only assert an order was NOT created; they get
the same fixture fix so they still prove what they claim.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-30 11:58:01 +02:00
..
Billing Stop charging VAT to the customers who owe us none 2026-07-30 02:15:41 +02:00
Deployment Update on a schedule if the owner wants one, and say where incidents go 2026-07-29 15:01:54 +02:00
Devices Show where an account is signed in, and let it sign the other places out 2026-07-28 23:38:17 +02:00
Dns Fix nine defects in the provisioning pipelines 2026-07-30 01:34:55 +02:00
Domains Prove a custom domain before serving it, and keep proving it 2026-07-29 14:47:51 +02:00
Env Add a raw .env editor to the Integrations page, with a net under it 2026-07-29 01:51:27 +02:00
Mail Stop charging VAT to the customers who owe us none 2026-07-30 02:15:41 +02:00
Maintenance Keep the purpose mailer through the queue instead of losing it to the default 2026-07-28 03:50:02 +02:00
Monitoring Add the SSH identity to the vault, and give deployment config a console page 2026-07-29 00:52:44 +02:00
Provisioning Let the customer buy it themselves, and tab the integrations page 2026-07-29 19:42:28 +02:00
Proxmox Restart a machine, enforce the quota that was sold, end a route that ended 2026-07-29 18:28:28 +02:00
Secrets Make source() respect strict entries like get() does 2026-07-30 11:21:07 +02:00
Ssh Make host onboarding survive the machine it runs on 2026-07-30 00:54:16 +02:00
Status Let an incident be deleted, and start measuring whether the hosts answer 2026-07-29 15:16:48 +02:00
Stripe Refuse the sale instead of reaching Stripe without a key 2026-07-30 11:58:01 +02:00
Tax Ask the EU register whether a VAT number is real 2026-07-29 22:42:29 +02:00
Traefik Serve the custom domain, not just announce it 2026-07-29 16:44:52 +02:00
Traffic feat(billing): the plan catalogue becomes three tables, and config stops selling 2026-07-26 12:05:56 +02:00
Wireguard Add the SSH identity to the vault, and give deployment config a console page 2026-07-29 00:52:44 +02:00