A API SDK for gwlp supply chain.
$ 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);
MIT