Payments

Billing Live Rehearsal

Guarded Stripe go-live preflight for test mode, hosted backend health, webhook readiness, Customer Portal, support, legal review, and live-mode safety.

Rehearsal Form

Stripe setup

Checking command-center API...

Do not paste Stripe secret keys or webhook signing secrets here. Use your deployment provider secret store or temporary shell environment.

Readiness Snapshot

Status Hosted Stripe test Checkout, webhook activation, Customer Portal, and second-device restore are verified; paid launch remains gated by guarded live-mode preflight, legal review. Ready
Mode test Ready
Backend URL https://billing.porterlabz.com Ready
Webhook URL https://billing.porterlabz.com/api/billing/webhook Ready
Support inbox Yes Ready
Customer Portal Yes Ready
Storage decision Cloudflare Worker + D1 Ready
Entitlement path Needs absolute mounted path Needs input
Cloud billing Cloudflare Worker, D1 billing storage, device pairing, and recovery runtime configuration are deployed and health verified; email recovery stays fail-closed until sender-domain onboarding and a real delivery roundtrip pass, and paid launch remains gated by guarded live-mode preflight, legal review. Ready
Cloud billing URL https://billing.porterlabz.com Ready
Cloud D1 148a0520-51bb-4f31-895b-02a99efd31b4 Ready

Commands

  • npm run billing:live-preflight -- --mode test
  • npm run billing:live-rehearsal -- --mode test
  • npm run test:billing-live-rehearsal

Live Blockers

  • guarded live-mode preflight
  • legal review

Storage Guard

Hosted paid beta must set NYRA_BILLING_REQUIRE_PERSISTENT_STORAGE=true and point NYRA_ENTITLEMENTS_FILE at an absolute mounted persistent path, or replace the JSON store with a managed database.

Webhook Events

EventStatus
checkout.session.completedReady
invoice.paidReady
invoice.payment_failedReady
customer.subscription.updatedReady
customer.subscription.deletedReady
entitlements.active_entitlement_summary.updatedOpen

Billing Live Rehearsal

Scope: NyrA Swarm Little Buddy paid beta.

This is the guarded path for proving the Stripe Checkout, Customer Portal, webhook, backend, and desktop license activation flow before any public paid launch.

This is not legal, tax, accounting, or Stripe support advice. Use Stripe test mode first. Do not run live mode until business identity, tax, support, policies, domain, and attorney/accountant review are complete.

Why This Exists

The app already has:

The remaining risk is operational: live secrets, URLs, Customer Portal settings, webhook settings, price/cap decisions, and support/legal readiness must all be true at the same time.

Commands

Run preflight in test mode:

npm run billing:live-preflight -- --mode test

Run hosted rehearsal after backend deployment:

$env:NYRA_BILLING_BASE_URL = "https://billing.your-domain.example"
$env:NYRA_REHEARSAL_EMAIL = "your-test-email@example.com"
npm run billing:live-rehearsal -- --mode test

Create a test Checkout Session only when you are ready:

$env:NYRA_BILLING_REHEARSAL_EXECUTE = "true"
npm run billing:live-rehearsal -- --mode test
Remove-Item Env:\NYRA_BILLING_REHEARSAL_EXECUTE

Live mode has an extra guard:

$env:NYRA_ALLOW_LIVE_BILLING_REHEARSAL = "true"
npm run billing:live-preflight -- --mode live
Remove-Item Env:\NYRA_ALLOW_LIVE_BILLING_REHEARSAL

Required Stripe Setup

Use Stripe Billing subscriptions with Stripe-hosted Checkout and Customer Portal.

Required webhook events:

Recommended event:

Required Command-Center Decisions

Required Secret Store Values

These belong in the deployment provider secret store or temporary shell only, never in repo files:

Stop Conditions

Stop the rehearsal and keep checkout disabled if:

Sources