Stripe Setup Guide
Configure recurring payments for your subscription platform
Sign up for a Stripe account at stripe.com
Note: You'll start in test mode by default, which is perfect for development. You can switch to live mode later.
- Go to Developers → API keys
- Copy your Publishable key (starts with
pk_test_) - Copy your Secret key (starts with
sk_test_)
⚠️ Keep your secret key safe!
Never share your secret key or commit it to version control. It should only be stored in environment variables.
Add these to your app secrets:
Create recurring price IDs for each subscription tier:
- Go to Products → Add product
- Create three products: Silver, Gold, and Platinum
- For each product, set a recurring price (monthly)
- Copy each price ID (starts with
price_)
Silver Plan
Price ID: price_...
Gold Plan
Price ID: price_...
Platinum Plan
Price ID: price_...
Add price IDs to environment variables:
Set up webhooks to receive real-time updates about subscriptions:
- Go to Developers → Webhooks
- Click "Add endpoint"
- Enter your endpoint URL:
https://your-domain.com/api/stripe-webhook - Select these events to listen for:
invoice.payment_succeededinvoice.payment_failedcustomer.subscription.updatedcustomer.subscription.deleted
- Copy the webhook signing secret (starts with
whsec_)
Add to your secrets:
Use Stripe's test cards to verify your integration:
✅ Successful Payment
4242 4242 4242 4242Any future expiry, any CVC
❌ Failed Payment
4000 0000 0000 0002Card will be declined
Before going live: Switch from test mode to live mode in your Stripe dashboard and update all API keys and price IDs with live versions.