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.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-barion

A simple Laravel package for Barion Smart Gateway

Tomise/Laravel-Barion provides an easy way to use the Barion API in Laravel applications (10–13): Smart Gateway payments (immediate, reservation, delayed capture, recurring), payment state, refund, and Barion Wallet operations.

Installation

  1. Install the package using composer:

From a local checkout, add a path repository to the application's composer.json first:

  1. The service provider is registered automatically (package discovery). Without discovery, add Tomise\Barion\Providers\BarionServiceProvider::class to the providers.

  2. Publish the config file (optional):

Configuration

Details in config/barion-gateway.php.

Smart Gateway

Every request method throws:

Start a payment

startPaymentManual() fills the configured defaults (payment type, periods, payment window, guest checkout, funding sources, redirect and callback URL, locale, currency). Amounts are rounded to the currency's decimals (HUF: 0).

Usage with models

The models need a $barion_casts property: the keys are given, the values are the model's attributes.

Locale and currency come from the config; to change them: $payment->getPaymentData()->setCurrency(Currency::Eur). Changing the currency does not convert the amounts.

Callback: the state of a payment

Barion only posts the paymentId to the callback URL; query the state (v4 PaymentState):

Answer the callback with HTTP 200, Barion retries otherwise.

Refund

Full or partial, per transaction (the TransactionId from the start or the state response):

Reservation: charge later, finish with the final amount

The amount is charged at once and held until the payment is finished (BARION_RESERVATION_PERIOD, max. 1 year). A lower final total refunds the rest, 0 refunds everything. Transactions not finished in time are refunded to the customer (status Expired, or PartiallySucceeded when some were finished).

Delayed capture: authorize now, capture later

The amount is only blocked on the card (BARION_DELAYED_CAPTURE_PERIOD, max. 7 days, 21 days for Hungarian shops) and charged on capture. An uncaptured authorization is released when the period expires (status Expired). Card payments only; the card issuer can release the block earlier, then the capture fails.

Token payments: save the card, charge it later

The first payment is made by the customer on the Barion page and saves the card under your RecurrenceId (3DS authentication happens here). Later payments with the same RecurrenceId are charged without the customer: the response is already Succeeded, or Barion's error (e.g. CardExpired) is thrown. A premium feature: it has to be requested from Barion. Barion does not schedule the charges: call the API when a charge is due (e.g. from a scheduled command).

RecurrenceType When Amount
MerchantInitiatedPayment irregular charges without the customer (e.g. on a date, a no-show fee) any; the first payment can be 0 (card registration only)
RecurringPayment regular charges without the customer (subscription) at most the first amount; needs PurchaseInformation RecurringFrequency and RecurringExpiry
OneClickPayment the customer pays again on your site any; 3DS on every payment

The customer must clearly consent to the later charges: the Barion page does not show that the card is saved.

When a charge fails, Barion suggests checking FundingInformation->ProcessResult in the payment state: do not retry LostOrStolenCard, FraudulentTransaction, CardNotSupported or ThreeDsNotEnabled. Retry the others later (at least a day apart, at most 5 times), then ask the customer to register a card again.

Follow-up requests

The follow-up methods take the PaymentId as a parameter, or use the one set with setPaymentId():

Method Endpoint
sendSinglePayment(?idempotencyKey) POST v2/Payment/Start
sendPaymentState(paymentId) GET v4/Payment/{paymentId}/PaymentState
sendRefund(?paymentId, transactions, ?idempotencyKey) POST v2/Payment/Refund
sendFinishReservation(?paymentId, transactions) POST v2/Payment/FinishReservation
sendCapture(?paymentId, transactions) POST v2/Payment/Capture
sendCancelAuthorization(?paymentId) POST v2/Payment/CancelAuthorization
sendCompletePayment(?paymentId) POST v2/Payment/Complete

Available Locales: https://docs.barion.com/Localisation

Available Currencies: https://docs.barion.com/Supported_currencies

Testing your application

BarionGateway resolves the service from the container, so the HTTP client can be replaced:

Barion Wallet

Barion Wallet documentation

Examples

License

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


All versions of laravel-barion with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
guzzlehttp/guzzle Version ^7.8|^8.0
illuminate/database Version ^10.0|^11.0|^12.0|^13.0
illuminate/support Version ^10.0|^11.0|^12.0|^13.0
ramsey/uuid Version ^4.7
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package tomise/laravel-barion contains the following files

Loading the files please wait ...