PHP code example of billabear / php-sdk
1. Go to this page and download the library: Download billabear/php-sdk 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/ */
billabear / php-sdk example snippets
onfigure API key authorization: ApiKeyAuth
$config = BillaBear\Configuration::getDefaultConfiguration()
->setHost('YOUR_API_URL')
->setApiKey('X-API-Key', 'YOUR_API_KEY');
$apiInstance = new BillaBear\Api\CheckoutApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$body = new \BillaBear\Model\CheckoutBody(); // \BillaBear\Model\CheckoutBody |
try {
$result = $apiInstance->createCheckout($body);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling CheckoutApi->createCheckout: ', $e->getMessage(), PHP_EOL;
}