syships/php-logistic
最新稳定版本:1.0.1
Composer 安装命令:
composer require syships/php-logistic
包简介
The logistic SDK for the php
关键字:
README 文档
README
This is a personal plugin for study. It is strongly recomended that you DO NOT use it. This plugin is UNSTABLE.
It is the logistic plugin for php
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist syships/php-logistic "*"
or add
"syships/php-logistic": "*"
to the require section of your composer.json file.
Usage
Once the extension is installed, simply use it in your code by :
require_once __DIR__.'/vendor/autoload.php';
use Symfony\Component\HttpFoundation\Response;
use syships\logistic\LogisticApplication;
$config = [
'company_name'=>'中通',
'app_id'=>'app_id',
'app_secret'=>'app_secret',
'server_url'=>'http://japi-test.zto.com/',
];
$data = [
'waybill_code'=>"73100135377958",//运单号
];
$logisticApp = new LogisticApplication($companyName,$config);
if($logisticApp->track($data)){
$response = new Response(json_encode($logisticApp->getSuccessData()),200,['Content-Type'=>'application/json']);
$response->send();
}else{
$response = new Response($logisticApp->getFirstError(),400,['Content-Type'=>'application/json']);
$response->send();
}
统计信息
- 总下载量: 10
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2024-09-04