💰 Payments

Stripe integration

This guide will walk you through the process of setting up Stripe payments and running it locally with a webhook listener.

Prerequisites

  • A Stripe account (you can sign up at stripe.com)

Step 1: Set Up

  1. Log in to your Stripe Dashboard.
  2. Navigate to the API keys section.
  3. Copy your publishable key and secret key.

Step 2: Configure Environment Variables

Add keys to your .env.local file in your project root directory

NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=your_publishable_key_here
STRIPE_SECRET_KEY=your_secret_key_here

Webhook secret key can be found here

STRIPE_WEBHOOK_SECRET=your_webhook_secret_here

Step 3: Run the Webhook Listener

Start your webhook listener using:

pnpm run stripe

It will ask you to login, once done it will listen for events and forward them to your local server.

Well done! You can now start taking payments.