Buckaroo payment SDK

1.17.1 2024-12-05 07:52 UTC

README

Buckaroo PHP SDK

Latest release

Index

About

Buckaroo is the the Payment Service Provider for all your online payments with more than 30,000 companies relying on Buckaroo's platform to securely process their payments, subscriptions and unpaid invoices. Buckaroo developed their own PHP SDK. The SDK is a modern, open-source PHP library that makes it easy to integrate your PHP application with Buckaroo's services. Start accepting payments today with Buckaroo.

Requirements

To use the Buckaroo API client, the following things are required:

  • A Buckaroo account (Dutch or English)
  • PHP >= 8.1
  • Up-to-date OpenSSL (or other SSL/TLS toolkit)

Composer Installation

By far the easiest way to install the Buckaroo API client is to require it with Composer.

$ composer require buckaroo/sdk:^1.0

{
    "require": {
        "buckaroo/sdk": "^1.0"
    }
}

Example

Create and config the Buckaroo object. You can find your credentials in plaza WEBSITE_KEY and SECRET_KEY

require __DIR__ . '/vendor/autoload.php';

# Get your website & secret key in your plaza.
# You can perform a test payment by giving the third param with the string "test", on default it is set on "test".
# By changing the value of the third parameter to "live", a live transaction can be performed.
$buckaroo = new \BuckarooClient('WEBSITE_KEY', 'SECRET_KEY', 'test');

Create a payment with all the available payment methods. In this example, we show how to create a credit card payment. Each payment has a slightly different payload.

# Create a new payment
$buckaroo->method('creditcard') // Input the desire payment method.
    ->pay([
        'name'          => 'visa', // Request to pay with Visa
        'amountDebit'   => 10, // The amount we want to charge
        'invoice'       => 'UNIQUE-INVOICE-NO', // Each payment must contain a unique invoice number
    ]);

After you create a transaction, you can retrieve several transaction information on demand.

# Retrieve transaction information
$transaction = $buckaroo->transaction('YOUR-TRANSACTION-KEY')

$transaction->status(); // Retrieve transaction status
$transaction->refundInfo(); // Retrieve refund info
$transaction->cancelInfo() // Retrieve cancellation info

Find our full documentation online on docs.buckaroo.io.

Contribute

We really appreciate it when developers contribute to improve the Buckaroo plugins. If you want to contribute as well, then please follow our Contribution Guidelines.

Versioning

  • MAJOR: Breaking changes that require additional testing/caution
  • MINOR: Changes that should not have a big impact
  • PATCHES: Bug and hotfixes only

Additional information

License

Buckaroo PHP SDK is open-sourced software licensed under the MIT license.