Skip to main content
Ringee uses Stripe for managing credits, subscriptions, and phone number purchases.

Setup

1

Create a Stripe account

Go to stripe.com and create an account if you don’t have one.
2

Get your API keys

  1. In the Stripe dashboard, go to DevelopersAPI keys
  2. Copy your Secret key
For development, use test mode keys (prefix sk_test_). Switch to live keys only for production.
3

Set up webhooks

Ringee needs Stripe webhooks to process payment events:
  1. Go to DevelopersWebhooks
  2. Click Add endpoint
  3. Set the endpoint URL to: https://your-backend-url/api/stripe/webhook
  4. Select the events to listen to:
    • checkout.session.completed
    • customer.subscription.created
    • customer.subscription.updated
    • customer.subscription.deleted
    • invoice.payment_succeeded
    • invoice.payment_failed
  5. Copy the Signing secret
4

Configure environment variables

Add the following to your .env file:
STRIPE_SECRET_KEY="sk_test_your_secret_key"
STRIPE_WEBHOOK_SECRET="whsec_your_webhook_secret"

Environment Variables

VariableRequiredDescription
STRIPE_SECRET_KEYYesYour Stripe secret API key
STRIPE_WEBHOOK_SECRETYesWebhook signing secret for verifying events

Testing locally

For local development, use the Stripe CLI to forward webhook events:
stripe listen --forward-to localhost:3000/api/stripe/webhook
This will output a webhook signing secret that you can use as STRIPE_WEBHOOK_SECRET during development.
The Stripe CLI is the easiest way to test webhooks locally. Install it with brew install stripe/stripe-cli/stripe on macOS.