dhl sdk api unified location finder
3.2.0
Le package SDK API DPDHL Unified Location Finder offre une interface aux services Web suivants:
netresearch/jsonmapper : Mappeur pour la désérialisation des messages de réponse JSON dans des objets PHPphp-http/discovery : Discovery Service for HTTP Client and Message Factory Implémentationsphp-http/httplug : Abstraction du client HTTP enfichablephp-http/logger-plugin : HTTP Client Logger Plugin pour HTTPLUGpsr/http-client : Interfaces client HTTP PSR-18 HTTPpsr/http-factory : PSR-7 Interfaces d'usine de message HTTPpsr/http-message : Interfaces de message HTTP PSR-7psr/log : interfaces PSR-3 Loggerpsr/http-client-implementation : Tout package qui fournit un client HTTP compatible PSR-18psr/http-factory-implementation : Tout package qui fournit des usines de messages HTTP compatibles PSR-7psr/http-message-implementation : Tout package qui fournit des messages HTTP PSR-7nyholm/psr7 : PSR-7 HTTP Message Factory & Message Implémentationphpunit/phpunit : framework de testphp-http/mock-client : HTTPLUG MOCK Implémentation du clientphpstan/phpstan : outil d'analyse statiquesquizlabs/php_codesniffer : outil d'analyse statiquerector/rector : outil de refactorisation automatique pour aider les mises à niveau PHPfig/log-test : Test Utilitaires pour psr/log $ composer require dhl/sdk-api-unified-location-finder$ composer remove dhl/sdk-api-unified-location-finder$ ./vendor/bin/phpunit -c test/phpunit.xmlLe SDK API DPDHL Unified Location Finder prend en charge les fonctionnalités suivantes:
Les composants de la bibliothèque adaptés à la consommation comprennent
$ 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
} Le SDK lancera uniquement des exceptions de type DhlSdkUnifiedLocationFinderExceptionServiceException . Les sous-classes de ServiceException peuvent être utilisées pour décrire le type d'erreur qui s'est produite.
A DhlSdkUnifiedLocationFinderExceptionDetailedServiceException indique que l'exception contient un message d'erreur lisible par l'homme adapté à l'affichage à l'utilisateur final.