Admin only — Internal guide

Activate Stripe in LIVE mode

Step-by-step checklist to switch from Stripe Test → Stripe Live and start receiving real payments. Estimated time: 1–2 hours.

Progress: 0 / 90%
Step 1

Configure Business Settings

Complete your business data on Stripe to activate LIVE mode.

  • Go to dashboard.stripe.com → Settings → Business settings
  • Fill Business details: legal name, address, VAT ID, website
  • Fill Banking: IBAN to receive payouts
  • Fill Tax information: country, applicable VAT rate
  • Fill Public details: public name, support email, phone
Open Business Settings

Without this data, Stripe will NOT accept the LIVE activation request.

Step 2

Enable Stripe Customer Portal

Critical: The customer portal at /en/portal redirects to Stripe to manage subscriptions. It must be enabled.

  • Open Settings → Billing → Customer portal
  • Click Activate test link + Activate live link
  • Allow: Update payment method, View invoices, Cancel subscriptions
  • In Products: allow Switch plan between Starter, Pro, Business, Enterprise
  • In Cancellations: allow cancel immediately OR at period end
  • In Branding: upload PosQuantum logo + primary color #00d4ff
Open Customer Portal Settings

Without this, the "Manage Subscription" button in the Customer Portal returns error 400.

Step 3

Configure Tax

Enable Stripe Tax to calculate VAT automatically per country.

  • Open Settings → Tax
  • Click Set up Stripe Tax (both in Test and Live)
  • Add tax origin: Portugal (or your company country)
  • Enable automatic tax calculation
  • On Products/Prices: mark Tax behavior as Exclusive (VAT added to price)
Open Tax Settings
Step 4

Create Products & Prices LIVE

Create the 4 plans in LIVE mode (mirror of existing Test ones).

  • Switch toggle to Live mode (top right corner)
  • Products → + Add product → create: Starter €49/month, Pro €149/month, Business €499/month, Enterprise €1499/month
  • Also create annual Prices (20% discount): Starter €470/year, Pro €1430/year, Business €4790/year, Enterprise €14390/year
  • For each Price: Copy ID (price_xxxx) — you will need in step 7
  • Add overage Products: "API Overage" (€0.001/request), "Storage Overage" (€0.10/GB/month)
Open Products

LIVE Price IDs are different from TEST IDs. Write all of them down.

Step 5

Rotate Secret Key

Copy the LIVE secret key to the .env file.

  • In Live mode: Developers → API keys
  • In Standard keys: click Reveal live key token
  • Copy sk_live_... (save securely — shown only once)
  • Edit .env: STRIPE_SECRET_KEY=sk_live_... (replace sk_test_...)
  • Never commit this value to git
STRIPE_SECRET_KEY=sk_live_51XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Open API keys
Step 6

Update Publishable Key

Copy the LIVE publishable key to .env.

  • In Live mode: Developers → API keys → Standard keys
  • Copy pk_live_... (this can be exposed in the frontend)
  • Edit .env: NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_live_...
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_live_51XXXXXXXXXXXXXXXX
Step 7

Configure Production Webhook

Create a webhook endpoint in Live mode pointing to the production domain.

  • In Live mode: Developers → Webhooks → + Add endpoint
  • URL: https://posquantum.com/api/stripe/webhook
  • Select these 6 events (critical):
  • • checkout.session.completed
  • • customer.subscription.created
  • • customer.subscription.updated
  • • customer.subscription.deleted
  • • invoice.paid
  • • invoice.created
  • Click Add endpoint → copy the Signing secret (whsec_...)
  • Edit .env: STRIPE_WEBHOOK_SECRET=whsec_... (replace the Test one)
STRIPE_WEBHOOK_SECRET=whsec_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Open Webhooks

If events do not arrive, check in Stripe → Webhooks → Deliveries (200 = OK).

Step 8

Update LIVE Price IDs in code

Replace Test Price IDs with Live in .env.

  • Collect all Price IDs noted in step 4
  • Edit .env with LIVE IDs (example below):
STRIPE_PRICE_STARTER_MONTHLY=price_1XXXXXX_live
STRIPE_PRICE_STARTER_YEARLY=price_1XXXXXX_live
STRIPE_PRICE_PRO_MONTHLY=price_1XXXXXX_live
STRIPE_PRICE_PRO_YEARLY=price_1XXXXXX_live
STRIPE_PRICE_BUSINESS_MONTHLY=price_1XXXXXX_live
STRIPE_PRICE_BUSINESS_YEARLY=price_1XXXXXX_live
STRIPE_PRICE_ENTERPRISE_MONTHLY=price_1XXXXXX_live
STRIPE_PRICE_ENTERPRISE_YEARLY=price_1XXXXXX_live
STRIPE_PRICE_OVERAGE_API=price_1XXXXXX_live
STRIPE_PRICE_OVERAGE_STORAGE=price_1XXXXXX_live
Step 9

Test Full Flow

Make a real test charge (€1.00) + refund to validate end-to-end.

  • Restart production server (new deploy after .env update)
  • Open posquantum.com/en/pricing → choose Starter monthly
  • Create subscription with real card (charges €49)
  • Verify: confirmation email received? invoice.paid webhook processed? Subscription appears in Customer Portal?
  • Open dashboard.stripe.com → Payments → find payment → Refund (prevent fake charge)
  • Cancel subscription: in Customer Portal click "Cancel at period end"
  • Validate: Admin dashboard updates KPIs? churnRate reflects cancellation?

Final checklist before announcing

  • All 9 steps complete (green tick)
  • Test charge €1 + refund worked
  • Stripe → Webhooks → Deliveries: all 200 OK
  • Admin dashboard reflects real payment
  • Confirmation email arrives to customer
  • Customer Portal /en/portal opens Stripe Billing Portal
  • Customer cancellation works
  • Invoice PDF downloads correctly