PHPackages                             tomise/laravel-barion - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Payment Processing](/categories/payments)
4. /
5. tomise/laravel-barion

ActiveLibrary[Payment Processing](/categories/payments)

tomise/laravel-barion
=====================

A simple Laravel package for Barion payment gateway

0.9.4(12mo ago)04MITPHPPHP ^8.1

Since Nov 1Pushed 12mo ago1 watchersCompare

[ Source](https://github.com/tomise20/laravel-barion)[ Packagist](https://packagist.org/packages/tomise/laravel-barion)[ RSS](/packages/tomise-laravel-barion/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (4)Versions (5)Used By (0)

A simple Laravel package for Barion Smart Gateway
=================================================

[](#a-simple-laravel-package-for-barion-smart-gateway)

### **Connect your webshop to the Barion Smart Gateway in just 5 minutes.**

[](#connect-your-webshop-to-the-barion-smart-gateway-in-just-5-minutes)

### **Development currently in progress!**

[](#development-currently-in-progress)

Tomise/Laravel-Barion is provides an easy way to use the Barion API with Laravel applications.Support Barion Smart Gateway operation and Barion Wallet operations.

Installation
------------

[](#installation)

1. Install the package using composer:

`composer require tomise/laravel-barion`

2. Register the service provider in the `app.php` config file

```
Tomise\Barion\Providers\BarionServiceProvider::class,
```

3. Publish config file (optional)

```
php artisan vendor:publish --provider="Tomise\Barion\Providers\BarionServiceProvider" --tag="config"
```

Configuration
-------------

[](#configuration)

Package has a pre-configuration, but you set some data your .env file: Configuration details in config/barion-gateway.php

```
#required:
BARION_POST_KEY=
BARION_REDIRECT_URL=
BARION_CALLBACK_URL=

#optional:
# only need for wallet operations
BARION_API_KEY=
BARION_PAYEE=

#others:
BARION_ENVIRONMENT=
BARION_GUEST_CHECKOUT=
BARION_PAYMENT_TYPE=
BARION_PAYMENT_WINDOW=
```

If your `BARION_ENVIRONMENT` variable value is "test" every request send to sandbox server.

### Documentation for Smart Gateway

[](#documentation-for-smart-gateway)

There are 2 ways to use the BarionGateway (model options only available for payment start operation).
-----------------------------------------------------------------------------------------------------

[](#there-are-2-ways-to-use-the-bariongateway-model-options-only-available-for-payment-start-operation)

### **Usage with models**

[](#usage-with-models)

**The $barion\_casts property should be a key-value pair based array, the keys are given and the values are the fields of the model you want to pass to the Barion.**

If you want to use Barion with your models only needs some simple step:

1. Add `public $barion_casts = []` you Order or Cart or any class that extends from Model.

    1. Required keys: payment\_request\_id, payer\_hint, order\_number, phone\_number, total

Example

```
