dhl sdk api unified location finder
3.2.0
Das DPDHL Unified Location Finder API SDK -Paket bietet eine Schnittstelle zu den folgenden Webdiensten:
netresearch/jsonmapper : Mapper für die Deserialisierung von JSON -Antwortnachrichten in PHP -Objektephp-http/discovery : Erkennungsdienst für HTTP-Client- und Message Factory-Implementierungenphp-http/httplug : Steckbare HTTP-Client-Abstraktionphp-http/logger-plugin : HTTP-Client-Logger-Plugin für HTTPLUGpsr/http-client : PSR-18 HTTP-Client-Schnittstellenpsr/http-factory : PSR-7 HTTP Message Factory-Schnittstellenpsr/http-message : PSR-7 HTTP-Nachrichtenoberflächenpsr/log : PSR-3-Logger-Schnittstellenpsr/http-client-implementation : Jedes Paket, das einen PSR-18-kompatiblen HTTP-Client bietetpsr/http-factory-implementation : Jedes Paket, das PSR-7-kompatible HTTP-Nachrichtenfabriken bietetpsr/http-message-implementation : Jedes Paket, das PSR-7-HTTP-Nachrichten bereitstelltnyholm/psr7 : PSR-7 HTTP Message Factory & Message Implementierungphpunit/phpunit : Tests -Frameworkphp-http/mock-client : Httplug Mock Client-Implementierungphpstan/phpstan : Statische Analysewerkzeugsquizlabs/php_codesniffer : Statische Analyse -Toolrector/rector : Automatisches Refactoring -Tool, das bei PHP -Upgrades hilftfig/log-test : Testen Sie Dienstprogramme für psr/log $ composer require dhl/sdk-api-unified-location-finder$ composer remove dhl/sdk-api-unified-location-finder$ ./vendor/bin/phpunit -c test/phpunit.xmlDer DPDHL Unified Location Finder API SDK unterstützt die folgenden Funktionen:
Die für den Verbrauch geeigneten Komponenten der Bibliothek umfassen
$ consumerKey = ' Your application consumer key ' ;
$ logger = new Psr Log NullLogger ();
$ serviceFactory = new Dhl Sdk UnifiedLocationFinder Service ServiceFactory ();
$ 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 ( Dhl Sdk UnifiedLocationFinder Exception ServiceException $ e ) {
// handle errors
} Der SDK wird immer nur Ausnahmen vom Typ DhlSdkUnifiedLocationFinderExceptionServiceException werfen. Unterklassen der ServiceException können verwendet werden, um die Art des aufgetretenen Fehlers zu beschreiben.
A DhlSdkUnifiedLocationFinderExceptionDetailedServiceException zeigt an, dass die Ausnahme eine für die Anzeige für den Endbenutzer geeignete Fehlermeldung enthält.