Unofficial Fakturoid.cz API PHP wrapper. Official library and API documentation
- more strict data binding
- PHP7 support
- better test coverage
The recommended way to install this library is through Composer:
composer require k0nias/fakturoid-api:dev-master
use K0nias\FakturoidApi\Api;
use K0nias\FakturoidApi\Http\Request\GetInvoicesRequest;
use K0nias\FakturoidApi\Model\Invoice\Filter\Parameters;
use K0nias\FakturoidApi\Model\Invoice\Status;
require_once __DIR__.'/vendor/autoload.php';
$slug = 'test';
$email = '[email protected]';
$apiToken = 'xxx';
$api = new Api($slug, $email, $apiToken);
$filterParameters = new Parameters();
$filterParameters->status(Status::open())
->page(2);
// generic version of getting response for request
// @var \K0nias\FakturoidApi\Http\Response\ResponseInterface $response
$response = $api->process(new GetInvoicesRequest($filterParameters));
// more specific version of getting response for request
// @var \K0nias\FakturoidApi\Http\Response\GetInvoicesResponse $response
$response = (new GetInvoicesRequest($filterParameters))->send($api);
To run the test suite, you need Composer:
composer install
composer test