Stripe setup

Stripe is a popular payment gateway that is used by many web applications. It is easy to set up and has a great API. In this section, we will show you how to set up Stripe.

Configure account

Sign up for a new Stripe account and set up payment processing. Then, follow these steps:

  1. Go to your settings, find "Public Details` and enter your website URL.
  2. In Branding, upload your logo and select your color scheme.
  3. Enable email notifications for successful payments and refunds under Customer Emails.
  4. Activate the link to your customer portal in Customer Portal for future use
  5. Use the search function to find Fraud Prevention > Rules and enable the first 3DS rule for extra security. It's a good idea to also activate the second 3DS rule.
  6. Ensure to block any payments where the CVC verification fails.

Create a product

  1. Switch on Test Mode to run trials without processing real transactions.
  2. Create a new product here
  3. Copy the price ID for later use (Example: price_1Oig4tF0OUXipSzGYnvsYC1U)
  4. Create keys by going to API Keys
  5. Copy the Publishable key and Secret key for later use and paste them into the .env file.
    STRIPE_KEY=publishable-key
    STRIPE_SECRET=ystripe-secret

    Stripe is using webhooks to notify our app about payments. Laravel Cashier provides an endpoint /stripe/webhook to handle these webhooks.


When testing locally we need to configure Stripe to send webhooks to our local environment.

  1. Go to Webooks, click Add local listener and follow the guide.
  2. Copy the signing secret and paste it into the .env file.
    STRIPE_WEBHOOK_SECRET=whsec_.....


    Stripe is now set up and ready to use. To setup a payment checkout in the application, move on to Payments.