mollie / laravel-mollie
Mollie API client wrapper for Laravel & Mollie Connect provider for Laravel Socialite
Requires
- php: ^8.2
- ext-json: *
- illuminate/support: ^11.0|^12.0|^13.0
- laravel/prompts: ^0.3.7
- mollie/mollie-api-php: ^4.0
Requires (Dev)
- larastan/larastan: ^3.8
- laravel/pint: ^1.25
- laravel/socialite: ^5.23
- orchestra/testbench: ^9.0|^10.0|^11.0
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^11.0|^12.5.22|^13.0
Suggests
- laravel/socialite: Use Mollie Connect (OAuth) to authenticate via Laravel Socialite with the Mollie API. This is needed for some endpoints.
Provides
None
Conflicts
None
Replaces
None
- dev-master
- v5.0.0
- v4.1.2
- v4.1.1
- v4.1.0
- v4.0.2
- v4.0.1
- v4.0.0
- v3.1.0
- v3.0.0
- v2.25.0
- v2.24.0
- v2.24.0-beta
- v2.23.0
- v2.22.0
- v2.21.1
- v2.21.0
- v2.20.2
- v2.20.1
- v2.20.0
- v2.19.2
- v2.19.1
- v2.19.0
- v2.18.0
- v2.17.0
- v2.16.0
- v2.15.0
- v2.14.0
- v2.13.0
- v2.12.0
- v2.11.0
- v2.10.0
- v2.9.0
- v2.8.0
- v2.7.1
- v2.7.0
- v2.6.0
- v2.5.0
- v2.4.1
- v2.4.0
- v2.3.1
- v2.3.0
- v2.2.0
- v2.1.0
- v2.0.0
- v2.0.0-beta1
- v1.5.1
- v1.5.0
- v1.4.2
- v1.4.1
- 1.3.0
- 1.2.1
- 1.2.0
- 1.1.3
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.0
- dev-feat/mollie-api-php-v4-269
- dev-fix/webhook-signing-secret-rotation
- dev-feat/laravel-13-compatibility
- dev-feat/use-set-token-for-universal-authentication
- dev-fix/257-include-query-parameters-in-request-uri
- dev-fix/service-provider-remove-deferrable-provider-implementation
- dev-v3-dev
- dev-feat/v4-improvements
- dev-provide-laravel-11-compatibiity
- dev-pr-237
- dev-add-create-client-endpoint
- dev-ZsoltMollie-patch-1
This package is auto-updated.
Last update: 2026-10-16 11:47:10 UTC
README
Mollie for Laravel
Laravel-Mollie incorporates the Mollie API and Mollie Connect into your Laravel project.
Accepting iDEAL, Apple Pay, Bancontact/Mister Cash, SOFORT Banking, Creditcard, SEPA Bank transfer, SEPA Direct debit, PayPal, Belfius Direct Net, KBC/CBC, paysafecard, ING Home'Pay, Giftcards, Giropay, EPS and Przelewy24 online payments without fixed monthly costs or any punishing registration procedures. Just use the Mollie API to receive payments directly on your website or easily refund transactions to your customers.****
Looking for a complete recurring billing solution? Take a look at Laravel Cashier for Mollie instead.
Requirements
- Get yourself a free Mollie account. No sign up costs.
- Now you're ready to use the Mollie API client in test mode.
- Follow a few steps to enable payment methods in live mode, and let us handle the rest.
- Up-to-date OpenSSL (or other SSL/TLS toolkit)
- PHP >= 8.2
- Laravel >= 11.0
- Laravel Socialite >= 5.0 (if you intend on using Mollie Connect)
Upgrading?
To support mollie-api-php v4, some breaking changes were introduced. Make sure to follow the instructions in the upgrade guide.
Fresh install? Continue with the installation guide below.
Installation
Add Laravel-Mollie to your composer file via the composer require command:
composer require mollie/laravel-mollie
Or add it to composer.json manually:
"require": { "mollie/laravel-mollie": "^5.0" }
Laravel-Mollie's service providers will be automatically registered using Laravel's auto-discovery feature.
Configuration
You'll only need to add the MOLLIE_KEY variable to your .env file.
MOLLIE_KEY=test_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
The SDK uses a linear retry strategy by default. To use the v4 exponential strategy for temporary network failures and HTTP 429 rate limits, set:
MOLLIE_RETRY_STRATEGY=exponential MOLLIE_RETRY_MAX_RETRIES=5 MOLLIE_RETRY_DELAY_MS=1000 MOLLIE_RETRY_EXPONENTIAL_MULTIPLIER=2.0 MOLLIE_RETRY_EXPONENTIAL_MAX_DELAY_MS=30000 MOLLIE_RETRY_EXPONENTIAL_JITTER=true
Example usage
Here you can see an example of just how simple this package is to use.
A payment using the Mollie API
use Mollie\Api\Http\Data\Money; use Mollie\Laravel\Facades\Mollie; use Mollie\Api\Http\Requests\GetPaymentRequest; use Mollie\Api\Http\Requests\CreatePaymentRequest; public function preparePayment() { $request = new CreatePaymentRequest( description: 'Order #12345', amount: Money::of('EUR')->fromString('10.00'), redirectUrl: route('order.success'), webhookUrl: route('webhooks.mollie'), metadata: [ "order_id" => "12345", "customer_info" => [ "name" => "John Doe", "email" => "john@example.com" ] ] ); $payment = Mollie::send($request); // redirect customer to Mollie checkout page return redirect($payment->getCheckoutUrl(), 303); } /** * After the customer has completed the transaction, * you can fetch, check and process the payment. * This logic typically goes into the controller handling the inbound webhook request. * See the webhook docs in /docs and on mollie.com for more information. */ public function handleWebhookNotification(Request $request) { $paymentId = $request->input('id'); $payment = Mollie::send(new GetPaymentRequest($paymentId)); if ($payment->isPaid()) { echo 'Payment received.'; // Do your thing ... } }
Other examples
- Process realtime status updates with a webhook
- Recurring payments and direct charges
- Using Mollie Connect with Laravel Socialite (OAuth) (Leverage the Mollie platform for advanced payment use cases)
Want to help us make our Laravel module even better?
Want to help us make our Laravel module even better? We take pull requests, sure. But how would you like to contribute to a technology oriented organization? Mollie is hiring developers and system engineers. Check out our vacancies or get in touch.
License
The MIT License. Copyright (c) 2024, Mollie B.V.
Support
Contact: www.mollie.com — info@mollie.com