slince/shipment-tracking-yanwen-express

A flexible and shipment tracking library for Yanwen Express.

1.1.0 2017-08-01 09:23 UTC

This package is not auto-updated.

Last update: 2020-10-11 12:24:38 UTC


README

Build Status Coverage Status Latest Stable Version Scrutinizer

A flexible and shipment tracking library for Yanwen Express(燕文物流).

Installation

Install via composer

$ composer require slince/shipment-tracking-yanwen-express

Basic Usage

$tracker = new Slince\ShipmentTracking\YanWenExpress\YanWenTracker(KEY, 'en');

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());
}

License

The MIT license. See MIT