Payment Integration
Dual provider support for payments with both Stripe and Lemon Squeezy integration. Choose your preferred payment method or use both.
Dual Provider Support
The boilerplate supports both Stripe and Lemon Squeezy, allowing users to choose their preferred payment method or giving you flexibility in your payment strategy.
Stripe Integration
- Checkout Sessions for secure payment processing
- Subscriptions with recurring billing
- Webhooks for payment status updates
- Customer Portal for self-service billing
Lemon Squeezy Integration
- Checkout Links for simple payment links
- Subscriptions with recurring billing
- Webhooks for payment notifications
- Built-in customer portal
Payment Flow
User Selects Plan
User chooses a subscription plan from the pricing page
Checkout Session Created
Payment provider creates a secure checkout session
Payment Processed
User completes payment through the provider's secure checkout
Webhook Updates Subscription
Webhook updates user's subscription status in the database
Access Granted
User receives credits or premium access based on their plan
Environment Variables
Configure these environment variables for payment providers:
Stripe Configuration
Lemon Squeezy Configuration
Key Files
lib/stripe.ts
Stripe configuration and utility functions
/lib/stripe.ts
lib/lemonsqueezy.ts
Lemon Squeezy configuration and utility functions
/lib/lemonsqueezy.ts
app/api/payments/
Payment processing API routes
/app/api/payments/
app/api/webhook/
Webhook handlers for payment notifications
/app/api/webhook/
Setup Guide
Stripe Setup
- Visit stripe.com and create an account
- Get your API keys from the dashboard (test keys for development)
- Create products and prices for your subscription plans
- Set up webhook endpoints for payment events
- Add the webhook signing secret to your environment variables
Lemon Squeezy Setup
- Visit lemonsqueezy.com and create an account
- Create a store and get your API key
- Create products and variants for your subscription plans
- Set up webhook endpoints for order events
- Add the webhook secret to your environment variables
Next Steps
After setting up payments, explore these related areas: