nason/gw-supply-chain

A API SDK for gwlp supply chain

v0.1.1 2021-05-28 08:12 UTC

This package is auto-updated.

Last update: 2024-04-28 14:11:02 UTC


README

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