PHP code example of masmerise / de-ridder-den-hertog-php-sdk
1. Go to this page and download the library: Download masmerise/de-ridder-den-hertog-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/ */
masmerise / de-ridder-den-hertog-php-sdk example snippets
use DeRidderDenHertog\Authentication\ApiGuid;
use DeRidderDenHertog\DeRidderDenHertog;
$guid = ApiGuid::fromString('{4844a45c-33d1-4937-83f4-366d36449eaf}');
$renh = DeRidderDenHertog::authenticate($guid);
$renh = DeRidderDenHertog::authenticate($guid)->useTest();
$renh->useTest();
$customers = $renh->getCustomers(); // https://test.renh.online
$renh->useProduction();
$customers = $renh->getCustomers(); // https://renh.online
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: '[email protected] ',
houseNumber: '40',
name: 'PHP SDK',
phone: '0470123456',
street: 'Teststraat',
zipCode: '9000',
);
$customerId = $renh->setCustomer($data);
use DeRidderDenHertog\SetCustomer\Failure\CouldNotSetCustomer;
try {
$customerId = $renh->setCustomer($data);
} catch (CouldNotSetCustomer $ex) {
$logger->log($ex->getMessage());
}
use DeRidderDenHertog\Core\Failure\CouldNotCompleteRequest;
try {
$transactions = $renh->getDayTurnover(from: $from, till: $till);
} catch (CouldNotCompleteRequest $ex) {
$logger->log($ex->fault); // "Request timeout (90 seconds). (22, ERR_TIMEOUT_REQUEST)"
}
bash
composer