dhl sdk api unified location finder
3.2.0
O pacote API SDK DPDHL Unified Location Finder API oferece uma interface para os seguintes serviços da Web:
netresearch/jsonmapper : mapeador para deserialização de mensagens de resposta JSON em objetos PHPphp-http/discovery : Serviço de Discovery para implementações de cliente e fábrica de mensagens HTTPphp-http/httplug : abstração http http giratóriaphp-http/logger-plugin : http client logger plugin para httplugpsr/http-client : PSR-18 HTTP Client Interfacespsr/http-factory : PSR-7 HTTP Message Factory Interfacespsr/http-message : interfaces de mensagem HTTP PSR-7psr/log : Interfaces de Logger PSR-3psr/http-client-implementation : Qualquer pacote que forneça um cliente HTTP compatível com PSR-18psr/http-factory-implementation : Qualquer pacote que forneça fábricas de mensagens HTTP compatíveis com PSR-7psr/http-message-implementation : Qualquer pacote que forneça mensagens PSR-7 HTTPnyholm/psr7 : PSR-7 HTTP Message Factory & Message Implementationphpunit/phpunit : estrutura de testephp-http/mock-client : implementação do cliente simulado httplugphpstan/phpstan : ferramenta de análise estáticasquizlabs/php_codesniffer : ferramenta de análise estáticarector/rector : Ferramenta de refatoração automática para ajudar com atualizações de PHPfig/log-test : Utilitários de teste para psr/log $ composer require dhl/sdk-api-unified-location-finder$ composer remove dhl/sdk-api-unified-location-finder$ ./vendor/bin/phpunit -c test/phpunit.xmlO DPDHL Unified Location Finder API SDK suporta os seguintes recursos:
Os componentes da biblioteca adequados para consumo compreendem
$ 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
} O SDK só lançará exceções do tipo DhlSdkUnifiedLocationFinderExceptionServiceException . As subclasses da ServiceException podem ser usadas para descrever o tipo de erro que ocorreu.
A DhlSdkUnifiedLocationFinderExceptionDetailedServiceException indica que a exceção contém uma mensagem de erro legível por humanos adequada para exibição ao usuário final.