2017 © Pedro Peláez
 

library laravel-payum

Rich payment solutions for Laravel framework. Paypal, payex, authorize.net, be2bill, omnipay, recurring paymens, instant notifications and many more

image

recca0120/laravel-payum

Rich payment solutions for Laravel framework. Paypal, payex, authorize.net, be2bill, omnipay, recurring paymens, instant notifications and many more

  • Friday, February 9, 2018
  • by recca0120
  • Repository
  • 4 Watchers
  • 63 Stars
  • 410 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 20 Forks
  • 2 Open issues
  • 26 Versions
  • 24 % Grown

The README.md

Payum for Laravel 5

StyleCI Build Status Total Downloads Latest Stable Version Latest Unstable Version License Monthly Downloads Daily Downloads Scrutinizer Code Quality Code Coverage, (*1)

Installing

To get the latest version of Laravel Exceptions, simply require the project using Composer:, (*2)

composer require recca0120/laravel-payum

Instead, you may of course manually update your require block and run composer update if you so choose:, (*3)

{
    "require": {
        "recca0120/laravel-payum": "^1.0.6"
    }
}

Include the service provider within config/app.php. The service povider is needed for the generator artisan command., (*4)

'providers' => [
    ...
    Recca0120\LaravelPayum\LaravelPayumServiceProvider::class,
    ...
];

Config

return [
    'route' => [
        'prefix' => 'payment',
        'as' => 'payment.',
        'middleware' => ['web'],
    ],

    'storage' => [
        // options: eloquent, filesystem
        'token' => 'filesystem',

        // options: eloquent, filesystem
        'gatewayConfig' => 'filesystem',
    ],

    'gatewayConfigs' => [
        // 'customFactoryName' => [
        //     'factory'  => 'FactoryClass',
        //     'username' => 'username',
        //     'password' => 'password',
        //     'sandbox'  => false
        // ],
    ],
];

VerifyCsrfToken


namespace App\Http\Middleware; use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as BaseVerifier; class VerifyCsrfToken extends BaseVerifier { /** * The URIs that should be excluded from CSRF verification. * * @var array */ protected $except = [ 'payment/*' ]; }

Controller


namespace App\Http\Controllers; use Illuminate\Http\Request; use Illuminate\Routing\Controller as BaseController; use Payum\Core\GatewayInterface; use Payum\Core\Model\PaymentInterface; use Payum\Core\Payum; use Payum\Core\Request\GetHumanStatus; use Payum\Core\Security\TokenInterface; use Payum\Core\Storage\StorageInterface; use Recca0120\LaravelPayum\Service\PayumService; class PaymentController extends BaseController { public function capture(PayumService $payumService) { return $payumService->capture('allpay', function ( PaymentInterface $payment, $gatewayName, StorageInterface $storage, Payum $payum ) { $payment->setNumber(uniqid()); $payment->setCurrencyCode('TWD'); $payment->setTotalAmount(2000); $payment->setDescription('A description'); $payment->setClientId('anId'); $payment->setClientEmail('foo@example.com'); $payment->setDetails([ 'Items' => [ [ 'Name' => '歐付寶黑芝麻豆漿', 'Price' => (int) '2000', 'Currency' => '元', 'Quantity' => (int) '1', 'URL' => 'dedwed', ], ], ]); }); } public function done(PayumService $payumService, $payumToken) { return $payumService->done($payumToken, function ( GetHumanStatus $status, PaymentInterface $payment, GatewayInterface $gateway, TokenInterface $token ) { return response()->json([ 'status' => $status->getValue(), 'client' => [ 'id' => $payment->getClientId(), 'email' => $payment->getClientEmail(), ], 'number' => $payment->getNumber(), 'description' => $payment->getCurrencyCode(), 'total_amount' => $payment->getTotalAmount(), 'currency_code' => $payment->getCurrencyCode(), 'details' => $payment->getDetails(), ]); }); } }

Router

Route::get('payment', [
    'as'   => 'payment',
    'uses' => 'PaymentController@capture',
]);

Route::any('payment/done/{payumToken}', [
    'as'   => 'payment.done',
    'uses' => 'PaymentController@done',
]);

Eloquent

If you want use eloquent you need change config.php and create database, (*5)

Migrate

publish vendor, (*6)

artisan vendor:publish --provider="Recca0120\LaravelPayum\LaravelPayumServiceProvider"

migrate, (*7)

artisan migrate

modify config, (*8)


