Please ask DHL for username, password and Customer ID in order to access their API.
Use composer to install this package.
Create a package and order a courier.
$dhl = new Dhl('user', 'pass', 1234, __DIR__ . '/temp');
$payment = new Payment('SK4123000000000002045678', 'POBNSKBA', '123456', 100.0);
$sender = NULL;
$recipient = new Address('TEST','TEST','TEST','TEST','SK');
$package = new Package(25183385203, Package::TYPE_SK_COD, Package::DEPO_HQ_BRATISLAVA, $recipient, $sender, $payment, [Package::FLAG_SAT], 'TEST');
$dhl->createPackages([$package]);
$dhl->createPickupOrders([new PickupOrder('TEST','TEST', 1, $recipient, 'info@example.org', NULL, NULL, NULL, 'TEST')])
Generating PDF labels
header('Content-Type: application/pdf');
echo PdfLabel::generateLabels($packages, PdfLabel::QUARTER);
Tests are build with Nette Tester. You can run it like this:
php -f tester ./ -c php.ini-mac --coverage coverage.html --coverage-src ../src
- PHP 7.1+
This code is based and inspired by salamek/ppl-my-api.
MIT License (c) Pavol Biely
Read the provided LICENSE file for details.