slince/shipment-tracking-kuaidi100

A flexible and shipment tracking library for Kuaidi100.

1.0.0 2017-07-28 04:11 UTC

This package is not auto-updated.

Last update: 2024-12-22 05:39:42 UTC


README

Build Status Coverage Status Latest Stable Version Scrutinizer

快递100物流信息查询库

Installation

Install via composer

$ composer require slince/shipment-tracking-kuaidi100

Basic Usage

$tracker = new Slince\ShipmentTracking\KuaiDi100\KuaiDi100Tracker(APPKEY, 'shunfeng'); //承运商名称并不是标准的承运商代码,实际承运商代码请到kuaidi100.com查看

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

快递100的key需要自行申请,免费版的key在查询申通顺丰之类的单号时会受限,需要企业版才可以;附上快递100文档

License

The MIT license. See MIT