The Bongloy PHP library provides convenient access to the Bongloy API from applications written in the PHP language. It includes a pre-defined set of classes for API resources that initialize themselves dynamically from API responses which makes it compatible with a wide range of versions of the Bongloy API.
PHP 5.6.0 and later.
You can install the bindings via Composer. Run the following command:
composer require bongloy/bongloy-php
To use the bindings, use Composer's autoload:
require_once('vendor/autoload.php');
Simple usage looks like:
\Bongloy\Bongloy::setApiKey('sk_test_*****');
$charge = \Bongloy\Charge::create([
'amount' => 1000,
'currency' => 'USD',
'source' => '6b1ca112-add7-4bc6-b520-829e004c0580',
]);
echo $charge;
For a comprehensive list of examples, check out the API documentation.