noaber / lunar-mollie
Mollie payment driver for LunarPHP.
Installs: 38
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/noaber/lunar-mollie
Requires
- php: ^8.2
- laravel/framework: ^11.0 | ^12.0
- lunarphp/core: ^1.0
- mollie/laravel-mollie: ^v4.0.0
Requires (Dev)
- mockery/mockery: ^1.4.4
- orchestra/testbench: ^9.0
- pestphp/pest: ^2.0
- phpunit/phpunit: ^10.5
This package is auto-updated.
Last update: 2026-02-23 14:52:34 UTC
README
Mollie payment driver for LunarPHP v1.x using Mollie SDK v4
Installation
Require the composer package
composer require noaber/lunar-mollie
Publish the Mollie configuration
Use the below command to publish the configuration file to config/lunar/mollie.php.
php artisan vendor:publish --tag=lunar.mollie.config
Enable the payment driver
Set the driver in config/lunar/payments.php
<?php return [ // ... 'types' => [ 'paynl' => [ 'driver' => 'mollie', ], ], ];
Add your Mollie credentials and other config
Take a look at the configuration in config/lunar/paynl.php.
Where appropriate, edit or set the environment variables in your .env file. At least the keys will need to be set.
MOLLIE_KEY="YOUR_KEY" MOLLIE_CHECKOUT_SUCCESS="/your-url-to-thank-you-page"
You can use the Mollie Test key to switch between live and test mode.
create named routes for success and cancellation pages
When the user returns form the payment provider webpage, a redirect will be generated, based on the result of the payment. Therefore there have to be four named routed, as defined in the config.
<?php 'payment_paid_route' => 'checkout-success.view', 'payment_canceled_route' => 'checkout-canceled.view', 'payment_open_route' => 'checkout-open.view', 'payment_failed_route' => 'checkout-failure.view',
or create urls using the .env variables (eg: when using a headless CMS and custom urls)
MOLLIE_CHECKOUT_SUCCESS="order-confirmed" #will redirect to url.tld/order-confirmed MOLLIE_CHECKOUT_CANCELED="your-url-canceled" #will redirect to url.tld/your-url-canceled MOLLIE_CHECKOUT_OPEN="your-url-open" #will redirect to url.tld/your-url-open MOLLIE_CHECKOUT_FAILURE="your-url-failure" #will redirect to url.tld/your-url-failure
Example
To start a payment:
<?php $payment = \Lunar\Facades\Payments::driver('mollie') ->cart($this->cart) ->withData([ 'description' => 'Description', 'redirectRoute' => config('lunar.mollie.redirect_route'), 'webhookUrl' => config('lunar.mollie.override_webhook_url') ?: route(config('lunar.mollie.webhook_route')), 'method' => $paymentMethod, 'bank' => $bankID, // optional 'extra1' => '', // optional 'extra2' => '', // optional 'extra3' => '', // optional ]) ->initiatePayment(); return redirect($payment->getRedirectUrl());