Stripe Configuration
CleverThis uses Stripe for payment processing: credit top-ups, customer portal sessions, and webhook-driven balance updates. You need a Stripe account and three configuration values.
1. Create a Stripe account
Go to stripe.com and create an account. Activate your account to access live mode keys. Use test mode keys (sk_test_...) during initial setup.
2. Get your API keys
From the Stripe Dashboard → Developers → API Keys:
- Copy the Secret key (
sk_live_...orsk_test_...) → set asSTRIPE_SECRET_KEY - Copy the Publishable key (
pk_live_...orpk_test_...) → set asSTRIPE_PUBLISHABLE_KEY
3. Configure the webhook
CleverThis needs to receive Stripe webhook events to process completed payments and update wallet balances.
- In the Stripe Dashboard → Developers → Webhooks, click Add endpoint.
- Set the endpoint URL to:
https://your-domain.com/api/billing/stripe/webhook - Select the following events to listen for:
checkout.session.completedcustomer.subscription.deletedinvoice.payment_succeededinvoice.payment_failed
- Click Add endpoint, then reveal the Signing secret → set as
STRIPE_WEBHOOK_SECRET.
4. Set environment variables
STRIPE_SECRET_KEY=sk_live_...
STRIPE_PUBLISHABLE_KEY=pk_live_...
STRIPE_WEBHOOK_SECRET=whsec_...
Testing webhooks locally
Use the Stripe CLI to forward webhooks to your local dev server:
stripe listen --forward-to localhost:8000/api/billing/stripe/webhook
The CLI prints a temporary webhook signing secret to use for local development.
Coming soon
Subscription-based plan tier management (Pro, Enterprise plans billed via Stripe subscriptions) is being added.