Payments

Set up payment processing with Stripe, Polar, or Dodo

MoveFast supports three payment providers: Stripe, Polar, and Dodo Payments. Choose the one that fits your needs.

Common Configuration

Add this to your .env.local to set your payment provider:

env
PAYMENT_PROVIDER="STRIPE"

Set PAYMENT_PROVIDER to STRIPE, POLAR, or DODO.


Stripe

Stripe is the industry standard for online payments. Great for subscriptions, one-time payments, and global coverage.

1. Create an Account

  1. Sign up at stripe.com
  2. Complete your business profile
  3. Go to Developers > API Keys

2. Add Environment Variables

env
STRIPE_SECRET_KEY="sk_test_51..."
STRIPE_WEBHOOK_SECRET="whsec_..."
VariableDescription
STRIPE_SECRET_KEYYour Stripe secret key (starts with sk_)
STRIPE_WEBHOOK_SECRETWebhook signing secret for verifying events

3. Set Up Webhooks

  1. Go to Developers > Webhooks in your Stripe Dashboard
  2. Click Add endpoint
  3. Enter your webhook URL:
code
https://yourdomain.com/api/payment/webhook/stripe
  1. Select these events:

    • checkout.session.completed
    • customer.subscription.created
    • customer.subscription.updated
    • customer.subscription.deleted
  2. Copy the Signing secret and add it to STRIPE_WEBHOOK_SECRET

4. Create Products & Prices

  1. Go to Products in your Stripe Dashboard
  2. Create your subscription plans or one-time products
  3. Copy the Price ID (starts with price_) for use in your app

Polar

Polar is built for open source monetization. Great for indie hackers and open source maintainers.

1. Create an Account

  1. Sign up at polar.sh
  2. Create an organization
  3. Go to Settings > Developers > Personal Access Tokens
  4. Create a new token with the required scopes

2. Add Environment Variables

env
POLAR_ACCESS_TOKEN="polar_oat_..."
POLAR_WEBHOOK_SECRET="polar_whs_..."
POLAR_ENVIRONMENT="sandbox"
VariableDescription
POLAR_ACCESS_TOKENYour Polar access token
POLAR_WEBHOOK_SECRETWebhook secret for verifying events
POLAR_ENVIRONMENTsandbox for testing, production for live

3. Set Up Webhooks

  1. Go to Settings > Webhooks in your Polar Dashboard
  2. Add a new webhook with your endpoint:
code
https://yourdomain.com/api/payment/webhook/polar
  1. Select these events:

    • order.paid
    • subscription.created
    • subscription.updated
    • subscription.active
    • subscription.canceled
    • subscription.revoked
  2. Copy the webhook secret and add it to POLAR_WEBHOOK_SECRET

4. Create Products

  1. Go to Products in your Polar Dashboard
  2. Create your subscription tiers or products
  3. Copy the Product ID for use in your app

Dodo Payments

Dodo Payments is a developer-first payment platform with simple integration.

1. Create an Account

  1. Sign up at dodopayments.com
  2. Complete your account setup
  3. Go to API Keys to get your credentials

2. Add Environment Variables

env
DODO_API_KEY="d2T2..."
DODO_WEBHOOK_SECRET="whsec_..."
DODO_ENVIRONMENT="test_mode"
VariableDescription
DODO_API_KEYYour Dodo API key
DODO_WEBHOOK_SECRETWebhook secret for verifying events
DODO_ENVIRONMENTtest_mode for testing, live_mode for production

3. Set Up Webhooks

  1. Go to Webhooks in your Dodo Dashboard
  2. Add your webhook endpoint:
code
https://yourdomain.com/api/payment/webhook/dodo
  1. Select these events:

    • payment.succeeded
    • subscription.active
    • subscription.updated
    • subscription.renewed
    • subscription.cancelled
    • subscription.expired
    • subscription.deleted
  2. Copy the webhook secret and add it to DODO_WEBHOOK_SECRET