PHP SDK

The Buckaroo PHP SDK is an open source library that connects a PHP application to the Buckaroo API. It handles authentication, request signing and response parsing, so you can start payments, verify push messages, and refund or look up transactions with a few lines of code.
Running a store on an e-commerce platform? Use one of our ready-made plugins and apps instead. This SDK is for custom applications.
Building a Laravel application?
The Laravel Wrapper is built on this SDK and adds Laravel conventions.
Requirements
| Requirement | Details |
|---|---|
| Buckaroo account | Create an account if you do not have one yet |
| PHP | 7.4 or higher |
| PHP extensions | json, pcre, fileinfo |
| OpenSSL | An up-to-date SSL/TLS toolkit |
| Composer | To install the SDK and its dependencies |
Installation
Install the SDK with Composer:
composer require buckaroo/sdkComposer also installs the SDK's own dependencies, so there is nothing else to set up.
The source code is on GitHub.
Quick start
Create the client with your store key and secret key, then start a payment and send the customer to the payment page:
require __DIR__ . '/vendor/autoload.php';
$buckaroo = new \Buckaroo\BuckarooClient('STORE_KEY', 'SECRET_KEY', 'test');
$response = $buckaroo->method('ideal')->pay([
'invoice' => 'INV-1001', // must be unique per payment
'amountDebit' => 10.00,
'description' => 'Order #1001',
'returnURL' => 'https://example.com/buckaroo/return',
'pushURL' => 'https://example.com/buckaroo/push',
]);
if ($response->hasRedirect()) {
header('Location: ' . $response->getRedirectUrl());
exit;
}That starts an iDEAL | Wero payment in test mode. The result of the payment arrives on your push URL, so continue with these pages in order:
- Configuration: credentials, test and live mode, defaults and logging
- Payments: start a payment, read the response and handle errors
- Push messages: receive and verify the payment result
- Order management: refunds, captures and transaction lookups
- Test and go live: what to test and how to switch to production
What you can build
The SDK covers the Buckaroo payment methods and the additional services such as Subscriptions, Credit Management, PayPerEmail, Split Payments and iDIN. Every method is called the same way, with its own service code.
- Payment methods describes each method and its request parameters
- The service code list in the repository links to a runnable example for each method
Versioning
The SDK 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 in the changelog and on the releases page.
Contribute
The SDK is open source under the MIT license, and contributions are welcome.
Read the contribution guidelines before you open a pull request, and target the develop branch.
Updated 7 days ago