argovaerts / bonsai-php
Bonsai API client library for PHP. Bonsai is a Belgian payment app that for every ten payments plants a tree.
dev-main
2021-07-23 16:15 UTC
Requires
- ext-curl: *
- ext-json: *
- ext-openssl: *
- composer/ca-bundle: ^1.1
- guzzlehttp/guzzle: ^6.3 || ^7.0
Requires (Dev)
- phpunit/phpunit: ^9.5
This package is auto-updated.
Last update: 2025-03-24 00:19:38 UTC
README
Bonsai is a Belgian payment app that for every ten payments plants a tree.
This is a community effort to make a PHP SDK to make the usage of the API more straight forward.
Requirements
- Bonsai account with merchant functionality active
-
= PHP 8.0 (other version might work as well, untested)
- PHP cURL extension
- Up-to-date OpenSSL (or other SSL/TLS toolkit)
Installation
By far the easiest way to install the Bonsai API client is to require it with Composer.
$ composer require argovaerts/bonsai-php
{
"require": {
"argovaerts/bonsai-php": "*"
}
}
Creating a payment
use Bonsai\Api\BonsaiApiClient;
$client = new BonsaiApiClient('API_KEY', 'PROFILE_ID', <IS_TEST_BOOLEAN>);
$output = $this->client->create_transaction->perform([
'amount' => '0.01',
'clientReference' => 'reference or order id',
]);
Want to improve the API client?
This project is open for pull requests.