Download the PHP package einenlum/cashier-paddle-webhooks without Composer
On this page you can find all versions of the php package einenlum/cashier-paddle-webhooks. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download einenlum/cashier-paddle-webhooks
More information about einenlum/cashier-paddle-webhooks
Files in einenlum/cashier-paddle-webhooks
Package cashier-paddle-webhooks
Short Description A package to automatically listen to Paddle Webhooks in local development with Laravel Cashier
License MIT
Homepage https://github.com/einenlum/cashier-paddle-webhooks
Informations about the package cashier-paddle-webhooks
cashier-paddle-webhooks
A package to automatically listen to Paddle Webhooks in local development with Laravel Cashier
This package allows you to setup Paddle webhooks locally in just one command, thanks to tunnelmole. When the command is killed, it removes the webhook from Paddle. The library only works in sandbox mode.
This is heavily inspired from this awesome command made by the LemonSqueezy team for their Laravel package. Kudo to them! :heart:
The difference with the original package is that Paddle doesn't allow to create a webhook with a specific webhook secret. It's automatically generated by Paddle (on the contrary to LemonSqueezy). This means I had to add a few steps to make it work.
This library relies on cache to temporarily override the webhook secret.
Requirements
laravel/cashier-paddle:^2.6tunnelmole(see instructions here)
This library does not work on Windows (because of signal handling).
You will also need to setup at least these envs:
Installation
You should then add this in your AppServiceProvider:
This must be done in the register method and not the boot one. See here.
This will allow the package to override the webhook page that is declared by Cashier Paddle. We must override it to use our Middleware instead of Cashier's one, because we need to get the Webhook secret from the cache if it exists.
You can publish the config file with:
This is the contents of the published config file:
Usage
This will create a tunnel thanks to tunnelmole which listens to http://localhost:8000, create a webhook on Paddle sandbox, fetch its id and secret, and set the secret into cache (whatever your cache setup is). When the command is killed, it removes the webhook from Paddle and removes the key from the cache.
Then in the VerifyPaddleWebhookMiddleware, the cached secret key is used if it exists and if you are not in production.
You can change the port with
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Credits
- Dries Vints for his great library lmsqueezy/laravel
- Spatie team for creating the spatie/package-skeleton-laravel template
Other projects of mine
- human-replay: Make text appear exactly how you typed it. Copy paste a few JS lines.
- tailwind-alchemist: A CLI tool to find and replace Tailwind CSS colors 🪄
- yaml-revealer: A vim plugin to easily navigate through Yaml files
License
The MIT License (MIT). Please see License File for more information.
All versions of cashier-paddle-webhooks with dependencies
illuminate/contracts Version ^11.0||^12.0
laravel/cashier-paddle Version ^2.6
spatie/laravel-package-tools Version ^1.16