lovaszcc/laravel-barion
最新稳定版本:v1.0.0
Composer 安装命令:
composer require lovaszcc/laravel-barion
包简介
This is my package laravel-barion
README 文档
README
Installation
You can install the package via composer:
composer require lovaszcc/laravel-barion
You can publish the config file with:
php artisan vendor:publish --tag="barion-config"
This is the contents of the published config file:
return [ 'live_env' => env('BARION_LIVE_ENV', false), 'pos_key' => env('BARION_POS_KEY'), 'callback_url' => env('BARION_CALLBACK_URL'), 'redirect_url' => env('BARION_REDIRECT_URL'), 'payee' => env('BARION_PAYEE'), ];
Usage
use LovaszCC\Barion\Enums\Currency; use LovaszCC\Barion\Enums\FundingSources; use LovaszCC\Barion\Enums\Locale; use LovaszCC\Barion\Enums\PaymentType; use LovaszCC\Barion\Facades\Barion; $transaction_id = 'ORDER-1234567890'; $items = [ [ 'Name' => 'Test item', 'Description' => 'Test item description', 'UnitPrice' => 1000, 'Quantity' => 1, 'Unit' => 'db', 'ItemTotal' => 1000, ], [ 'Name' => 'Test item2', 'Description' => 'Test item description2', 'UnitPrice' => 1000, 'Quantity' => 1, 'Unit' => 'db', 'ItemTotal' => 1000, ], ]; $data = [ 'PaymentType' => PaymentType::IMMEDIATE, 'GuestCheckOut' => true, 'FundingSources' => [FundingSources::ALL], 'Locale' => Locale::HU, 'Currency' => Currency::HUF, 'RedirectUrl' => config('barion.redirect_url'), 'CallbackUrl' => config('barion.callback_url'), 'Transactions' => [ [ 'POSTransactionId' => $transaction_id, 'Payee' => config('barion.payee'), 'Total' => 2000, 'Items' => $items, ], ], ]; // returns array with paymentId and GatewayUrl dd(Barion::initPayment($data));
Steps to Use
- Create a new payment
- Redirect the user to the GatewayUrl
- Wait for the callback
- Get the payment status
- If the payment is successful, update the order status
- If the payment is failed, update the order status
Changelog
Please see CHANGELOG for more information on what has changed recently.
Credits
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 4
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-08-25