wienkit/beslist-shopitem-api-php-client
Beslist.nl 商品类API的PHP客户端
2.0.4
2019-03-11 14:58 UTC
Requires
- php: >=5.5.9
- ext-curl: *
- ext-json: *
- tcdent/php-restclient: ^0.1.5
Requires (Dev)
- phpunit/phpunit: ^5.4
README
这是一个开源的PHP客户端,用于Beslist.nl 商品类API。
安装
使用composer获取
运行命令
composer require wienkit/beslist-shopitem-api-php-client
示例
<?php require __DIR__ . '/vendor/autoload.php'; $apiKey = '-- ENTER YOUR SHOPITEM API KEY --'; $this->client = new Wienkit\BeslistShopitemClient\BeslistShopitemClient($apiKey); $this->client->setTestMode(TRUE); // Authenticate with the API $shops = $this->client->authenticate(); var_dump($shops); // Get a shopitem $shopId = 12345; $itemId = '12abcd13'; $shopItem = $this->client->getShopItem($shopId, $itemId); var_dump($shopItem); // Update a shopitem $shopId = 12345; $itemId = '12abcd13'; $update = [ 'price' => 12.00, 'discount_price' => 10.00, 'delivery_cost_nl' => 5.00, 'delivery_cost_be' => 6.00, 'delivery_time_nl' => '24 uur', 'delivery_time_be' => '48 uur', 'stock' => 5 ]; $this->client->updateShopItem($shopId, $itemId, $update);
有关更多信息示例,请参阅测试文件夹。