Download the PHP package tomise/laravel-barion without Composer
On this page you can find all versions of the php package tomise/laravel-barion. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download tomise/laravel-barion
More information about tomise/laravel-barion
Files in tomise/laravel-barion
Package laravel-barion
Short Description A simple Laravel package for Barion payment gateway
License MIT
Informations about the package laravel-barion
A simple Laravel package for Barion Smart Gateway
Connect your webshop to the Barion Smart Gateway in just 5 minutes.
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
- Install the package using composer:
composer require tomise/laravel-barion
-
Register the service provider in the
app.phpconfig file - Publish config file (optional)
Configuration
Package has a pre-configuration, but you set some data your .env file: Configuration details in config/barion-gateway.php
If your BARION_ENVIRONMENT variable value is "test" every request send to sandbox server.
Documentation for Smart Gateway
There are 2 ways to use the BarionGateway (model options only available for payment start operation).
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:
-
Add
public $barion_casts = []you Order or Cart or any class that extends from Model.- Required keys: payment_request_id, payer_hint, order_number, phone_number, total
Example
- Add
public $barion_casts = []you OrderItem or CartItem or any class that also extends from Model.- Required keys: name, description, quantity, unit, unit_price, item_total
If you want to use this version, but you are missing one or more properties of a model, just attach it before passing it to the startPayment method or you can create a custom model directly for Barion e.g.: BarionOrderModel
Start single payment
startPayment method only assign minimal data to Payment/Start endpoint. But if you want to add some extra data just set before you call the sendSinglePayment.
Example
Different Locale and Currency
If you want to use the "model option" but are missing the locale or the currency from your "order" model, you can simply overwrite the default values.
Important: Changing the currency does not automatically convert the values, please note this!
Simple manual usage
Payment Start
In this case you will get an empty "PreparedPaymentService" object where you can set everything. The POSKey is automatically attached to the object.
Get Payment Status
Cancel Authorization
Information
Available gateway endpoints:
- sendSinglePayment() -> Payment/Start
- sendPaymentState() -> Payment/:paymentId/paymentstate
- sendCompletePayment() -> Payment/Complete
- sendFinishReservation() -> Payment/FinishReservation
- sendCapture() -> Payment/Capture
- sendCancelAuthorization() -> Payment/CancelAuthorization
- sendRefund() -> Payment/Refund
Available Locales: https://docs.barion.com/Localisation
Available Currencies:https://docs.barion.com/Supported_currencies
Documentation for Barion Wallet
Barion Wallet documentation
Examples
- Payment example with model
- Manual payment example
License
Laravel-Barion is open source software licensed under the MIT License.
All versions of laravel-barion with dependencies
guzzlehttp/guzzle Version ^7.0
illuminate/database Version >=7.0
illuminate/support Version >=7.0