buckaroo / sdk
Buckaroo payment SDK
Requires
- php: >=7.4|^8.0
- ext-fileinfo: *
- ext-json: *
- ext-pcre: *
- composer/ca-bundle: ^1.3
- guzzlehttp/guzzle: ^7.0
- monolog/monolog: ^2.2|^3
- ramsey/uuid: ^3.9.7|^4
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.13
- mockery/mockery: ^1.6
- phpunit/phpunit: ^9.5
- squizlabs/php_codesniffer: 3.*
- symfony/var-dumper: ^5.4.9
- vlucas/phpdotenv: ^5.4
This package is auto-updated.
Last update: 2026-08-19 12:54:17 UTC
README
Buckaroo PHP SDK
About · Requirements · Installation · Getting started · Testing · Support · Contribute
About
Buckaroo is a Dutch Payment Service Provider. More than 54,000 organisations rely on the Buckaroo platform to process their payments, subscriptions and unpaid invoices.
This is Buckaroo's official PHP SDK: a modern, open source library that connects a PHP application to the Buckaroo API. It handles authentication, request signing and response parsing, so you can start a payment in a few lines.
If you run a shop on an e-commerce platform, use the ready-made plugin for Magento 2, Shopware 6, WooCommerce, PrestaShop or Odoo instead. For Laravel applications there is a dedicated Laravel wrapper built on this SDK.
Full API documentation on docs.buckaroo.io
Requirements
| Requirement | Supported versions |
|---|---|
| PHP | 7.4 or higher |
| PHP extensions | json, pcre, fileinfo |
| OpenSSL | An up-to-date SSL/TLS toolkit |
You also need a Buckaroo account. Don't have one yet? Request an account.
Installation
Install the SDK with Composer:
composer require buckaroo/sdk
Composer pulls in the SDK's own dependencies (Guzzle, Monolog, ramsey/uuid and composer/ca-bundle), so there is nothing else to set up.
Getting started
Configuring the client
You can find your Store key and Secret key under API credentials in Buckaroo Plaza. The third argument is the mode: test while developing, live in production. It defaults to test.
require __DIR__ . '/vendor/autoload.php'; $buckaroo = new \BuckarooClient('STORE_KEY', 'SECRET_KEY', 'test');
Tip
Keep your Secret key out of version control. Load both keys from environment variables instead — the repository ships an .env.example to start from.
Creating a payment
Every payment method takes a slightly different payload. This example charges a Visa card:
$response = $buckaroo->method('creditcard') ->pay([ 'name' => 'visa', // request to pay with Visa 'amountDebit' => 10, // the amount to charge 'invoice' => 'UNIQUE-INVOICE-NO', // must be unique per payment ]);
Swap creditcard for any other service code to use a different payment method. Service codes and their parameters are listed in the API reference.
Retrieving transaction information
Once a transaction exists you can query it on demand:
$transaction = $buckaroo->transaction('YOUR-TRANSACTION-KEY'); $transaction->status(); // transaction status $transaction->refundInfo(); // refund info $transaction->cancelInfo(); // cancellation info
More runnable examples are in example/.
Testing
The repository defines Composer scripts for the test suites and code style:
composer test # run the full suite composer test:unit # unit tests only composer test:feature # feature tests only composer cs # check code style composer cs:fix # fix code style
Feature tests talk to the Buckaroo test environment, so copy .env.example to .env and fill in your test credentials first.
Support
Having trouble? Work through this list before reaching out:
- Check the API reference for the service and action you are calling.
- Confirm you are on the latest release.
- Reproduce the issue in
testmode and inspect the response, including the status subcode and message. - Verify that your push URL is reachable from outside your network. Buckaroo sends push messages from fixed IP addresses and ports, so make sure these are on your allow list. See push messages for the current list.
Still stuck? Contact us and include your PHP version, SDK version, the service and action you called, the error message and the transaction key.
- Questions: start a discussion
- Bug reports and feature requests: open an issue
- Technical support: support@buckaroo.nl
- Phone: +31 (0)30 711 50 50
- Gateway status: status.buckaroo.io
Contribute
We really appreciate it when developers help improve the Buckaroo SDKs. Please read our Contribution Guidelines before opening a pull request, and target the master branch.
Found a security issue? Please report it privately to support@buckaroo.nl instead of opening a public issue.
Versioning
We follow semantic versioning (MAJOR.MINOR.PATCH):
- MAJOR — breaking changes that require additional testing and caution.
- MINOR — new functionality with limited impact.
- PATCH — bug fixes and hotfixes only.
All changes are documented in the changelog and on the releases page.
License
This SDK is open source software licensed under the MIT license.
Made with care by Buckaroo.
This document is subject to change; typos and language errors are possible.