2017 © Pedro Peláez
 

library laravel-omnipay

Omnipay Service Provider for Laravel

image

barryvdh/laravel-omnipay

Omnipay Service Provider for Laravel

  • Tuesday, May 15, 2018
  • by Barryvdh
  • Repository
  • 8 Watchers
  • 88 Stars
  • 37,509 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 19 Forks
  • 6 Open issues
  • 7 Versions
  • 4 % Grown

The README.md

Omnipay for Laravel

This is a package to integrate Omnipay with Laravel. You can use it to easily manage your configuration, and use the Facade to provide shortcuts to your gateway., (*1)

Installation

Require this package with composer., (*2)

$ composer require barryvdh/laravel-omnipay

Pre Laravel 5.5: After updating composer, add the ServiceProvider to the providers array in config/app.php, (*3)

'Barryvdh\Omnipay\ServiceProvider',

You need to publish the config for this package. A sample configuration is provided. The defaults will be merged with gateway specific configuration., (*4)

$ php artisan vendor:publish --provider=Barryvdh\Omnipay\ServiceProvider

To use the Facade (Omnipay::purchase() instead of App::make(omnipay)->purchase()), add that to the facades array., (*5)

'Omnipay' => 'Barryvdh\Omnipay\Facade',

When calling the Omnipay facade/instance, it will create the default gateway, based on the configuration. You can change the default gateway by calling Omnipay::setDefaultGateway('My\Gateway'). You can get a different gateway by calling Omnipay::gateway('My\Cass'), (*6)

Examples

$params = [
    'amount' => $order->amount,
    'issuer' => $issuerId,
    'description' => $order->description,
    'returnUrl' => URL::action('PurchaseController@return', [$order->id]),
];

$response = Omnipay::purchase($params)->send();

if ($response->isSuccessful()) {
    // payment was successful: update database
    print_r($response);
} elseif ($response->isRedirect()) {
    // redirect to offsite payment gateway
    return $response->getRedirectResponse();
} else {
    // payment failed: display message to customer
    echo $response->getMessage();
}

Besides the gateway calls, there is also a shortcut for the creditcard:, (*7)

$formInputData = [
    'firstName' => 'Bobby',
    'lastName' => 'Tables',
    'number' => '4111111111111111',
];

$card = Omnipay::CreditCard($formInputData);

The Versions

15/05 2018

dev-master

9999999-dev

Omnipay Service Provider for Laravel

  Sources   Download

MIT

The Requires

 

laravel omnipay

14/05 2018

v0.2.0

0.2.0.0

Omnipay Service Provider for Laravel

  Sources   Download

MIT

The Requires

 

laravel omnipay

14/05 2018

dev-revert-18-master

dev-revert-18-master

Omnipay Service Provider for Laravel

  Sources   Download

MIT

The Requires

 

laravel omnipay

30/01 2017

v0.1.3

0.1.3.0

Omnipay Service Provider for Laravel

  Sources   Download

MIT

The Requires

 

laravel omnipay

08/08 2016

v0.1.2

0.1.2.0

Omnipay Service Provider for Laravel

  Sources   Download

MIT

The Requires

 

laravel omnipay

07/06 2015

v0.1.1

0.1.1.0

Omnipay Service Provider for Laravel

  Sources   Download

MIT

The Requires

 

laravel omnipay

28/03 2014

v0.1.0

0.1.0.0

Omnipay Service Provider for Laravel

  Sources   Download

MIT

The Requires

 

laravel omnipay