Laravel Wrapper

The Buckaroo Laravel Wrapper is an open source package that adds Buckaroo payments to a Laravel application. It is built on the PHP SDK and adds what a Laravel application expects: a service provider, a facade, a configuration file, a transactions table, ready-made routes for the return page and push messages, and events you can listen to.
Running a store on an e-commerce platform? Use one of our ready-made plugins and apps instead. This package is for custom Laravel applications.
What the wrapper does for you
| PHP SDK | Laravel Wrapper | |
|---|---|---|
| Start payments, refunds and captures | Yes | Yes |
Configuration through .env | No | Yes |
| Stores every transaction in your database | No | Yes |
| Push route with signature validation | You build it | Included |
| Updates the stored transaction from the push message | You build it | Included |
| Laravel events for payments and refunds | No | Yes |
Requirements
| Requirement | Details |
|---|---|
| Buckaroo account | Create an account if you do not have one yet |
| PHP | 8.0 or higher |
| Laravel | 9 or higher |
| Composer | To install the package. The PHP SDK is installed with it |
Installation
Install the package with Composer:
composer require buckaroo/laravelPublish the configuration file, the migration and the routes file, then create the transactions table:
php artisan buckaroo:publish
php artisan migrateLaravel discovers the service provider automatically.
The source code is on GitHub.
Quick start
Add your keys to .env:
BPE_WEBSITE_KEY=your_store_key
BPE_SECRET_KEY=your_secret_key
BPE_MODE=testThen start a payment and send the customer to the payment page:
use Buckaroo\Laravel\Api\PayService;
use Buckaroo\Laravel\Handlers\PaymentMethodFactory;
[$response, $transaction] = PayService::make(
PaymentMethodFactory::make('ideal')->setPayload([
'invoice' => 'INV-1001', // must be unique per payment
'order' => 'ORD-1001',
'amountDebit' => 10.00,
'currency' => 'EUR',
'description' => 'Order #1001',
])
)->pay();
if ($response->hasRedirect()) {
return redirect()->away($response->getRedirectUrl());
}That starts an iDEAL | Wero payment in test mode and stores it in the buckaroo_transactions table. Before the result can reach your application, exclude the push route from CSRF verification. Continue with these pages in order:
- Configuration: credentials, CSRF, routes and the transaction model
- Payments: start a payment, read the response and handle errors
- Push messages and events: act on the payment result
- Order management: refunds, captures and stored transactions
- Test and go live: what to test and how to switch to production
Versioning
The package follows semantic versioning:
| Part | Meaning |
|---|---|
| MAJOR | Breaking changes that require additional testing and caution |
| MINOR | New functionality with limited impact |
| PATCH | Bug fixes and hotfixes only |
Every change is recorded on the releases page.
Contribute
The package is open source under the MIT license, and contributions are welcome through a pull request on GitHub.
Updated 2 days ago