dhl sdk api unified location finder
3.2.0
The DPDHL Unified Location Finder API SDK package offers an interface to the following web services:
netresearch/jsonmapper: Mapper for deserialization of JSON response messages into PHP objectsphp-http/discovery: Discovery service for HTTP client and message factory implementationsphp-http/httplug: Pluggable HTTP client abstractionphp-http/logger-plugin: HTTP client logger plugin for HTTPlugpsr/http-client: PSR-18 HTTP client interfacespsr/http-factory: PSR-7 HTTP message factory interfacespsr/http-message: PSR-7 HTTP message interfacespsr/log: PSR-3 logger interfacespsr/http-client-implementation: Any package that provides a PSR-18 compatible HTTP clientpsr/http-factory-implementation: Any package that provides PSR-7 compatible HTTP message factoriespsr/http-message-implementation: Any package that provides PSR-7 HTTP messagesnyholm/psr7: PSR-7 HTTP message factory & message implementationphpunit/phpunit: Testing frameworkphp-http/mock-client: HTTPlug mock client implementationphpstan/phpstan: Static analysis toolsquizlabs/php_codesniffer: Static analysis toolrector/rector: Automatic refactoring tool to help with PHP upgradesfig/log-test: Test utilities for psr/log
$ composer require dhl/sdk-api-unified-location-finder$ composer remove dhl/sdk-api-unified-location-finder$ ./vendor/bin/phpunit -c test/phpunit.xmlThe DPDHL Unified Location Finder API SDK supports the following features:
The library's components suitable for consumption comprise
$consumerKey = 'Your application consumer key';
$logger = new PsrLogNullLogger();
$serviceFactory = new DhlSdkUnifiedLocationFinderServiceServiceFactory();
$service = $serviceFactory->createLocationFinderService($consumerKey, $logger);
try {
/** @var DhlSdkUnifiedLocationFinderApiDataLocationInterface $locations */
$locations = $service->getPickUpLocations(
$countryCode = 'DE',
$postalCode = '04129',
$city = 'Leipzig',
$street = 'Nonnenstraße 11d',
$service = 'parcel-eu',
$radius = 2000,
$limit = 25
);
} catch (DhlSdkUnifiedLocationFinderExceptionServiceException $e) {
// handle errors
}The SDK will only ever throw exceptions of type DhlSdkUnifiedLocationFinderExceptionServiceException.
Subclasses of ServiceException may be used to describe the kind of error that occurred.
A DhlSdkUnifiedLocationFinderExceptionDetailedServiceException indicates that the exception holds a
human-readable error message suitable for display to the end-user.