PHP code example of laravelhungary / laravel-barion

1. Go to this page and download the library: Download laravelhungary/laravel-barion library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

laravelhungary / laravel-barion example snippets


LaravelHungary\Barion\BarionServiceProvider::class,

'Barion' =>  LaravelHungary\Barion\BarionFacade::class

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

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
                ]
            ]
         ]
    ]
])

Barion::get('/api/url')

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