*Limited Launch Offer!Use code for 50% off (expires 12/31/2025)

Payments (Stripe)

Set up a Stripe account to handle payments for your serviceCRM instance.

Stripe

SlappShell serviceCRM uses Stripe for handling payments for upfront deposits and final invoicing.

To get started with Stripe for serviceCRM:

  1. Create a Stripe Account: Sign up at stripe.com.
  2. Get API Keys: From the Stripe dashboard, obtain your Publishable Key and Secret Key.
  3. Configure Webhooks: Set up webhooks to handle payment events and updates.

You will need the following details from your Stripe account:

  • Publishable Key: pk_live_... or pk_test_...
  • Secret Key: sk_live_... or sk_test_...
  • Webhook Secret: whsec_... (set this up in the Stripe dashboard or via the CLI for local testing)

Once your account settings are ready, create a test enviroment to continue developing locally. Switch to production keys and webhooks when ready to deploy.

Webhooks Setup

To set up webhooks for Stripe, follow these steps:

  1. In the Stripe Dashboard, navigate to Developers > Webhooks.
  2. Click on "Add endpoint" and enter the webhook URL https://your-domain.com/api/webhooks/stripe).
  3. Select the following events to listen for:
  • payment_intent.succeeded
  • payment_intent.payment_failed
  • payment_intent.canceled
  • payment_intent.requires_action
  • checkout.session.completed
  • checkout.session.expired
  1. Copy the webhook secret into the following Stripe Configuration .env variables: STRIPE_WEBHOOK_SECRET=

Stripe Environment Variables

# In your .env file, set the following:

NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY="pk_test_..."
STRIPE_SECRET_KEY="sk_test_..."
STRIPE_WEBHOOK_SECRET="whsec_..."
                

Start with env.template and rename it to env.local

For Local Development - Stripe CLI Webhook

# In your terminal, run the following command to forward Stripe webhooks to your local server:

$ stripe login
$ stripe listen --forward-to localhost:3000/api/webhooks/stripe
                

Copy the webhook secret from the CLI output and set it in your .env file