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