Giter Club home page Giter Club logo

dhl-sdk-api-unified-location-finder's Introduction

DPDHL Unified Location Finder API SDK

The DPDHL Unified Location Finder API SDK package offers an interface to the following web services:

  • Location Finder - Unified

Requirements

System Requirements

  • PHP 8.1+ with JSON extension

Package Requirements

  • netresearch/jsonmapper: Mapper for deserialization of JSON response messages into PHP objects
  • php-http/discovery: Discovery service for HTTP client and message factory implementations
  • php-http/httplug: Pluggable HTTP client abstraction
  • php-http/logger-plugin: HTTP client logger plugin for HTTPlug
  • psr/http-client: PSR-18 HTTP client interfaces
  • psr/http-factory: PSR-7 HTTP message factory interfaces
  • psr/http-message: PSR-7 HTTP message interfaces
  • psr/log: PSR-3 logger interfaces

Virtual Package Requirements

  • psr/http-client-implementation: Any package that provides a PSR-18 compatible HTTP client
  • psr/http-factory-implementation: Any package that provides PSR-7 compatible HTTP message factories
  • psr/http-message-implementation: Any package that provides PSR-7 HTTP messages

Development Package Requirements

  • nyholm/psr7: PSR-7 HTTP message factory & message implementation
  • phpunit/phpunit: Testing framework
  • php-http/mock-client: HTTPlug mock client implementation
  • phpstan/phpstan: Static analysis tool
  • squizlabs/php_codesniffer: Static analysis tool
  • rector/rector: Automatic refactoring tool to help with PHP upgrades
  • fig/log-test: Test utilities for psr/log

Installation

$ composer require dhl/sdk-api-unified-location-finder

Uninstallation

$ composer remove dhl/sdk-api-unified-location-finder

Testing

$ ./vendor/bin/phpunit -c test/phpunit.xml

Features

The DPDHL Unified Location Finder API SDK supports the following features:

  • Find DHL Service Points for sending and receiving packages.

Public API

The library's components suitable for consumption comprise

  • service:
    • service factory
    • location finder service
  • data transfer objects:
    • service point location with address, geo coordinates, opening hours specifications

Usage

$consumerKey = 'Your application consumer key';
$logger = new \Psr\Log\NullLogger();

$serviceFactory = new \Dhl\Sdk\UnifiedLocationFinder\Service\ServiceFactory();
$service = $serviceFactory->createLocationFinderService($consumerKey, $logger);

try {
    /** @var \Dhl\Sdk\UnifiedLocationFinder\Api\Data\LocationInterface $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
}

Error handling

The SDK will only ever throw exceptions of type \Dhl\Sdk\UnifiedLocationFinder\Exception\ServiceException. Subclasses of ServiceException may be used to describe the kind of error that occurred.

A \Dhl\Sdk\UnifiedLocationFinder\Exception\DetailedServiceException indicates that the exception holds a human-readable error message suitable for display to the end-user.

dhl-sdk-api-unified-location-finder's People

Contributors

mam08ixo avatar powli avatar sebastian80 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dhl-sdk-api-unified-location-finder's Issues

Add Location Type to the package

the most usage for the package for getting for by location type
could you please add location type as a part of get locationByAddress or add a new method that works for location type

thanks for your package it's really awesome :)

Add `containedInPlace` to ResponseType `Place`

According to API data schema there is a property containedInPlace inside the place property, besides geo and address. This describes as follows: "Description of the building/facility etc. this service point is located within". This can be a valuable hint for a customer where to find the pickup location, especially for Packstations that do not have descriptive names. First, the customer can find the place when he does not know where the Packstation is exactly located. Second, the customer might know "My Packstation is at Edeka Supermarket", but does not know which Packstation number he has to choose.

Especially for Packstations that are located within train stations or shopping centers that could be quite helpful.

Example:

  1. Search for postal code 09119 in country DE
  2. Find location 8007-409119139 which is "Packstation 139"
  3. See that there is no descriptive name for this Packstation, besides "Packstation 139".
  4. The containedInPlace property, in this case "EDEKA Markt" gives the customer a hint, where the Packstation is located and he can choose the correct Packstation without knowing the Packstation number or the street address.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.