PHP code example of buckaroo / laravel

1. Go to this page and download the library: Download buckaroo/laravel 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/ */

    

buckaroo / laravel example snippets


->withMiddleware(function (Middleware $middleware) {
    $middleware->validateCsrfTokens(except: [
        'buckaroo/*',
    ]);
})

protected $except = [
    'buckaroo/*',
];

'transaction_model' => YourCustomTransactionModel::class,

'routes' => [
    'load' => env('BPE_LOAD_ROUTES', true),
    'prefix' => env('BPE_ROUTE_PATH', 'buckaroo'),
],

use Buckaroo\Laravel\Facades\Buckaroo;
use Buckaroo\Transaction\Config\DefaultConfig;

Buckaroo::api()->setBuckarooClient(
    new DefaultConfig(
        websiteKey: config('buckaroo.website_key'),
        secretKey: config('buckaroo.secret_key'),
        mode: config('buckaroo.mode'),
        returnURL: route('buckaroo.return'),
        pushURL: route('buckaroo.push'),
    )
);

use Buckaroo\Laravel\Api\PayService;
use Buckaroo\Laravel\Handlers\PaymentMethodFactory;

$paymentSessionService = PayService::make(
    PaymentMethodFactory::make('noservice')->setPayload([
        'currency' => 'EUR',
        'amountDebit' => 100,
        'order' => '000-ORD',
        'invoice' => '000-INV',
        'description' => 'This is a description',
        'continueOnIncomplete' => '1',
        'servicesSelectableByClient' => 'ideal,bancontactmrcash',
    ])
);

$paymentSessionService = PayService::make(
    PaymentMethodFactory::make('noservice')
        ->setCurrency('EUR')
        ->setAmountDebit(100)
        ->setOrder('000-ORD')
        ->setInvoice('000-INV')
        ->setDescription('This is a description')
        ->setContinueOnIncomplete('1')
        ->setServicesSelectableByClient('ideal,bancontactmrcash')
);

use Buckaroo\Laravel\Facades\Buckaroo;

$response = Buckaroo::api()->method('ideal')->pay([
    'currency' => 'EUR',
    'amountDebit' => 100,
    'order' => '000-ORD',
    'invoice' => '000-INV',
    'description' => 'Payment for Order 000-ORD',
]);
bash
php artisan vendor:publish --provider="Buckaroo\Laravel\BuckarooServiceProvider"
bash
php artisan migrate