Mollie API client wrapper for Laravel & Mollie Connect provider for Laravel Socialite
mollie/laravel-mollie is a Laravel package for mollie api client wrapper for laravel & mollie connect provider for laravel socialite.
It currently has 361 GitHub stars and 4.761.030 downloads on Packagist (latest version v4.1.0).
Install it with composer require mollie/laravel-mollie.
Discover more Laravel packages by mollie
or browse all Laravel packages to compare alternatives.
Last updated
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.
To support the enhanced Mollie API v3, some breaking changes were introduced. Make sure to follow the instructions in the upgrade guide.
Fresh install? Continue with the installation guide below.
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": "^4.0"
}
Laravel-Mollie's service providers will be automatically registered using Laravel's auto-discovery feature.
You'll only need to add the MOLLIE_KEY variable to your .env file.
MOLLIE_KEY=test_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Here you can see an example of just how simple this package is to use.
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: new Money('EUR', '10.00'),
redirectUrl: route('order.success'),
webhookUrl: route('webhooks.mollie'),
metadata: [
"order_id" => "12345",
"customer_info" => [
"name" => "John Doe",
"email" => "[email protected]"
]
]
);
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 ...
}
}
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.
The MIT License. Copyright (c) 2024, Mollie B.V.
Contact: www.mollie.com — [email protected]