Renewal safeguards
- An elapsed renewal link no longer automatically expires the unresolved payment
attempt and opens another collectible attempt for the same requirement cycle. Older expired attempts, including missing provider references, are held for review too.
- New attempts freeze the original Stripe account, mode, currency and request.
Concurrent offline processing blocks a stale first checkout; genuine late payment evidence still reconciles. Token and canonical ledger settle together.
- Confirmation checks the returned payment object, club, purpose, exact pence
amount and amount received. It cannot replace a different saved payment ID.
- A zero-row settlement update now requires an exact paid re-read. Pending,
expired, mismatched and unavailable rows do not produce a success message.
Shop duplicate-checkout safeguards
- Shop checkout uses a durable request key and canonical basket. Repeated
requests, tabs and lost responses resolve to the original unresolved order, rather than reserving stock or creating another payment.
- Order, line snapshots, stock reservations and key aliases commit together.
A proven stock refusal remains editable; unknown results stay held. Cancelled orders need confirmed payment/stock closure before a new purchase is allowed.
- The portal retains only opaque, contact-scoped checkout identity. Unknown,
processing, review and refund states are explicit, including after refresh; delayed card confirmation no longer claims bank authorisation. Status checks find the exact owned order even outside the latest 50 orders.
- Existing Complete payment uses the original intent/account/mode. Review,
expiry, ownership and payment-state changes are rechecked after provider waits; unresolved attempts cannot become another checkout. Explicit declines retain the existing same-intent correction path.
- This adds one reviewed SQL unit,
pro-shop-checkout-claim-01.sql. Deploy the
caller, drain old checkout handlers, then apply its SQL and postflight. New checkout fails closed until that authority exists; historical order reads remain available with conservative closure status. No remote change was made.
Refund safeguards
- Older partial-refund events cannot lower cumulative invoice or shop refund
totals. The guard is on the database update itself, including concurrent calls.
- Course refund redelivery repairs a failed entitlement revocation. Revocation
is limited to the original payment and purchase source; later purchases and other sources of access are not selected. Refund-before-success delivery is retained as refunded rather than granting access on a later success event.
Payment return and status screens
- Saved enrolment and course attempts restore a read-only status instead of
restarting a blank purchase. Course returns restore the selected household member only after checking the authenticated household roster.
- Pending, review, payment received/access repair and recorded refunds have
distinct wording. Original quote/currency and a local reference are retained.
- Historical event payments without a recorded original currency no longer
acquire today's club currency or an assumed GBP quote. Their recorded payment status remains visible without inventing a monetary amount.
- Stripe redirect secrets and status hints are removed from the URL and never
used as evidence that a payment succeeded. Failed status reads do not expose another Pay button or claim a safe failure.
- Course cards with retained purchases link to payment status rather than Buy.
- Moving between payment links, invoices, courses or staff entry contexts clears
the previous checkout before the new details load, including its amount, reference and payment form. Failed reads cannot redisplay the prior checkout.
- Invoice and external-entry return screens restore collection/refund/review
state through existing authorised reads. Processing invoices do not revert to an overdue Pay screen on reload. Confirmed refunds, pending refunds and failed refunds remain distinct.
- Staff external-entry return context is checked against the session club and
effective financial capability before showing an invoice status. Old/used public credentials do not gain new permissions.
- New same-attempt continuation buttons and used-event-link financial receipts
remain paused for explicit approval. Existing first-payment actions and credential expiry/consumption rules are unchanged.
- This return batch adds no SQL or environment setting. The wider payment wave
below still needs its separately reviewed SQL rollout and provider checks.
Operational boundary
- Portal renewals distinguish processing, recorded payment and review, retaining
the member/requirement return context without treating a URL as payment proof. Renewal notification handoffs are durable, including members without email.
- Course payment/access reconciliation and exact shop stock release are atomic;
shop recovery does not automatically cancel actionable provider payments. GoCardless uses current payment observations with stale-reader protection.
- Independent cron lanes now continue despite failures elsewhere, retaining
truthful per-lane counters. Base SaaS subscription webhooks observe current provider state instead of applying obsolete event snapshots.
- Course creation uncertainty retains its pending attempt; empty provider search
is no longer treated as proof that another payment can be started.
- Course checkout now freezes its original Stripe account, mode, quote and exact
request atomically before provider creation. Exact same-key retry is bounded to 23 hours; older uncertainty remains review-only. Account changes cannot silently create a replacement charge. Failed identity attachment retains the original attempt and withholds checkout rather than cancelling or deleting it.
- Course recovery reads the original account and verifies the original charge
and refund outcomes before repairing purchased access. Existing paid/refunded local finalisers can recover without today's Stripe connection. Historical failed/deleted rows do not silently close review findings; this is not a scan of every already-paid historical purchase for missing refund events.
- Portal invoice history retains original currencies and refund labels. External
event review responses are not presented as confirmed entry success.
- Standalone invoice results distinguish full and partial refunds from paid and
zero-balance invoices; terminal invoices no longer advertise card checkout. Platform checkout returns show a neutral hint until server billing state loads.
- Event checkout freezes the original account and quote through confirmation,
invoice and refund recovery. Unknown legacy attempts remain on hold.
- Eligible GoCardless notifications now have atomic per-engine handoffs and
independent recovery. Stale queued notices are suppressed; unknown delivery attempts require review. Missing-webhook financial discovery stays silent.
- Ambiguous shop reservation responses now report unavailable rather than
incorrectly claiming that an item is out of stock.
- Enrolment processing, payment-received/finalisation and refund-review responses
now show a neutral hold instead of a retryable payment error. Further collection is blocked in the current view; explicit card/field failures remain retryable. The later return batch above restores its saved state on refresh as well.
- Waitlist checkout now distinguishes refund pending, review and confirmed
outcomes. Processing/unknown results remove Pay; a known payment can be checked again without reconfirming it. Unknown responses without a payment reference offer contact guidance only. No unsupported no-charge or automatic-refund claim.
- The owner approved retained course attempts and equivalent atomic safety
assertions in place of obsolete delete/cancel-on-uncertainty mechanics. The focused course/shop corrections are integrated. The local release checkpoint passed: 18,569 tests, three pre-existing skips, audit/types/scanners/lint/build; the critical pack passed 500 tests and the new return-browser pack passed 118 synthetic groups. Details are recorded in the payment remediation ledger. Remote CI has not run for this local correction wave. This is not closure of the full payment audit: retained legacy/provider cases, the permission-gated additions above and real provider/device checks remain.
- Eleven additive SQL units and postflights are prepared; all remote application
is pending. Nine require reviewed SQL before matching callers; event checkout and shop checkout claims instead need code-first, old-handler drain, then SQL windows. Old event links remain review-only; do not combine those two units into the pre-deployment bundle.
- Eight disposable payment rehearsals are included in CI. No new environment
setting, activation, charge, refund, cancellation or real message was performed.
- The live £39 renewal has not been modified or retried. Its current provider
outcome and webhook delivery evidence are still required from the owner.
Dependency maintenance and platform tooling
- Dependency generation now keeps the PostCSS security override aligned with its
direct version. The updated dependency tree includes Supabase compatibility fixes and reviewed Next/Sentry security expectations. Fresh production and development dependency audits report no advisories.
- Refreshed staff sessions retain all cookie chunks and cache-prevention headers
across redirects and authority errors. Authentication and MFA decisions remain unchanged. Background API audit writes use a bounded runtime lifetime.
- CI uses current pinned action releases and rejects artifact digest mismatches.
Existing test lanes and payment rehearsals are preserved. Routine action updates are grouped for review. The bundle-analysis command now uses native Turbopack analysis, and unused legacy packages have been removed.
- These changes add no SQL, environment setting or activation requirement. The
payment rollout above remains unchanged; GitHub CI and live provider checks still need their own evidence after publication. The dependency and technology report records the investigation, corrections and verification limits.
Student loading and development checks
- The student directory loads profile code when a member is selected, with a
visible loading state. Direct profile links and directory refreshes are retained.
- CI reports development-tool advisories alongside the existing production audit
gate and saves dashboard/student initial JavaScript measurements.
- Local development and CI share Node 24 and npm 11.11.0 configuration. The owner
confirmed that Vercel is configured for Node 24; no deployment setting was changed.
- Required browser checks exercise session cookie refresh and redirect retention.
The pinned Supabase installer is updated after an isolated local rehearsal, keeping the same CLI and all payment rehearsal commands.
- These improvements add no remote SQL, payment action or feature activation.
The payment rollout order and pending-renewal safeguards above remain in force.
Payment SQL handoff
- The eleven pending payment SQL units are now available as two complete SQL
editor files with verification included: nine units before deployment, then event and shop checkout after the matching code is deployed and both old handlers have drained. See docs/database/payment-reliability-bundles-2026-09-10.md.
- Each phase rolls back as a whole on failure. The first phase refuses to run
after the second so it cannot replace newer shop checkout protections.
- Payment logic and historical payment data are preserved. The owner still
applies remote SQL; no remote application or feature activation occurred.
Staff payment review and Stripe configuration
- Settings → Payments now looks up a saved requirement payment by REQ reference
or Stripe payment ID, showing the member, requirement and renewal period. Effective billing.state.view controls reads; the new auditable billing.payment.reconcile capability controls recording verified evidence.
- The recovery action checks the original frozen account, exact amount and
payment identity, charge/refund history and current renewal cycle before using existing atomic settlement. It creates no payment and does not process credentials. Legacy, conflicting, refunded or disputed attempts stay held. Existing durable follow-up work can later send ordinary notifications.
- Additive
requirement-payment-reference-lookup-01.sql and its postflight must
be owner-applied before the new lookup is usable. This is a separate read RPC and two indexes; do not rerun the earlier predeploy bundle after postdeploy.
- Platform Health has an explicit super-admin-only read-only Stripe diagnostic:
account, event coverage, version and configuration gaps. Feed scope, signing secrets and actual delivery remain separately verified. Optional expected account IDs and the exact URL override are documented in the operations guide.
- A bounded requirement recovery cron runs every 15 minutes after deployment;
broad provider discovery stays daily. Fresh charge/refund proof also protects that existing recovery path. No remote SQL, deployment, provider configuration, payment, replay or notification was performed as part of the local changes.
Additional Stripe lifecycle and refund accounting safeguards
- Platform invoice payment failures and required customer actions now refresh
current subscription state through the existing ordered observer. Delayed failure events cannot directly overwrite a recovered subscription.
- Refund-created and refund-updated events wake only exact existing refund
operations. Current PI/charge/refund evidence is required before generic invoice finalization. Unknown dashboard refunds are not adopted as operations.
- A new atomic invoice observer prevents cumulative webhook totals and refund
finalization from counting the same money twice. A shared generic finalizer hold retains ambiguous historical/second-refund cases until observation succeeds. Existing external-event authority and subject cancellation policy are preserved.
- The additive
generic-invoice-refund-observation-01.sql and its postflight are
SQL-first. Deploy matching code and drain old handlers before subscribing to the extra events (Connect target 12, Platform target 17). Never repeat a refund to clear an accounting hold. Existing Reconcile cannot create missing observation.
- Charge IDs are opaque, including PayByBank
py_ IDs. Exact account, amount,
payment, captured and refund checks remain required for renewal recovery.
- The owner-authorised Ardent Edge Connect and Platform destinations were created
separately from local development. New secrets were owner-saved, but a later signing-secret exposure requires rotation before release; see the operator handoff. No push, deployment, remote SQL, charge, refund or real send occurred.
- Final local release verification on 2026-09-11 passed 18,965 tests with three
pre-existing skips, both TypeScript checks, zero production advisories, all scanners and production build. Lint retained zero errors/1,264 warnings. Critical verification passed 511 tests; the copied refund SQL passed 37 isolated checks. Remote CI, SQL and deployed provider verification remain separate.