Stripe Integration Guide
This guide will walk you through setting up Stripe for payment processing for one-time payments.
Buildfast includes Stripe integration for payment processing for one-time payments, so you can start accepting payments immediately.
Create a Stripe Account
Sign up for Stripe if you haven't already
- Visit stripe.com
- Click "Start now" or "Sign up"
- Fill in your business information
- Verify your email address
- Complete your account setup
Get Your API Keys
You'll need both publishable and secret keys
1. Access your Stripe Dashboard
Log into your Stripe account and navigate to the Dashboard
2. Find API Keys
In the left sidebar, click "Developers" → "API keys"
Start with "Test" mode for development. Switch to "Live" mode only when ready for production.
3. Copy Your Keys
Publishable Key: Starts with pk_test_ (for test mode)
This is safe to expose in your frontend code
Secret Key: Starts with sk_test_ (for test mode)
Keep this secret! Never expose in frontend code
Set Up Environment Variables
Add your Stripe keys to your project
Create a .env file in your project root:
# Stripe Configuration
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_your_publishable_key_here
STRIPE_SECRET_KEY=sk_test_your_secret_key_here
Never commit your .env file to version control! This is already in your .gitignore file.
Set Up Products and Prices
Create your one-time payment products in Stripe
1. Create Products
In Stripe Dashboard: Products → Create product
- Name: e.g., "Starter Plan", "Pro Plan"
- Description: Brief description of what's included
2. Add Pricing
For each product, create pricing:
- Pricing model: Standard pricing
- Price: Set your amount (e.g., $199)
- Type: One-time payment
- Currency: USD (or your preferred currency)
3. Copy Price IDs
You'll need these price IDs (starting with price_) in your code.
Test Your Integration
Verify everything is working correctly
Test Credit Card Numbers:
Success: 4242 4242 4242 4242
Declined: 4000 0000 0000 0002
Use any future expiration date and any CVC
Webhook Testing:
Use Stripe CLI for local webhook testing:
stripe listen --forward-to localhost:3000/webhooks
Going Live
When you're ready for production
- Complete your Stripe account verification
- Switch to "Live" mode in your Stripe dashboard
- Get your live API keys (start with pk_live_ and sk_live_)
- Update your environment variables with live keys
- Set up live webhooks pointing to your production domain
- Test thoroughly with small amounts first