PHP code example of nason / gw-supply-chain

1. Go to this page and download the library: Download nason/gw-supply-chain library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

nason / gw-supply-chain example snippets


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);