josbeir/shopwedo-php-api

Shop-we-do PHP api 封装器

0.3 2018-12-13 13:03 UTC

This package is not auto-updated.

Last update: 2024-09-29 06:20:09 UTC


README

现在有一个官方的php包可以访问API

https://bitbucket.org/shopwedo/shopwedo-api-php/src/master/

ShopWeDo PHP Api

ShopWeDo PHP Api封装器,用于与ShopWeDo REST api一起使用。

安装

可以使用Composer安装此库。运行以下命令

composer require josbeir/shopwedo-php-api

使用示例

require_once __DIR__ . '/vendor/autoload.php'; // change path as needed

$client = new \Shopwedo\Shopwedo([ 'shop_id' => '_myid_', 'api_key' => '_mykey_' ]);

try {
    $stock = $client->getStock();
    // ....
}
catch (\Shopwedo\Exceptions\ShopwedoResponseException $e) {
    echo 'Error while making request '. $e->getMessage();
}