Dalton McCleeryDalton McCleery & Taylor RobbinsDalton McCleery & Taylor Robbins

Dalton McCleery

Full-Stack Web Developer and Laravel Artisan

Connect With Me

Podcasts

Back to HomeAll Blog Posts

Testing Laravel Cashier webhooks locally without Ngrok.

This is the piece of documentation that I don't like about Laravel Cashier Paddle. It's not Laravel's fault, it's not even Paddle's fault. It's just a limitation working locally with payment providers and how they handle their webhooks.

The Problem

I want to end-to-end test a Paddle transaction on my local development environment without exposing an ngrok tunnel.

The Solution

So I've created a new package called Cashier Paddle Webhook Tester. Long name I know, but cool premise.

It's a simple Laravel package that lets you do two things:

Listen for Paddle events locally and fire the appropriate Cashier webhook handler, without Ngrok.

php artisan tester:paddle-listen

This command will start an continuous listener that reacts to Paddle events as they happen and then fire Cashier webhook handlers. It is calling the Paddle Event API under the hood - no actual Paddle webhooks are created or maintained on your account.

Replay Paddle events in the order they were fired.

php artisan tester:paddle-replay

Let's say you didn't have the listen command running when you tested a few things, but still wanted your local environment to react and process those events. With this command, you can replay those events and keep your local environment in sync with your Paddle account.

What about Stripe?

Don't worry, I've got you covered. I've created a similar package for Stripe called Cashier Stripe Webhook Tester. It follows the same conventions as the Paddle package.

php artisan tester:stripe-listen
php artisan tester:stripe-replay