laravel-payum maintained by recca0120
Description
Rich payment solutions for Laravel framework. Paypal, payex, authorize.net, be2bill, omnipay, recurring paymens, instant notifications and many more
Author
Last update
2017/06/17 03:50 (dev-refactor)
License
Downloads
206
Tags
payment - paypal - stripe - authorizenet - be2bill - omnipay - recurring-payment - paypal-express-checkout - paypal-pro-checkout - payex - offline - instant-notification - klarna
Last update
2017/06/17 03:50
License
Require
- php >=5.5.9
- illuminate/database ^5.1
- illuminate/events ^5.1
- illuminate/filesystem ^5.1
- illuminate/routing ^5.1
- illuminate/session ^5.1
- illuminate/support ^5.1
- illuminate/view ^5.1
- php-http/guzzle6-adapter ^1.1.1
- payum/core ^1.4
Last update
2017/03/27 12:23
License
Require
- php >=5.5.9
- php-http/guzzle6-adapter ^1.1
- payum/core ^1.3
- illuminate/database ^5.1
- illuminate/events ^5.1
- illuminate/filesystem ^5.1
- illuminate/routing ^5.1
- illuminate/session ^5.1
- illuminate/support ^5.1
- illuminate/view ^5.1
Last update
2017/03/05 17:14
License
Require
- php >=5.5.9
- payum/core ^1.3
- php-http/guzzle6-adapter ^1.1
- illuminate/database ^5.1
- illuminate/events ^5.1
- illuminate/filesystem ^5.1
- illuminate/routing ^5.1
- illuminate/session ^5.1
- illuminate/support ^5.1
- illuminate/view ^5.1
Last update
2017/01/25 19:19
License
Require
- php >=5.5.9
- payum/core ^1.3
- php-http/guzzle6-adapter ^1.1
- illuminate/database ~5.1
- illuminate/events ~5.1
- illuminate/filesystem ~5.1
- illuminate/routing ~5.1
- illuminate/session ~5.1
- illuminate/support ~5.1
- illuminate/view ~5.1
Last update
2017/01/25 04:20
License
Require
- php >=5.5.9
- payum/core ^1.3
- php-http/guzzle6-adapter ^1.1
- illuminate/database ~5.1
- illuminate/events ~5.1
- illuminate/filesystem ~5.1
- illuminate/routing ~5.1
- illuminate/session ~5.1
- illuminate/support ~5.1
- illuminate/view ~5.1
Last update
2017/01/16 19:29
License
Require
- php >=5.5.9
- payum/core ^1.3
- php-http/guzzle6-adapter ^1.1
- illuminate/database ~5.1
- illuminate/events ~5.1
- illuminate/filesystem ~5.1
- illuminate/routing ~5.1
- illuminate/session ~5.1
- illuminate/support ~5.1
- illuminate/view ~5.1
Last update
2017/01/12 22:15
License
Require
- php >=5.5.9
- payum/core ^1.3
- php-http/guzzle6-adapter ^1.1
- illuminate/database ~5.1
- illuminate/events ~5.1
- illuminate/filesystem ~5.1
- illuminate/routing ~5.1
- illuminate/session ~5.1
- illuminate/support ~5.1
- illuminate/view ~5.1
Last update
2016/12/07 20:11
License
Require
- php >=5.5.9
- payum/core ^1.3
- php-http/guzzle6-adapter ^1.1
- illuminate/cookie ~5.1
- illuminate/database ~5.1
- illuminate/encryption ~5.1
- illuminate/events ~5.1
- illuminate/filesystem ~5.1
- illuminate/routing ~5.1
- illuminate/session ~5.1
- illuminate/support ~5.1
- illuminate/view ~5.1
Last update
2016/11/25 10:07
License
Require
- php >=5.5.9
- payum/core ^1.3
- php-http/guzzle6-adapter ^1.1
- illuminate/cookie ~5.1
- illuminate/database ~5.1
- illuminate/encryption ~5.1
- illuminate/events ~5.1
- illuminate/filesystem ~5.1
- illuminate/routing ~5.1
- illuminate/session ~5.1
- illuminate/support ~5.1
- illuminate/view ~5.1
Last update
2016/11/24 02:15
License
Require
- php >=5.5.9
- payum/core ^1.3
- php-http/guzzle6-adapter ^1.1
- illuminate/cookie ~5.1
- illuminate/database ~5.1
- illuminate/encryption ~5.1
- illuminate/events ~5.1
- illuminate/filesystem ~5.1
- illuminate/routing ~5.1
- illuminate/session ~5.1
- illuminate/support ~5.1
- illuminate/view ~5.1
Last update
2016/11/22 07:28
License
Require
- php >=5.5.9
- payum/core ^1.3
- php-http/guzzle6-adapter ^1.1
- illuminate/cookie ~5.1
- illuminate/database ~5.1
- illuminate/encryption ~5.1
- illuminate/events ~5.1
- illuminate/filesystem ~5.1
- illuminate/routing ~5.1
- illuminate/session ~5.1
- illuminate/support ~5.1
- illuminate/view ~5.1
Last update
2016/11/06 10:11
License
Require
- php >=5.5.9
- payum/core ^1.3
- php-http/guzzle6-adapter ^1.1
- illuminate/cookie ~5.1
- illuminate/database ~5.1
- illuminate/encryption ~5.1
- illuminate/events ~5.1
- illuminate/filesystem ~5.1
- illuminate/routing ~5.1
- illuminate/session ~5.1
- illuminate/support ~5.1
- illuminate/view ~5.1
Last update
2016/10/23 06:45
License
Require
- php >=5.5.9
- payum/core ^1.3
- php-http/guzzle6-adapter ^1.1
- illuminate/cookie ~5.1
- illuminate/database ~5.1
- illuminate/encryption ~5.1
- illuminate/events ~5.1
- illuminate/filesystem ~5.1
- illuminate/routing ~5.1
- illuminate/session ~5.1
- illuminate/support ~5.1
- illuminate/view ~5.1
Last update
2016/10/18 13:44
License
Require
- php >=5.5.9
- payum/core ^1.3
- php-http/guzzle6-adapter ^1.1
- illuminate/cookie ~5.1
- illuminate/database ~5.1
- illuminate/encryption ~5.1
- illuminate/events ~5.1
- illuminate/filesystem ~5.1
- illuminate/routing ~5.1
- illuminate/session ~5.1
- illuminate/support ~5.1
- illuminate/view ~5.1
Last update
2016/09/13 08:52
License
Require
- php >=5.5.9
- payum/core ^1.3
- php-http/guzzle6-adapter ^1.1
- illuminate/cookie ~5.1
- illuminate/database ~5.1
- illuminate/encryption ~5.1
- illuminate/events ~5.1
- illuminate/filesystem ~5.1
- illuminate/routing ~5.1
- illuminate/session ~5.1
- illuminate/support ~5.1
- illuminate/view ~5.1
Last update
2016/09/11 12:31
License
Require
- php >=5.5.9
- payum/core ^1.3
- php-http/guzzle6-adapter ^1.1
- illuminate/cookie ~5.1
- illuminate/database ~5.1
- illuminate/encryption ~5.1
- illuminate/events ~5.1
- illuminate/filesystem ~5.1
- illuminate/routing ~5.1
- illuminate/session ~5.1
- illuminate/support ~5.1
- illuminate/view ~5.1
Last update
2016/09/11 08:57
License
Require
- php >=5.5.9
- php-http/guzzle6-adapter ^1.1
- payum/core ^1.3
- illuminate/cookie ~5.1
- illuminate/database ~5.1
- illuminate/encryption ~5.1
- illuminate/filesystem ~5.1
- illuminate/routing ~5.1
- illuminate/session ~5.1
- illuminate/support ~5.1
- illuminate/view ~5.1
Last update
2016/09/02 12:16
License
Require
- php >=5.5.9
- php-http/guzzle6-adapter ^1.1
- payum/core ^1.3
- illuminate/cookie ~5.1
- illuminate/database ~5.1
- illuminate/encryption ~5.1
- illuminate/filesystem ~5.1
- illuminate/routing ~5.1
- illuminate/session ~5.1
- illuminate/support ~5.1
- illuminate/view ~5.1
Last update
2016/08/24 13:27
License
Require
- php >=5.5.9
- php-http/guzzle6-adapter ^1.1
- payum/core ^1.3
- illuminate/cookie ~5.1
- illuminate/database ~5.1
- illuminate/encryption ~5.1
- illuminate/filesystem ~5.1
- illuminate/routing ~5.1
- illuminate/session ~5.1
- illuminate/support ~5.1
- illuminate/view ~5.1
Last update
2016/08/24 09:22
License
Require
- php >=5.5.9
- php-http/guzzle6-adapter ^1.1
- payum/core ^1.3
- illuminate/cookie ~5.1
- illuminate/database ~5.1
- illuminate/encryption ~5.1
- illuminate/filesystem ~5.1
- illuminate/routing ~5.1
- illuminate/session ~5.1
- illuminate/support ~5.1
- illuminate/view ~5.1
Last update
2016/08/21 17:55
License
Require
- php >=5.5.9
- php-http/guzzle6-adapter ^1.1
- payum/core ^1.3
- illuminate/cookie ~5.1
- illuminate/database ~5.1
- illuminate/encryption ~5.1
- illuminate/filesystem ~5.1
- illuminate/routing ~5.1
- illuminate/session ~5.1
- illuminate/support ~5.1
- illuminate/view ~5.1
Last update
2016/08/16 08:51
License
Require
- php >=5.5.9
- php-http/guzzle6-adapter ^1.1
- payum/core ^1.3
- illuminate/cookie ~5.1
- illuminate/database ~5.1
- illuminate/encryption ~5.1
- illuminate/filesystem ~5.1
- illuminate/routing ~5.1
- illuminate/session ~5.1
- illuminate/support ~5.1
- illuminate/view ~5.1
Last update
2016/07/22 14:43
License
Require
- php >=5.5.9
- php-http/guzzle6-adapter ^1.1
- payum/core ^1.3
- illuminate/support ^5.1
- illuminate/routing ^5.1
- illuminate/database ^5.1
- illuminate/session ^5.1
- illuminate/filesystem ^5.1
- illuminate/view ^5.1
- illuminate/cookie ^5.1
Last update
2016/07/12 12:45
License
Require
- php >=5.5.9
- php-http/guzzle6-adapter ^1.1
- payum/core ^1.3
- illuminate/support ^5.1
- illuminate/routing ^5.1
- illuminate/database ^5.1
- illuminate/session ^5.1
- illuminate/filesystem ^5.1
- illuminate/view ^5.1
Last update
2016/07/11 09:45
License
Require
- php >=5.5.9
- php-http/guzzle6-adapter ^1.1
- payum/core ^1.3
- illuminate/support ^5.1
- illuminate/routing ^5.1
- illuminate/database ^5.1
- illuminate/session ^5.1
- illuminate/filesystem ^5.1
- illuminate/view ^5.1
comments powered by Disqus
Payum for Laravel 5
Installing
To get the latest version of Laravel Exceptions, simply require the project using Composer:
composer require recca0120/laravel-payum
Instead, you may of course manually update your require block and run composer update
if you so choose:
{
"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.
'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
Migrate
publish vendor
artisan vendor:publish --provider="Recca0120\LaravelPayum\LaravelPayumServiceProvider"
migrate
artisan migrate
modify config
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' => []
],
];