2017-25 © Pedro Peláez
 

library mollie

Mollie driver for the Omnipay payment processing library

image

omnipay/mollie

Mollie driver for the Omnipay payment processing library

  • Friday, July 27, 2018
  • by Barryvdh
  • Repository
  • 10 Watchers
  • 37 Stars
  • 339,133 Installations
  • PHP
  • 8 Dependents
  • 0 Suggesters
  • 24 Forks
  • 11 Open issues
  • 20 Versions
  • 6 % Grown

The README.md

Omnipay: Mollie

Mollie driver for the Omnipay PHP payment processing library, (*1)

Unit Tests Latest Stable Version Total Downloads, (*2)

Omnipay is a framework agnostic, multi-gateway payment processing library for PHP. This package implements Mollie support for Omnipay., (*3)

Installation

Omnipay is installed via Composer. To install, simply require league/omnipay and omnipay/mollie with Composer:, (*4)

composer require league/omnipay omnipay/mollie

Basic Usage

The following gateways are provided by this package:, (*5)

  • Mollie

For general usage instructions, please see the main Omnipay repository., (*6)

Basic purchase example

$gateway = \Omnipay\Omnipay::create('Mollie');  
$gateway->setApiKey('test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM');

$response = $gateway->purchase(
    [
        "amount" => "10.00",
        "currency" => "EUR",
        "description" => "My first Payment",
        "returnUrl" => "https://webshop.example.org/mollie-return.php"
    ]
)->send();

// Process response
if ($response->isSuccessful()) {

    // Payment was successful
    print_r($response);

} elseif ($response->isRedirect()) {

    // Redirect to offsite payment gateway
    $response->redirect();

} else {

    // Payment failed
    echo $response->getMessage();
}

Example using the Order API

  1. Create the order and pass the order items in the parameters.
$response = $gateway->createOrder(
    [
           'amount'       => '1027.99',
            'currency'     => 'EUR',
            'orderNumber'  => '1337',
            'lines'        => [
                [
                    'type' => 'physical',
                    'sku' => '5702016116977',
                    'name' => 'LEGO 42083 Bugatti Chiron',
                    'productUrl' => 'https://shop.lego.com/nl-NL/Bugatti-Chiron-42083',
                    'imageUrl' => 'https://sh-s7-live-s.legocdn.com/is/image//LEGO/42083_alt1?$main$',
                    'quantity' => 2,
                    'vatRate' => '21.00',
                    'unitPrice' => '399.00',
                    'totalAmount' => '698.00',
                    'discountAmount' => '100.00',
                    'vatAmount' => '121.14',
                ],
                [
                    'type' => 'physical',
                    'sku' => '5702015594028',
                    'name' => 'LEGO 42056 Porsche 911 GT3 RS',
                    'productUrl' => 'https://shop.lego.com/nl-NL/Porsche-911-GT3-RS-42056',
                    'imageUrl' => 'https://sh-s7-live-s.legocdn.com/is/image/LEGO/42056?$PDPDefault$',
                    'quantity' => 1,
                    'vatRate' => '21.00',
                    'unitPrice' => '329.99',
                    'totalAmount' => '329.99',
                    'vatAmount' => '57.27',
                ]
            ],
            'card' => [
                'company' => 'Mollie B.V.',
                'email' => 'norris@chucknorrisfacts.net',
                'birthday' => '1958-01-31',
                'billingTitle' => 'Dhr',
                'billingFirstName' => 'Piet',
                'billingLastName' => 'Mondriaan',
                'billingAddress1' => 'Keizersgracht 313',
                'billingCity' => 'Amsterdam',
                'billingPostcode' => '1234AB',
                'billingState' => 'Noord-Holland',
                'billingCountry' => 'NL',
                'billingPhone' => '+31208202070',
                'shippingTitle' => 'Mr',
                'shippingFirstName' => 'Chuck',
                'shippingLastName' => 'Norris',
                'shippingAddress1' => 'Prinsengracht 313',
                'shippingAddress2' => '4th floor',
                'shippingCity' => 'Haarlem',
                'shippingPostcode' => '5678AB',
                'shippingState' => 'Noord-Holland',
                'shippingCountry' => 'NL',
            ],
            'metadata' => [
                'order_id' => '1337',
                'description' => 'Lego cars',
            ],
            'locale' => 'nl_NL',
            'returnUrl'    => 'https://example.org/redirect',
            'notifyUrl'    => 'https://example.org/webhook',
            'paymentMethod' => 'klarnapaylater',
            'billingEmail' => 'piet@mondriaan.com',
    ]
)->send();

