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 Guarded Stripe go-live rehearsal preflight implemented locally; hosted test/live rehearsal remains blocked on approved secrets, domain, Customer Portal, support, legal review, and deployed backend URL Ready
Mode test Ready
Backend URL Needs HTTPS backend Needs input
Webhook URL Needs webhook endpoint Needs input
Support inbox No Ready
Customer Portal No Ready
Storage decision Cloudflare Worker + D1 Ready
Entitlement path Needs absolute mounted path Needs input
Cloud billing Cloudflare Worker + D1 billing backend scaffold implemented locally; live deployment remains blocked on Cloudflare account, D1 database ID, billing domain, Stripe secrets, price, Customer Portal, support, and legal review Ready
Cloud billing URL Needs deployed Worker URL Needs input
Cloud D1 Needs D1 database ID Needs input

Commands

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

Live Blockers

  • Monthly price and hosted AI cap approved
  • Support inbox confirmed by ticket roundtrip
  • Domain and HTTPS backend URL
  • Customer Portal cancellation/invoices/payment methods enabled
  • Stripe webhook endpoint and signing secret configured
  • Attorney/accountant review approved
  • Secrets stored outside repo

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