• Stars
    star
    314
  • Rank 133,353 (Top 3 %)
  • Language
    PHP
  • License
    MIT License
  • Created over 8 years ago
  • Updated 8 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Mollie API client wrapper for Laravel & Mollie Connect provider for Laravel Socialite

Mollie for Laravel

Laravel-Mollie incorporates the Mollie API and Mollie Connect into your Laravel or Lumen 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-mollie instead.

Build Status Latest Stable Version Total Downloads

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 >= 7.0
  • Laravel (or Lumen) >= 5.5
  • Laravel Socialite >= 3.0 (if you intend on using Mollie Connect)

Upgrading from v1.x?

To support the enhanced Mollie API, some breaking changes were introduced. Make sure to follow the instructions in the package migration guide.

Not ready to upgrade? The Laravel-Mollie client v1 will remain supported for now.

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": "^2.0"
}

Laravel-Mollie's service providers will be automatically registered using Laravel's auto-discovery feature.

Note: For Lumen you have to add the Mollie facade and service provider manually to: bootstrap/app.php :

$app->withFacades(true, ['Mollie\Laravel\Facades\Mollie' => 'Mollie']);

$app->register(Mollie\Laravel\MollieServiceProvider::class);

Configuration

You'll only need to add the MOLLIE_KEY variable to your .env file.

MOLLIE_KEY=test_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

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\Laravel\Facades\Mollie;

public function preparePayment()
{
    $payment = Mollie::api()->payments->create([
        "amount" => [
            "currency" => "EUR",
            "value" => "10.00" // You must send the correct number of decimals, thus we enforce the use of strings
        ],
        "description" => "Order #12345",
        "redirectUrl" => route('order.success'),
        "webhookUrl" => route('webhooks.mollie'),
        "metadata" => [
            "order_id" => "12345",
        ],
    ]);

    // 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::api()->payments->get($paymentId);

    if ($payment->isPaid())
    {
        echo 'Payment received.';
        // Do your thing ...
    }
}

Global helper method

For your convencience we've added the global mollie() helper function. It's an easy shortcut to the Mollie::api() facade accessor.

// Using facade accessor
$payment = \Mollie\Laravel\Facades\Mollie::api()->payments->get($payment_id);

// Using global helper function
$payment = mollie()->payments->get($payment_id);

Other examples

Roadmap

You can find the latest development roadmap for this package here. Feel free to open an issue if you have a feature request.

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

BSD (Berkeley Software Distribution) License. Copyright (c) 2016, Mollie B.V.

Support

Contact: www.mollie.com β€” [email protected] β€” +31 20-612 88 55

More Repositories

1

mollie-api-php

Mollie API client for PHP
PHP
542
star
2

mollie-api-node

Official Mollie API client for Node
TypeScript
236
star
3

laravel-cashier-mollie

Official Mollie integration for Laravel Cashier
PHP
137
star
4

WooCommerce

Official Mollie extension for WooCommerce
PHP
130
star
5

mollie-api-python

Mollie API client for Python
Python
110
star
6

magento2

Mollie Payments for Magento 2
PHP
101
star
7

mollie-api-ruby

Mollie API client for Ruby
Ruby
81
star
8

PrestaShop

iDEAL, Creditcard, Bancontact, SOFORT, Bank transfer, PayPal & paysafecard for Prestashop
PHP
66
star
9

OpenCart

iDEAL, Creditcard, Bancontact/Mister Cash, SOFORT, Belfius Direct Net, KBC/CBC Payment Button, Bank transfer, Bitcoin, PayPal & paysafecard for OpenCart 1.5.6+ and OpenCart 2.0+.
PHP
66
star
10

Shopware6

PHP
50
star
11

Magento

Mollie Payments for Magento 1.x
PHP
39
star
12

api-documentation

API Documentation for all of Mollie's public APIs.
SCSS
37
star
13

storybook-addon-ghostwriter

Storybook addon which helps you write stories faster.
JavaScript
26
star
14

mollie-odoo

Mollie Payments plugin for Odoo - an open source CRM and ERP
Python
25
star
15

oauth2-mollie-php

Mollie provider for league/oauth2-client
PHP
20
star
16

tf-provider-registry-api-generator

Generates static terraform provider registry API documents on Google Cloud Storage buckets
Go
19
star
17

php-coding-standards

Mollie PHP coding standards
PHP
18
star
18

Shopware

Official Mollie extension for Shopware
PHP
16
star
19

spree-mollie-gateway

Mollie payments for Spree Commerce.
Ruby
16
star
20

polyfill-libsodium

A polyfill for the transition from libsodium (the extension for PHP < 7.2) to sodium (as bundled with PHP 7.2)
PHP
14
star
21

components-examples

Examples and reference implementations for Mollie Components
JavaScript
13
star
22

reseller-api

Reseller API voor het aanmaken en beheren van Mollie-accounts
PHP
13
star
23

postman-collection

A postman collection for exploring the Mollie API
10
star
24

mollie-oxid

Mollie Payments for OXID eSales
PHP
7
star
25

PhpStorm

PhpStorm plugin for improved Smarty support
Java
6
star
26

join-us

Guide on how to join Mollie
6
star
27

mollie-JTL

Mollie payments plugin for JTL-Shop
PHP
5
star
28

osCommerce

iDEAL, Creditcard, Bancontact/Mister Cash, SOFORT, Bank transfer, Bitcoin, PayPal & paysafecard for osCommerce
PHP
5
star
29

magento2-hyva-compatibility

HTML
5
star
30

gambio

PHP
4
star
31

wordpress-donate-with-mollie

Accept donations on your WordPress website using your Mollie account.
PHP
4
star
32

eslint-config-mollie

ESLint shareable config for the Mollie Javascript repos.
JavaScript
4
star
33

Sylius

Mollie payment gateway integration for Sylius
PHP
4
star
34

demo-checkout-backend

PHP
3
star
35

partner-demo

PHP
3
star
36

crowdin-cli

A Crowdin CLI tool to collect, upload, and download translations from a Crowdin project.
TypeScript
3
star
37

thirtybees

Mollie Payments module for thirty bees, a fork of Prestashop
PHP
3
star
38

magento2-subscriptions

PHP
3
star
39

SalesforceCommerceCloud

JavaScript
3
star
40

jtl5

Mollie payments office plugin for JTL-Shop 5
PHP
2
star
41

codeo

JavaScript
2
star
42

magento2-hyva-checkout

PHP
2
star
43

demo-checkout-android

Kotlin
2
star
44

mollie-reaction-commerce

Mollie Payments for Reaction Commerce
JavaScript
2
star
45

magento2-hyva-react-checkout

JavaScript
2
star
46

commercetools

Official Mollie integration for CommerceTools
TypeScript
2
star
47

demo-checkout-ios

Swift
2
star
48

Shopware6Composables

Vue
1
star
49

magento2-scandipwa

JavaScript
1
star
50

terraform-filtered-list

Go
1
star
51

orocommerce

Official Mollie plugin for OroCommerce
PHP
1
star
52

PrestaShop1.6

PHP
1
star