// Process response
if ($response->isSuccessful()) {

    // Payment was successful
    print_r($response);

} elseif ($response->isRedirect()) {

    // Redirect to offsite payment gateway
    $response->redirect();

} else {

    // Payment failed
    echo $response->getMessage();
}
  1. On return/notify, complete the order. This will not always be completed, because for Klarna the shipments needs to be created first.
$response = $gateway->completeOrder(
    [
        "transactionReference" => "ord_xxxx",
    ]
)->send();
  1. When shipping the items, create the shipment for this order. You can leave the items emtpy to ship all items.
$response = $gateway->createShipment(
    [
        "transactionReference" => "ord_xxx",
        'items' => [
            [
                'id' => 'odl_xxx',
                'quantity' => 1,
            ]
        ]
    ]
)->send();
  1. As long as the order is created, authorized or shipping, it may be cancelled (voided)
$response = $gateway->void(["transactionReference" => "ord_xxx"])->send();

Support

If you are having general issues with Omnipay, we suggest posting on Stack Overflow. Be sure to add the omnipay tag so it can be easily found., (*7)

If you want to keep up to date with release announcements, discuss ideas for the project, or ask more detailed questions, there is also a mailing list which you can subscribe to., (*8)

If you believe you have found a bug, please report it using the GitHub issue tracker, or better yet, fork the library and submit a pull request., (*9)

The Versions

27/07 2018

dev-master

9999999-dev https://github.com/thephpleague/omnipay-mollie

Mollie driver for the Omnipay payment processing library

  Sources   Download

MIT

The Requires

 

The Development Requires

by Adrian Macneil

payment pay gateway merchant omnipay mollie

27/07 2018

v5.0.2

5.0.2.0 https://github.com/thephpleague/omnipay-mollie

Mollie driver for the Omnipay payment processing library

  Sources   Download

MIT

The Requires

 

The Development Requires

by Adrian Macneil

payment pay gateway merchant omnipay mollie

24/07 2018

v5.0.1

5.0.1.0 https://github.com/thephpleague/omnipay-mollie

Mollie driver for the Omnipay payment processing library

  Sources   Download

MIT

The Requires

 

The Development Requires

by Adrian Macneil

payment pay gateway merchant omnipay mollie

24/07 2018

v5.0.0

5.0.0.0 https://github.com/thephpleague/omnipay-mollie

Mollie driver for the Omnipay payment processing library

  Sources   Download

MIT

The Requires

 

The Development Requires

by Adrian Macneil

payment pay gateway merchant omnipay mollie

15/05 2018

4.0.x-dev

4.0.9999999.9999999-dev https://github.com/thephpleague/omnipay-mollie

Mollie driver for the Omnipay payment processing library

  Sources   Download

MIT

The Requires

 

The Development Requires

by Adrian Macneil

payment pay gateway merchant omnipay mollie

15/05 2018

v4.0.1

4.0.1.0 https://github.com/thephpleague/omnipay-mollie

Mollie driver for the Omnipay payment processing library

  Sources   Download

MIT

The Requires

 

The Development Requires

by Adrian Macneil

payment pay gateway merchant omnipay mollie

14/05 2018

v4.0.0

4.0.0.0 https://github.com/thephpleague/omnipay-mollie

