Stripe Integration
Clacky provides a test Stripe API integration for development and testing purposes. This allows you to experiment with payment processing features without setting up your own Stripe account initially.
Test Environment
The platform offers a test version of the Stripe API that you can use during development:
- Purpose: Development and testing only
- Limitations: Test mode transactions are not real and do not process actual payments
- Data: Test data will be periodically cleared
- Rate Limits: Shared test environment may have usage restrictions
Important Note
⚠️ For Production Use: If you need to deploy your application to production or process real payments, you must use your own Stripe account with your own API keys.
Setting Up Your Own Stripe Account
To use Stripe in production, you’ll need to create and configure your own Stripe account.
1. Create a Stripe Account
Follow these steps to get started:
- Visit Stripe’s official website
- Click “Start now” or “Sign up”
- Provide your email address and create a password
- Complete the registration process
2. Account Verification
To activate your account for live transactions:
- Business Information: Provide details about your business
- Identity Verification: Submit required identification documents
- Bank Account: Connect a bank account for payouts
- Tax Information: Complete tax documentation (varies by country)
Verification typically takes 1-3 business days, though it may vary depending on your location and business type.
3. Get Your API Keys
Once your account is created:
- Log in to your Stripe Dashboard
- Navigate to Developers → API keys
- You’ll find two types of keys:
- Test keys: For development and testing (starts with pk_test_andsk_test_)
- Live keys: For production use (starts with pk_live_andsk_live_)
 
- Test keys: For development and testing (starts with 
4. Configure Your Application
To use your own Stripe keys in Clacky:
- Store your API keys securely as environment variables
- Never commit API keys to your code repository
- Use test keys during development
- Switch to live keys only when deploying to production
Example environment configuration:
# .env.local
STRIPE_PUBLISHABLE_KEY=pk_test_your_key_here
STRIPE_SECRET_KEY=sk_test_your_key_here5. Configure Webhook Callback URLs
After deploying your application, you need to configure webhook endpoints in Stripe to receive real-time event notifications (such as successful payments, subscription updates, etc.).
Why Webhooks Are Important
Webhooks allow Stripe to notify your application when events happen in your Stripe account, such as:
- Successful payments
- Failed payment attempts
- Subscription status changes
- Refund processing
- Dispute notifications
Setting Up Webhooks
- Deploy Your Application: First, deploy your application to get your production URL
- Log in to Stripe Dashboard: Go to Stripe Dashboard
- Navigate to Webhooks: Click Developers → Webhooks
- Add Endpoint: Click “Add endpoint” button
- Enter Your Callback URL:
- For production: https://your-domain.com/integration/webhook/stripe
- For development: https://your-dev-domain.com/integration/webhook/stripe
- Replace with your actual deployed domain and webhook endpoint path
 
- For production: 
- Select Events: Choose which events you want to receive, or select “Listen to all events”
- Add Endpoint: Click “Add endpoint” to save
Important Notes
- Different URLs for Test and Live Mode: Configure separate webhook endpoints for test mode and live mode
- Webhook Signing Secret: After creating the webhook, Stripe will provide a signing secret (starts with whsec_). Store this securely:STRIPE_WEBHOOK_SECRET=whsec_your_webhook_secret_here
- Verify Webhook Signatures: Always verify webhook signatures in your code to ensure requests are from Stripe
- Handle Idempotency: Your webhook handler should be idempotent (safe to process the same event multiple times)
Testing Webhooks Locally
For local development, use the Stripe CLI to forward webhook events:
# Install Stripe CLI
stripe listen --forward-to localhost:3000/api/stripe/webhookWebhook Configuration Resources
- Webhooks Guide: Complete webhook documentation
- Webhook Events Reference: All available event types
- Webhook Best Practices: Security and reliability tips
Official Documentation
For comprehensive guidance on setting up and using Stripe:
- Stripe Documentation: Complete API reference and guides
- Quick Start Guide: Get started with Stripe in minutes
- Account Setup: Detailed account activation instructions
- Testing: Test card numbers and scenarios
- Security Best Practices: How to keep your integration secure
Frequently Asked Questions
Can I use the test environment for production?
No, the test environment is strictly for development and testing purposes. You must use your own Stripe account with live API keys for production applications.
What happens to my test data?
Test data created using the platform’s test environment may be periodically cleared. Always use your own Stripe test account for important development work.
How do I switch from test to production?
- Complete your Stripe account verification
- Update your environment variables with your live API keys
- Test thoroughly in your own Stripe test mode before going live
- Deploy your application with live keys
Is there a cost to create a Stripe account?
Creating a Stripe account is free. Stripe charges transaction fees only when you process real payments. Check Stripe’s pricing page for detailed information.
Which countries does Stripe support?
Stripe is available in 45+ countries. Visit Stripe’s global availability page to check if your country is supported.