Skip to content

nason-ma/gw-supply-chain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gw-supply-chain

A API SDK for gwlp supply chain.

StyleCI build status

安装

$ composer require nason/gw-supply-chain -vvv

配置

在使用本扩展之前,你需要通过 广物供应链平台 获取到接口凭证:wid 和 token。

使用

商品接口

use Nason\GwSupplyChain\Product;

$wid = 'xxxxxxxxxxxxxxxxxxxxxxxx';
$token = 'xxxxxxxxxxxxxxxxxxxxxxxx';

$productApi = new Product($wid, $token);

如:获取商品详情

$goodsId = 68;

$response = $productApi->getGoodsInfo($goodsId);

类目接口

use Nason\GwSupplyChain\Category;

$wid = 'xxxxxxxxxxxxxxxxxxxxxxxx';
$token = 'xxxxxxxxxxxxxxxxxxxxxxxx';

$categoryApi = new Category($wid, $token);

获取分类列表

$page = 1;
$limit = 50;

$response = $categoryApi->getCategoryList($page, $limit);

获取单个分类数据

$categoryId = 1;

$response = $categoryApi->getCategoryInfo($categoryId);

订单接口

use Nason\GwSupplyChain\Order;

$wid = 'xxxxxxxxxxxxxxxxxxxxxxxx';
$token = 'xxxxxxxxxxxxxxxxxxxxxxxx';

$orderApi = new Order($wid, $token);

如:取消订单

$orderSn = 'xxxxxxxxxxxxxxxxxxxxx';

$response = $orderApi->cancelOrder($orderSn);

参考

License

MIT