Mollie driver for the Omnipay payment processing library

  Sources   Download

MIT

The Requires

 

The Development Requires

by Adrian Macneil

payment pay gateway merchant omnipay mollie

20/03 2018

v4.0-alpha.1

4.0.0.0-alpha1 https://github.com/thephpleague/omnipay-mollie

Mollie driver for the Omnipay payment processing library

  Sources   Download

MIT

The Requires

 

The Development Requires

by Adrian Macneil

payment pay gateway merchant omnipay mollie

11/10 2016

3.2.x-dev

3.2.9999999.9999999-dev https://github.com/thephpleague/omnipay-mollie

Mollie driver for the Omnipay payment processing library

  Sources   Download

MIT

The Requires

 

The Development Requires

by Adrian Macneil

payment pay gateway merchant omnipay mollie

11/10 2016

v3.2.0

3.2.0.0 https://github.com/thephpleague/omnipay-mollie

Mollie driver for the Omnipay payment processing library

  Sources   Download

MIT

The Requires

 

The Development Requires

by Adrian Macneil

payment pay gateway merchant omnipay mollie

14/09 2016

v3.1

3.1.0.0 https://github.com/thephpleague/omnipay-mollie

Mollie driver for the Omnipay payment processing library

  Sources   Download

MIT

The Requires

 

The Development Requires

by Adrian Macneil

payment pay gateway merchant omnipay mollie

21/02 2016

3.0.5

3.0.5.0 https://github.com/thephpleague/omnipay-mollie

Mollie driver for the Omnipay payment processing library

  Sources   Download

MIT

The Requires

 

The Development Requires

by Adrian Macneil

payment pay gateway merchant omnipay mollie

03/03 2015

v3.0.4

3.0.4.0 https://github.com/thephpleague/omnipay-mollie

Mollie driver for the Omnipay payment processing library

  Sources   Download

MIT

The Requires

 

The Development Requires

by Adrian Macneil

payment pay gateway merchant omnipay mollie

15/10 2014

3.0.3

3.0.3.0 https://github.com/thephpleague/omnipay-mollie

Mollie driver for the Omnipay payment processing library

  Sources   Download

MIT

The Requires

 

The Development Requires

by Adrian Macneil

payment pay gateway merchant omnipay mollie

07/10 2014

v3.0.2

3.0.2.0 https://github.com/thephpleague/omnipay-mollie

Mollie driver for the Omnipay payment processing library

  Sources   Download

MIT

The Requires

 

The Development Requires

by Adrian Macneil

payment pay gateway merchant omnipay mollie

17/09 2014

v3.0.1

3.0.1.0 https://github.com/thephpleague/omnipay-mollie

Mollie driver for the Omnipay payment processing library

  Sources   Download

MIT

The Requires

 

The Development Requires

by Adrian Macneil

payment pay gateway merchant omnipay mollie

14/04 2014

v3.0.0

3.0.0.0 https://github.com/omnipay/mollie

Mollie driver for the Omnipay payment processing library

  Sources   Download

MIT

The Requires

 

The Development Requires

by Adrian Macneil

payment pay gateway merchant omnipay mollie

22/12 2013

v2.0.2

2.0.2.0 https://github.com/omnipay/mollie

Mollie driver for the Omnipay payment processing library

  Sources   Download

MIT

The Requires

 

The Development Requires

by Adrian Macneil

payment pay gateway merchant omnipay mollie

24/11 2013

v2.0.1

2.0.1.0 https://github.com/omnipay/mollie

Mollie driver for the Omnipay payment processing library

  Sources   Download

MIT

The Requires

 

The Development Requires

by Adrian Macneil

payment pay gateway merchant omnipay mollie

17/11 2013

v2.0.0

2.0.0.0 https://github.com/omnipay/mollie

Mollie driver for the Omnipay payment processing library

  Sources   Download

MIT

The Requires

 

The Development Requires

by Adrian Macneil

payment pay gateway merchant omnipay mollie