2017 © Pedro Peláez
 

library shipment-tracking-dhl-ecommerce

A flexible and shipment tracking library for DHL eCommerce.

image

slince/shipment-tracking-dhl-ecommerce

A flexible and shipment tracking library for DHL eCommerce.

  • Friday, July 28, 2017
  • by slince
  • Repository
  • 1 Watchers
  • 1 Stars
  • 14 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 2 Versions
  • 8 % Grown

The README.md

Shipment Tracking Library For DHL eCommerce

Build Status Coverage Status Latest Stable Version Scrutinizer, (*1)

A flexible and shipment tracking library for DHL eCommerce and DHL eCommerce(Registered), (*2)

Installation

Install via composer, (*3)

$ composer require slince/shipment-tracking-dhl-ecommerce

Basic Usage


$tracker = new Slince\ShipmentTracking\DHLECommerce\DHLECommerceTracker(CLIENT_ID, PASSWORD); try { $shipment = $tracker->track('CNAQV100168101'); if ($shipment->isDelivered()) { echo "Delivered"; } echo $shipment->getOrigin(); echo $shipment->getDestination(); print_r($shipment->getEvents()); //print the shipment events } catch (Slince\ShipmentTracking\Exception\TrackException $exception) { exit('Track error: ' . $exception->getMessage()); }

The above code will get access token automatically for shipment information., (*4)

Access Token

$shipment = $tacker->track('CNAQV100168101);
$accessToken = $tracker->getAccessToken(); //You can save this for the next query

//... to do

try{
    $tracker->setAccessToken($accessToken); //Set the access token; the tracker will not send requst for the access token
    $shipment = $tacker->track('CNAQV100168101);
} catch (Slince\ShipmentTracking\DHLECommerce\Exception\InvalidAccessTokenException $exception) {
     $accessToken = $tracker->getAccessToken(true); // If the access token is invalid, refresh it.
     $shipment = $tacker->track('CNAQV100168101);
     //... to do
} catch (Slince\ShipmentTracking\Exception\TrackException $exception) {
    exit('Track error: ' . $exception->getMessage());
}

License

The MIT license. See MIT, (*5)

The Versions

28/07 2017

dev-master

9999999-dev

A flexible and shipment tracking library for DHL eCommerce.

  Sources   Download

MIT

The Requires

 

The Development Requires

by tao

tracking dhl tracker shipment parcel dhl ecommerce

28/07 2017

1.0.0

1.0.0.0

A flexible and shipment tracking library for DHL eCommerce.

  Sources   Download

MIT

The Requires

 

The Development Requires

by tao

tracking dhl tracker shipment parcel dhl ecommerce