2017 © Pedro Peláez
 

library laravel-omnipay

Integerates Omnipay with Laravel and provides an easy configuration.

image

ignited/laravel-omnipay

Integerates Omnipay with Laravel and provides an easy configuration.

  • Wednesday, February 8, 2017
  • by alexw23
  • Repository
  • 16 Watchers
  • 332 Stars
  • 176,341 Installations
  • PHP
  • 5 Dependents
  • 0 Suggesters
  • 63 Forks
  • 8 Open issues
  • 11 Versions
  • 7 % Grown

The README.md

Omnipay for Laravel & Lumen

Total Downloads Latest Version, (*1)

Integrates the Omnipay PHP library with Laravel to make Configuring multiple payment tunnels a breeze!, (*2)

Installation

Include the laravel-omnipay package as a dependency in your composer.json:, (*3)

composer require ignited/laravel-omnipay "3.*"

Note: You don't need to include the omnipay/common in your composer.json - it has already been included laravel-omnipay., (*4)

Install Required Providers

Now just include each gateway as you require, to included PayPal for example:, (*5)

composer require omnipay/paypal "3.*"

Alternatively you can include every gateway by the following:, (*6)

composer require omnipay/omnipay "3.*"

Note: this requires a large amount of composer work as it needs to fetch each seperate repository. This is not recommended., (*7)

Configuration

You can publish the configuration files using the vendor:publish command., (*8)

php artisan vendor:publish --provider="Ignited\LaravelOmnipay\LaravelOmnipayServiceProvider" --tag=config

Once you have published the configuration files, you can add your gateway options to the config file in config/laravel-omnipay.php., (*9)

PayPal Express Example

Here is an example of how to configure password, username and, signature with paypal express checkout driver, (*10)

...
'gateways' => [
    'paypal' => [
        'driver'  => 'PayPal_Express',
        'options' => [
            'username'  => 'coolusername',
            'password'  => 'strongpassword',
            'signature' => '',
            'solutionType' => '',
            'landingPage'    => '',
            'headerImageUrl' => '',
            'brandName' =>  'Your app name',
            'testMode' => true
        ]
    ],
]
...

Usage

$cardInput = [
    'number'      => '4444333322221111',
    'firstName'   => 'MR. WALTER WHITE',
    'expiryMonth' => '03',
    'expiryYear'  => '16',
    'cvv'         => '333',
];

$card = Omnipay::creditCard($cardInput);

$response = Omnipay::purchase([
    'amount'    => '100.00',
    'returnUrl' => 'http://bobjones.com/payment/return',
    'cancelUrl' => 'http://bobjones.com/payment/cancel',
    'card'      => $cardInput
])->send();

dd($response->getMessage());

This will use the gateway specified in the config as default., (*11)

However, you can also specify a gateway to use., (*12)

Omnipay::setGateway('paypal');

$response = Omnipay::purchase([
    'amount' => '100.00',
    'card'   => $cardInput
])->send();

dd($response->getMessage());

In addition you can make an instance of the gateway., (*13)

$gateway = Omnipay::gateway('paypal');

Installation on Other Frameworks

Lumen

For Lumen add the following in your bootstrap/app.php, (*14)

$app->register(Ignited\LaravelOmnipay\LumenOmnipayServiceProvider::class);

Copy the laravel-omnipay.php file from the config directory to config/laravel-omnipay.php, (*15)

And also add the following to bootstrap/app.php, (*16)

$app->configure('laravel-omnipay');

Guzzle

If you are using Guzzle 6 you need to require the following package., (*17)

composer require php-http/guzzle6-adapter

Guzzle 7 now implements a PSR http client compliant adapter. So there is no need to include this., (*18)

License

This package is open-sourced software licensed under the MIT license., (*19)

The Versions

08/02 2017

dev-master

9999999-dev

Integerates Omnipay with Laravel and provides an easy configuration.

  Sources   Download

The Requires

 

by Alex Whiteside

laravel omnipay payments laravel5

08/02 2017

2.3.0

2.3.0.0

Integerates Omnipay with Laravel and provides an easy configuration.

  Sources   Download

The Requires

 

by Alex Whiteside

laravel omnipay payments laravel5

06/09 2016

2.2.0

2.2.0.0

Integerates Omnipay with Laravel and provides an easy configuration.

  Sources   Download

The Requires

 

by Alex Whiteside

laravel omnipay payments laravel5

03/09 2015

2.0.x-dev

2.0.9999999.9999999-dev

Integerates Omnipay with Laravel and provides an easy configuration.

  Sources   Download

The Requires

 

by Alex Whiteside

laravel omnipay payments laravel5

03/09 2015

2.1.0

2.1.0.0

Integerates Omnipay with Laravel and provides an easy configuration.

  Sources   Download

The Requires

 

by Alex Whiteside

laravel omnipay payments laravel5

18/03 2015

1.1.x-dev

1.1.9999999.9999999-dev

Integerates Omnipay with Laravel and provides an easy configuration.

  Sources   Download

The Requires

 

by Alex Whiteside

laravel omnipay laravel4 payments

18/03 2015

2.0.0

2.0.0.0

Integerates Omnipay with Laravel and provides an easy configuration.

  Sources   Download

The Requires

 

by Alex Whiteside

laravel omnipay payments laravel5

29/05 2014

1.0.x-dev

1.0.9999999.9999999-dev

Integerates Omnipay with Laravel and provides an easy configuration.

  Sources   Download

The Requires

 

by Alex Whiteside

laravel omnipay laravel4 payments

29/05 2014

1.1.0

1.1.0.0

Integerates Omnipay with Laravel and provides an easy configuration.

  Sources   Download

The Requires

 

by Alex Whiteside

laravel omnipay laravel4 payments

20/11 2013

1.0.1

1.0.1.0

Integerates Omnipay with Laravel and provides an easy configuration.

  Sources   Download

The Requires

 

by Alex Whiteside

laravel omnipay laravel4 payments

18/10 2013

1.0.0

1.0.0.0

Integerates Omnipay with Laravel and provides an easy configuration.

  Sources   Download

The Requires

 

by Alex Whiteside

laravel omnipay laravel4 payments