raysoft/kdniao

There is no license information available for the latest version (0.1.2) of this package.

快递鸟API for the Yii framework

Installs: 770

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Type:yii-extension

0.1.2 2016-09-01 07:53 UTC

This package is not auto-updated.

Last update: 2024-04-13 16:29:30 UTC


README

官方的文档比较混乱, 提供的demo很原生态, 故制作此模块

目前已实现:

  • 即时查询接口
  • 订阅查询接口
  • 在线下单
  • 电子面单
  • 单号识别

官方文档: (http://www.kdniao.com/api-track)

需要APP IDAPP 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('快递单号');