All Projects → laravelhungary → laravel-barion

laravelhungary / laravel-barion

Licence: other
A simple Laravel wrapper for the Barion payment API

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to laravel-barion

swaggervel
Swagger for Laravel
Stars: ✭ 70 (+438.46%)
Mutual labels:  laravel-package
laravel-profane
Profanity Validator for Laravel
Stars: ✭ 79 (+507.69%)
Mutual labels:  laravel-package
menus
Laravel Enso main menu manager, for easy management of the application menus straight from the interface, whether that means adding, removing or reordering them
Stars: ✭ 15 (+15.38%)
Mutual labels:  laravel-package
laravel-filterable
Laravel 5/6/7 package to handle filtering by query-string
Stars: ✭ 117 (+800%)
Mutual labels:  laravel-package
laravel-print-api
Laravel package to access our print-api
Stars: ✭ 16 (+23.08%)
Mutual labels:  laravel-package
atlassian-connect-core
[Laravel 5.5+] The easiest way to create an add-on for the JIRA and Confluence
Stars: ✭ 42 (+223.08%)
Mutual labels:  laravel-package
laravel-sybase
Connection and Laravel Eloquent driver for Sybase
Stars: ✭ 29 (+123.08%)
Mutual labels:  laravel-package
awesome-landlord
A simple, single database multi-tenancy solution for Laravel 5.2+
Stars: ✭ 41 (+215.38%)
Mutual labels:  laravel-package
data-import
Laravel Enso XLSX Data Import package, built around the box/spout library, with templating, easy validation and more, for painless imports
Stars: ✭ 19 (+46.15%)
Mutual labels:  laravel-package
laravel-getid3
A Laravel package to extract metadata from media files. mp3, aac, etc. It can be used with files stored on different disks such as local disk, S3 etc.
Stars: ✭ 50 (+284.62%)
Mutual labels:  laravel-package
forest-laravel
🌱 Laravel Liana for Forest Admin. This repo is no longer maintained. Please use laravel-forestadmin instead: https://github.com/ForestAdmin/laravel-forestadmin
Stars: ✭ 4 (-69.23%)
Mutual labels:  laravel-package
sweetalert
Laravel 5 Package for SweetAlert2. Use this package to easily show sweetalert2 prompts in your laravel app.
Stars: ✭ 28 (+115.38%)
Mutual labels:  laravel-package
nova-qrcode-field
A Laravel Nova field to generate QR Code
Stars: ✭ 28 (+115.38%)
Mutual labels:  laravel-package
world
A Laravel package which provides a list of the countries, states, cities, currencies, timezones and languages.
Stars: ✭ 479 (+3584.62%)
Mutual labels:  laravel-package
artisan-remote
Artisan Remote is a package for Laravel to interact with your Artisan Commands via an HTTP API.
Stars: ✭ 69 (+430.77%)
Mutual labels:  laravel-package
gitup
Laravel package to upload git commits to server(s) via (s)ftp.
Stars: ✭ 20 (+53.85%)
Mutual labels:  laravel-package
Laravel-Auto-Hard-Deleter
Laravel and Lumen Auto Hard Deleter
Stars: ✭ 34 (+161.54%)
Mutual labels:  laravel-package
translate-laravel
Translate your Laravel website easily.
Stars: ✭ 36 (+176.92%)
Mutual labels:  laravel-package
laravel-login-links
Create (passwordless) login links for users
Stars: ✭ 13 (+0%)
Mutual labels:  laravel-package
laravel-jwt-auto-installer
A Laravel Library that let's you add tymon jwt auth library and all it's features with single command
Stars: ✭ 19 (+46.15%)
Mutual labels:  laravel-package

Stand With Ukraine

Use the Barion API with Laravel

Travis StyleCI SensioLabs Insight license Packagist Total Downloads

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.

Installation

  1. Install the package using composer:

composer require laravelhungary/laravel-barion

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

  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:

BARION_POS_KEY=<my pos key>

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

BARION_LIVE_ENV=true.

If you'd like to tweak the configuration values, publish the config file:

artisan vendor:publish --provider="LaravelHungary\Barion\BarionServiceProvider"

Usage

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

There are two convenience methods for the two most-often used API calls:

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' => '[email protected]',
            '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:

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

POS Key is automatically appended to each request.

License

Laravel-Barion is open source software licensed under the MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].