dev-master
9999999-devaccess to logistics system via kuaidi100
proprietary
The Requires
The Development Requires
1.0.0
1.0.0.0access to logistics system via kuaidi100
proprietary
The Requires
The Development Requires
access to logistics system via kuaidi100
Use APIs exposed by Kuaidi100 to implement logisitics query service., (*1)
Request API key (the
use Homer\Logistics\Kuaidi100\Service as LogisticsService; $service = new LogisticsService(<YOUR_COMPANY_NAME>, <KEY>); // - or the full version // $service = new LogisticsService(<YOUR_COMPANY_NAME>, <KEY>, $optionsOfService, $instanceOfClient); // to start tracking waybill $service->track(<waybill#>, $options); // handle on waybill's status update $service->handleWaybillUpdated($notification, Closure $callback); // eagerly query logistics of some waybill $logistics = $service->query(<CODE_OF_LOGISTICS_COMPANY>, <waybill#>, <FROM_LOCATION>, <TO_LOCATION>);
__construct($name, $key, array $options = [], ClientInterface $client = null)
, (*3)
$name
name of the your company (it will be used when eagerly query logistics)$key
API key (from Kuaidi100)$options
some configurations, including:
notification_url
the url to receive notification on waybill's status updatesalt
(optional) a globally choosen value for response's signature verification.You can start tracking some waybill's logistics by calling the track
method., (*4)
track($waybillNo, array $options = [])
, (*5)
$waybillNo
waybill's number (of the waybill to track)$options
options, including:
Return value of this method is a boolean value, true on success, false otherwise. Status/new logistics of the waybill will be notified once tracking is applied., (*6)
handleWaybillUpdated($notification, Closure $callback, $salt = null)
, (*7)
The returned value is an object containing updated status (with 'tracking', 'domestic' and an optional 'overseas' fields)., (*8)
Eagerly check status of some waybill., (*9)
query($company, $waybillNo, $from, $to)
, (*10)
$company
the logistics company's code
$waybillNo
waybill's number $from
出发地城市,格式: 省市区。例如: 广东省深圳市南山区$to
目的地城市,格式: 省市区。例如: 北京市朝阳区The return value contains only domestic logistics for now., (*11)
access to logistics system via kuaidi100
proprietary
access to logistics system via kuaidi100
proprietary