Skip to Content
FeaturesStripe Payments

Stripe Payments

Complete guide to Stripe integration in Fast Forward Dev.

Overview

Fast Forward Dev includes full Stripe integration for:

  • One-time payments
  • Subscriptions
  • Webhook handling
  • Billing management

Setup

1. Create Stripe Account

Sign up at stripe.com 

2. Get API Keys

Dashboard → Developers → API keys

Copy:

  • Publishable key (starts with pk_test_)
  • Secret key (starts with sk_test_)

3. Create Products

Dashboard → Products → Add Product

Create products for each tier (Basic, Pro, etc.)

For each product, create a price and copy the price ID (starts with price_).

4. Configure Environment Variables

Client (.env.local):

PUBLIC_TEST_STRIPE_PUBLISHABLE_KEY=pk_test_...

Server (.env):

STRIPE_SECRET_KEY=sk_test_...

5. Update Config

Edit src/config/config.ts:

const productType = isProd() ? { [ProductType.BASIC]: 'price_live_basic', [ProductType.PRO]: 'price_live_pro', } : { [ProductType.BASIC]: 'price_test_basic', [ProductType.PRO]: 'price_test_pro', }

Testing Locally

Test Cards

  • Success: 4242 4242 4242 4242
  • Decline: 4000 0000 0000 0002
  • 3D Secure: 4000 0025 0000 3155

Use any future date and any 3-digit CVC.

Webhook Testing

Install Stripe CLI:

brew install stripe/stripe-cli/stripe

Forward webhooks:

stripe listen --forward-to localhost:5001/api/stripe/webhook

Copy the webhook signing secret and add to .env:

STRIPE_WEBHOOK_SECRET=whsec_...

Production Setup

1. Activate Account

Complete Stripe account activation in the dashboard.

2. Create Live Products

Create products in live mode with live price IDs.

3. Configure Live Keys

Update environment variables with live keys (pk_live_ and sk_live_).

4. Set Up Webhooks

Dashboard → Developers → Webhooks → Add endpoint

Endpoint URL: https://yourdomain.com/api/stripe/webhook

Select events:

  • checkout.session.completed
  • customer.subscription.updated
  • customer.subscription.deleted

Copy webhook signing secret to production .env.

How It Works

Checkout Flow

  1. User clicks “Get Started”
  2. Client creates checkout session via API
  3. User redirected to Stripe Checkout
  4. User completes payment
  5. Stripe sends webhook to server
  6. Server creates Billing record
  7. User redirected to signup page
  8. User creates account
  9. Account linked to Billing record

Webhook Processing

Server handles these events:

checkout.session.completed

  • Creates Billing record
  • Stores customer ID
  • Records purchase

customer.subscription.updated

  • Updates subscription status
  • Updates current plan

customer.subscription.deleted

  • Marks subscription as canceled
  • Updates current plan

Next Steps

Last updated on