1. Go to this page and download the library: Download vaszev/barion-bundle 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/ */
vaszev / barion-bundle example snippets
$myWebsopTransactionId = 8211;
$redirectURL = $this->generateUrl('webshop', [], UrlGeneratorInterface::ABSOLUTE_URL);
try {
$barion->initShopping($redirectURL)->createTransaction($myWebsopTransactionId, 'Please post it ASAP!');
$barion->addItem('Product name','Description',2,2900,'ProdId#5312','Piece');
$barion->addItem('Product name 2','Description so far',1,1000,'ProdId#4362','Meter');
$barion->addItem('Product name 3','Description will fit',1,5900,'ProdId#7309','L');
$payURL = $barion->preparePaymentRequest('[email protected]', '1234 Hungary, Budapest...')->closeAndGetPaymentURL();
...
} catch (\Exception $e) {
// yikes! something went wrong...
}