raysoft / kdniao
快递鸟API for the Yii framework
Installs: 770
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Type:yii-extension
Requires
- rmccue/requests: >=1.0
- yiisoft/yii2: >=2.0.4
This package is not auto-updated.
Last update: 2025-01-04 20:42:02 UTC
README
官方的文档比较混乱, 提供的demo很原生态, 故制作此模块
目前已实现:
- 即时查询接口
- 订阅查询接口
- 在线下单
- 电子面单
- 单号识别
官方文档: (http://www.kdniao.com/api-track)
需要APP ID
和APP KEY
, 请注册申请后, 在后台查看(http://www.kdniao.com/UserCenter/Index.aspx)
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --dev --prefer-dist raysoft/kdniao
or add
"raysoft/kdniao": "*"
to the require section of your composer.json
file.
Usage
Once the extension is installed, simply modify your application configuration as follows:
return [ 'components' => [ 'kdniao' => [ 'class' => 'raysoft\kdniao\Kdniao', 'appId' => '商户ID', 'appKey' => 'APP Key', ], // ... ], // ... ];
You can then access this module in your code:
Yii::$app->kdniao...
即时查询接口:
Yii::$app->kdniao->track('快递单号', '快递公司代码(不知道可留空)');
单号识别:
Yii::$app->kdniao->shipper('快递单号');