This SDK provides convenient, fully-typed access to De Ridder & Den Hertog's API.
You can install the package via composer:
composer require masmerise/de-ridder-den-hertog-php-sdkYou may also use one of the available adapters instead:
You can always refer to the documentation to examine the various resources that are available.
use DeRidderDenHertog\Authentication\ApiGuid;
use DeRidderDenHertog\DeRidderDenHertog;
$guid = ApiGuid::fromString('{4844a45c-33d1-4937-83f4-366d36449eaf}');
$renh = DeRidderDenHertog::authenticate($guid);use DeRidderDenHertog\Core\Type\Parameter\Filter;
$filter = Filter::fromSql('Klantnummer=123456789');
[$customer] = $renh->getCustomers(filter: $filter);use DeRidderDenHertog\SetCustomer\Type\Parameter\CustomerData;
$data = CustomerData::parameters(
city: 'Ghent',
emailAddress: 'php.sdk@github.action',
houseNumber: '40',
name: 'PHP SDK',
phone: '0470123456',
street: 'Teststraat',
zipCode: '9000',
);
$customerId = $renh->setCustomer($data);The SDK uses exceptions as its medium to communicate failures.
DeRidderDenHertogException
├── CouldNotAuthenticate (Authentication Errors)
├── UnknownException (Connection Errors)
└── ValidationException (Request Errors)
├── CouldNotDeleteCustomer
├── CouldNotGetApiFunctions
├── CouldNotGetCustomers
├── CouldNotGetDayTurnover
├── CouldNotSetCustomer
└── ...
use DeRidderDenHertog\SetCustomer\Failure\CouldNotSetCustomer;
try {
$customerId = $renh->setCustomer($data);
} catch (CouldNotSetCustomer $ex) {
$logger->log($ex->getMessage());
}The SDK defaults to a 30 second timeout.
| Action |
|---|
| DeleteCustomer |
| GetAPIFunctions |
| GetCustomers |
| GetDayTurnover |
| SetCustomer |
While the SDK is battle-tested and production-ready, only a handful of API interactions have been implemented thus far. Please bear in mind this is an unofficial SDK, so we have to prioritize available resources at this time.
However, always feel free to submit a feature or pull request!
composer testPlease see CHANGELOG for more information on what has changed recently.
If you discover any security related issues, please email support@masmerise.be instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.
