2017 © Pedro Peláez
 

library laravel-barion

Simple Laravel wrapper for the API of the Barion online payment system

image

laravelhungary/laravel-barion

Simple Laravel wrapper for the API of the Barion online payment system

  • Friday, May 4, 2018
  • by hocza
  • Repository
  • 3 Watchers
  • 4 Stars
  • 2,526 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 1 Open issues
  • 9 Versions
  • 41 % Grown

The README.md

Stand With Ukraine, (*1)

Use the Barion API with Laravel

Travis StyleCI SensioLabs Insight license Packagist Total Downloads, (*2)

Laravel-Barion is provides an easy way to use the Barion API with Laravel applications. Under the hood there is just a thin wrapper to make API calls simple., (*3)

Installation

  1. Install the package using composer:

composer require laravelhungary/laravel-barion, (*4)

If you're using Laravel 5.5, you're done, the following steps are being done automatically., (*5)

  1. Register the service provider in the app.php config file
LaravelHungary\Barion\BarionServiceProvider::class,
  1. Register the Barion facade (optional)
'Barion' =>  LaravelHungary\Barion\BarionFacade::class

Configuration

Laravel-Barion comes preconfigured, you only need to set your POS key in the .env file:, (*6)

BARION_POS_KEY=<my pos key>, (*7)

The Barion environment defaults to test.barion.com. To use the live instead, set, (*8)

BARION_LIVE_ENV=true., (*9)

If you'd like to tweak the configuration values, publish the config file:, (*10)

artisan vendor:publish --provider="LaravelHungary\Barion\BarionServiceProvider", (*11)

Usage

You can either resolve the Barion class from the Service Container using Laravel's dependency injection, or simply use the provided Facade., (*12)

There are two convenience methods for the two most-often used API calls:, (*13)

Get the payment status

Barion::getPaymentState('my-payment-id')

Start a Payment

Barion::paymentStart([
    'PaymentType' => PaymentType::IMMEDIATE,
    'GuestCheckOut' => true,
    'FundingSources' => [FundingSource::ALL],
    'Locale' => Locale::HU,
    'Currency' => Currency::HUF,
    'Transactions' => [
        [
            'POSTransactionId' => 'ABC-1234',
            'Payee' => 'example@email.com',
            'Total' => 4990,
            'Items' => [
                [
                    'Name' => 'Example item',
                    'Description' => 'This is a sample description',
                    'Quantity' => 1,
                    'Unit' => 'db',
                    'UnitPrice' => 4990,
                    'ItemTotal' => 4990
                ]
            ]
         ]
    ]
])

All other API calls are accessible using either get or post:, (*14)

Barion::get('/api/url')
Barion::post('/api/url', ['my-data' => 'some value'])

POS Key is automatically appended to each request., (*15)

License

Laravel-Barion is open source software licensed under the MIT License., (*16)

The Versions

04/05 2018

dev-master

9999999-dev

Simple Laravel wrapper for the API of the Barion online payment system

  Sources   Download

MIT

The Requires

 

The Development Requires

by Zsolt Fekete (nxu)

04/05 2018

v1.1.3

1.1.3.0

Simple Laravel wrapper for the API of the Barion online payment system

  Sources   Download

MIT

The Requires

 

The Development Requires

by Zsolt Fekete (nxu)

13/02 2018

v1.1.2

1.1.2.0

Simple Laravel wrapper for the API of the Barion online payment system

  Sources   Download

MIT

The Requires

 

The Development Requires

by Zsolt Fekete (nxu)

22/11 2017

v1.1.1

1.1.1.0

Simple Laravel wrapper for the API of the Barion online payment system

  Sources   Download

MIT

The Requires

 

The Development Requires

by Zsolt Fekete (nxu)

22/11 2017

v1.1

1.1.0.0

Simple Laravel wrapper for the API of the Barion online payment system

  Sources   Download

MIT

The Requires

 

The Development Requires

by Zsolt Fekete (nxu)

11/09 2017

v1.0.3

1.0.3.0

Simple Laravel wrapper for the API of the Barion online payment system

  Sources   Download

MIT

The Requires

 

The Development Requires

by Zsolt Fekete (nxu)

23/02 2017

v1.0.2

1.0.2.0

Simple Laravel wrapper for the API of the Barion online payment system

  Sources   Download

MIT

The Requires

 

The Development Requires

by Zsolt Fekete (nxu)

06/11 2016

v1.0.1

1.0.1.0

Simple Laravel wrapper for the API of the Barion online payment system

  Sources   Download

MIT

The Requires

 

The Development Requires

by Zsolt Fekete (nxu)

06/11 2016

v1.0

1.0.0.0

Simple Laravel wrapper for the API of the Barion online payment system

  Sources   Download

The Requires

 

The Development Requires

by Zsolt Fekete (nxu)