PHP code example of froccsos / billingo-api-connector
1. Go to this page and download the library: Download froccsos/billingo-api-connector library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
froccsos / billingo-api-connector example snippets
// Source: http://www.php-fig.org/psr/psr-4/examples/
spl_autoload_register(function ($class) {
// project-specific namespace prefix
$prefix = 'Billingo\\API\\Connector';
// base directory for the namespace prefix
$base_dir = __DIR__ . '/src/';
// does the class use the namespace prefix?
$len = strlen($prefix);
if (strncmp($prefix, $class, $len) !== 0) {
// no, move to the next registered autoloader
return;
}
// get the relative class name
$relative_class = substr($class, $len);
// replace the namespace prefix with the base directory, replace namespace
// separators with directory separators in the relative class name, append
// with .php
$file = $base_dir . str_replace('\\', '/', $relative_class) . '.php';
// if the file exists,
use Billingo\API\Connector\HTTP\Request;
$billingo = new Request([
'public_key' => 'YOUR_PUBLIC_KEY',
'private_key' => 'YOUR_PRIVATE_KEY'
]);
// Return the first page of the clients
$clients = $billingo->get('clients');
// Return the next page
$clients = $billingo->get('clients', ['page' => 2]);
// Return one client
$client = $billingo->get('clients/123456789');