lovaszcc/laravel-barion 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

lovaszcc/laravel-barion

最新稳定版本:v1.0.0

Composer 安装命令:

composer require lovaszcc/laravel-barion

包简介

This is my package laravel-barion

README 文档

README

Latest Version on Packagist

Total Downloads

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

  1. Create a new payment
  2. Redirect the user to the GatewayUrl
  3. Wait for the callback
  4. Get the payment status
  5. If the payment is successful, update the order status
  6. 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
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-08-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固