return [ 'route' => [ 'prefix' => 'payment', 'as' => 'payment.', 'middleware' => ['web'], ], 'storage' => [ // options: eloquent, eloquent 'token' => 'filesystem', // options: eloquent, filesystem 'gatewayConfig' => 'filesystem', ], // 'customFactoryName' => [ // 'factory' => 'FactoryClass', // 'username' => 'username', // 'password' => 'password', // 'sandbox' => false // ], 'gatewayConfigs' => [ 'offline' => [] ], ];

The Versions

09/02 2018

dev-dev

dev-dev

Rich payment solutions for Laravel framework. Paypal, payex, authorize.net, be2bill, omnipay, recurring paymens, instant notifications and many more

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar recca0120

payment omnipay payex stripe authorize.net paypal be2bill paypal express checkout offline klarna recurring payment paypal pro checkout instant notification

09/02 2018

dev-master

9999999-dev

Rich payment solutions for Laravel framework. Paypal, payex, authorize.net, be2bill, omnipay, recurring paymens, instant notifications and many more

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar recca0120

payment omnipay payex stripe authorize.net paypal be2bill paypal express checkout offline klarna recurring payment paypal pro checkout instant notification

17/06 2017

dev-refactor

dev-refactor

Rich payment solutions for Laravel framework. Paypal, payex, authorize.net, be2bill, omnipay, recurring paymens, instant notifications and many more

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar recca0120

payment omnipay payex stripe authorize.net paypal be2bill paypal express checkout offline klarna recurring payment paypal pro checkout instant notification

05/03 2017

v1.1.5

1.1.5.0

Rich payment solutions for Laravel framework. Paypal, payex, authorize.net, be2bill, omnipay, recurring paymens, instant notifications and many more

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar recca0120

payment omnipay payex stripe authorize.net paypal be2bill paypal express checkout offline klarna recurring payment paypal pro checkout instant notification

25/01 2017

v1.1.4

1.1.4.0

Rich payment solutions for Laravel framework. Paypal, payex, authorize.net, be2bill, omnipay, recurring paymens, instant notifications and many more

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar recca0120

payment omnipay payex stripe authorize.net paypal be2bill paypal express checkout offline klarna recurring payment paypal pro checkout instant notification

25/01 2017

v1.1.3

1.1.3.0

Rich payment solutions for Laravel framework. Paypal, payex, authorize.net, be2bill, omnipay, recurring paymens, instant notifications and many more

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar recca0120

payment omnipay payex stripe authorize.net paypal be2bill paypal express checkout offline klarna recurring payment paypal pro checkout instant notification

16/01 2017

v1.1.2

1.1.2.0

Rich payment solutions for Laravel framework. Paypal, payex, authorize.net, be2bill, omnipay, recurring paymens, instant notifications and many more

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar recca0120

payment omnipay payex stripe authorize.net paypal be2bill paypal express checkout offline klarna recurring payment paypal pro checkout instant notification

12/01 2017

v1.1.1

1.1.1.0

Rich payment solutions for Laravel framework. Paypal, payex, authorize.net, be2bill, omnipay, recurring paymens, instant notifications and many more

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar recca0120

payment omnipay payex stripe authorize.net paypal be2bill paypal express checkout offline klarna recurring payment paypal pro checkout instant notification

07/12 2016

v1.1.0

1.1.0.0

Rich payment solutions for Laravel framework. Paypal, payex, authorize.net, be2bill, omnipay, recurring paymens, instant notifications and many more

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar recca0120

payment omnipay payex stripe authorize.net paypal be2bill paypal express checkout offline klarna recurring payment paypal pro checkout instant notification

25/11 2016

v1.0.7

1.0.7.0

Rich payment solutions for Laravel framework. Paypal, payex, authorize.net, be2bill, omnipay, recurring paymens, instant notifications and many more

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar recca0120

payment omnipay payex stripe authorize.net paypal be2bill paypal express checkout offline klarna recurring payment paypal pro checkout instant notification

24/11 2016

v1.0.5

1.0.5.0

Rich payment solutions for Laravel framework. Paypal, payex, authorize.net, be2bill, omnipay, recurring paymens, instant notifications and many more

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar recca0120

payment omnipay payex stripe authorize.net paypal be2bill paypal express checkout offline klarna recurring payment paypal pro checkout instant notification

22/11 2016

v1.0.4

1.0.4.0

Rich payment solutions for Laravel framework. Paypal, payex, authorize.net, be2bill, omnipay, recurring paymens, instant notifications and many more

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar recca0120

payment omnipay payex stripe authorize.net paypal be2bill paypal express checkout offline klarna recurring payment paypal pro checkout instant notification

06/11 2016

v1.0.3

1.0.3.0

Rich payment solutions for Laravel framework. Paypal, payex, authorize.net, be2bill, omnipay, recurring paymens, instant notifications and many more

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar recca0120

payment omnipay payex stripe authorize.net paypal be2bill paypal express checkout offline klarna recurring payment paypal pro checkout instant notification

23/10 2016

v1.0.2

1.0.2.0

Rich payment solutions for Laravel framework. Paypal, payex, authorize.net, be2bill, omnipay, recurring paymens, instant notifications and many more

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar recca0120

payment omnipay payex stripe authorize.net paypal be2bill paypal express checkout offline klarna recurring payment paypal pro checkout instant notification

18/10 2016

v1.0.1

1.0.1.0

Rich payment solutions for Laravel framework. Paypal, payex, authorize.net, be2bill, omnipay, recurring paymens, instant notifications and many more

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar recca0120

payment omnipay payex stripe authorize.net paypal be2bill paypal express checkout offline klarna recurring payment paypal pro checkout instant notification

13/09 2016

v1.0.0

1.0.0.0

Rich payment solutions for Laravel framework. Paypal, payex, authorize.net, be2bill, omnipay, recurring paymens, instant notifications and many more

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar recca0120

payment omnipay payex stripe authorize.net paypal be2bill paypal express checkout offline klarna recurring payment paypal pro checkout instant notification

11/09 2016

v0.2.0

0.2.0.0

Rich payment solutions for Laravel framework. Paypal, payex, authorize.net, be2bill, omnipay, recurring paymens, instant notifications and many more

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar recca0120

payment omnipay payex stripe authorize.net paypal be2bill paypal express checkout offline klarna recurring payment paypal pro checkout instant notification

11/09 2016

v0.1.2

0.1.2.0

Rich payment solutions for Laravel framework. Paypal, payex, authorize.net, be2bill, omnipay, recurring paymens, instant notifications and many more

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar recca0120

payment omnipay payex stripe authorize.net paypal be2bill paypal express checkout offline klarna recurring payment paypal pro checkout instant notification

02/09 2016

v0.1.1

0.1.1.0

Rich payment solutions for Laravel framework. Paypal, payex, authorize.net, be2bill, omnipay, recurring paymens, instant notifications and many more

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar recca0120

payment omnipay payex stripe authorize.net paypal be2bill paypal express checkout offline klarna recurring payment paypal pro checkout instant notification

24/08 2016

v0.1.0

0.1.0.0

Rich payment solutions for Laravel framework. Paypal, payex, authorize.net, be2bill, omnipay, recurring paymens, instant notifications and many more

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar recca0120

payment omnipay payex stripe authorize.net paypal be2bill paypal express checkout offline klarna recurring payment paypal pro checkout instant notification

24/08 2016

v0.0.6

0.0.6.0

Rich payment solutions for Laravel framework. Paypal, payex, authorize.net, be2bill, omnipay, recurring paymens, instant notifications and many more

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar recca0120

payment omnipay payex stripe authorize.net paypal be2bill paypal express checkout offline klarna recurring payment paypal pro checkout instant notification

21/08 2016

v0.0.5

0.0.5.0

Rich payment solutions for Laravel framework. Paypal, payex, authorize.net, be2bill, omnipay, recurring paymens, instant notifications and many more

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar recca0120

payment omnipay payex stripe authorize.net paypal be2bill paypal express checkout offline klarna recurring payment paypal pro checkout instant notification

16/08 2016

v0.0.4

0.0.4.0

Rich payment solutions for Laravel framework. Paypal, payex, authorize.net, be2bill, omnipay, recurring paymens, instant notifications and many more

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar recca0120

payment omnipay payex stripe authorize.net paypal be2bill paypal express checkout offline klarna recurring payment paypal pro checkout instant notification

22/07 2016

v0.0.3

0.0.3.0

Rich payment solutions for Laravel framework. Paypal, payex, authorize.net, be2bill, omnipay, recurring paymens, instant notifications and many more

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar recca0120

payment omnipay payex stripe authorize.net paypal be2bill paypal express checkout offline klarna recurring payment paypal pro checkout instant notification

12/07 2016

v0.0.2

0.0.2.0

Rich payment solutions for Laravel framework. Paypal, payex, authorize.net, be2bill, omnipay, recurring paymens, instant notifications and many more

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar recca0120

payment omnipay payex stripe authorize.net paypal be2bill paypal express checkout offline klarna recurring payment paypal pro checkout instant notification

11/07 2016

v0.0.1

0.0.1.0

Rich payment solutions for Laravel framework. Paypal, payex, authorize.net, be2bill, omnipay, recurring paymens, instant notifications and many more

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar recca0120

payment omnipay payex stripe authorize.net paypal be2bill paypal express checkout offline klarna recurring payment paypal pro checkout instant notification