Add these to your .env.local file:
# Stripe Publishable Key (Client-side)
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_your_publishable_key_here
# Stripe Secret Key (Server-side)
STRIPE_SECRET_KEY=sk_test_your_secret_key_here- Go to Stripe Dashboard
- Sign up for a free account
- Complete account verification
- In Stripe Dashboard, go to Developers β API Keys
- Copy your Publishable key (starts with
pk_test_) - Copy your Secret key (starts with
sk_test_)
- Test Mode: Use for development (keys start with
pk_test_andsk_test_) - Live Mode: Use for production (keys start with
pk_live_andsk_live_)
- Success:
4242 4242 4242 4242 - Decline:
4000 0000 0000 0002 - Insufficient Funds:
4000 0000 0000 9995
- Expiry: Any future date (e.g.,
12/25) - CVC: Any 3 digits (e.g.,
123) - ZIP: Any 5 digits (e.g.,
12345)
- Never commit secret keys to version control
- Use environment variables for all keys
- Test thoroughly before going live
- Monitor transactions in Stripe Dashboard
In your Stripe Dashboard, you can:
- View all donations in Payments section
- Set up webhooks for real-time notifications
- Generate reports and analytics
- Handle refunds if needed
- Add environment variables to
.env.local - Test the donation flow with test cards
- Deploy to production with live keys
- Set up webhooks for donation notifications
- Stripe fees: 2.9% + 30Β’ per successful transaction
- No monthly fees for basic usage
- Free for first $1M in annual volume