nepp95 / omnipay
Laravel omnipay wrapper
dev-master
2020-06-23 08:47 UTC
Requires
- php: ^7.2.5
- fruitcakestudio/omnipay-sisow: ^3.0
- league/omnipay: ^3.0
This package is auto-updated.
Last update: 2025-03-23 18:45:39 UTC
README
Install package
composer require nepp95/omnipay
Publish configuration
php artisan vendor:publish --provider="Nepp95\Omnipay\PaymentServiceProvider"
Add webhook route (Edit controller + action)
Route::get('/webhook', 'PaymentController@webhook')->name('webhook');
Create controller
php artisan make:payment PaymentController
Make sure to set all the environment variables. A list is shown in the config file.
Basic usage
use Nepp95\Omnipay\Payment;
$options = [
'amount' => '6.50',
'description' => 'Testorder #1234',
'transactionId' => 1234,
'returnUrl' => route('return')
];
// Create a payment
$payment = new Payment();
$payment->setGateway('sisow');
// Initialize the gateway. Options are optional, default is taken from config.
$payment->initialize();
// Send purchase request
$response = $payment->pay(
$options,
'\\App\\Http\\Controllers\\PaymentController',
);