zuragan / lazada-api-php
Lazada卖家API封装器
v0.1.3
2017-10-25 10:07 UTC
Requires
- php: >=5.6.4
- phpunit/phpunit: ^6.4
- vlucas/phpdotenv: ^2.4
This package is not auto-updated.
Last update: 2024-09-29 04:31:25 UTC
README
非官方的Lazada API PHP封装
概述
安装
~$ composer require zuragan/lazada-api-php
示例用法
- GET
//Create API instance $api = new LazadaAPI($baseUrl); //Create action using factory, get or post action is supported $factory = new ActionFactory($userEmail, $userAPIKey); $action = $factory->getAction('ActionName', [ 'Parameter' => 'ParamValue' ]); //Execute API Command $response = $api->get($action); //debug: dump response var_dump($response);
- POST
//Create API instance $api = new LazadaAPI($baseUrl); //Create action using factory, get or post action is supported $factory = new ActionFactory($userEmail, $userAPIKey); $payload = [ "Attributes" => [ "name" => "Example", "description" => "Short description", ], ]; $action = $factory->postAction('ActionName', [ 'Parameter' => 'ParamValue' ], $payload); //Execute API Command $response = $api->post($action); //debug: dump response var_dump($response);
已知限制
- 由于在将post有效负载转换为XML格式时使用的PHP数组限制,无法生成具有相同名称的多个子元素(因为PHP数组键必须是唯一的)
免责声明
- 这不是Lazada的官方SDK
- 此库可能会不通知而更改,以保持与Lazada API的更新
- 此库按原样提供,不提供任何保证,并且Lazada在其API中创建破坏性更改时可能会中断
贡献
- 错误报告/问题
- 使用GitHub的问题跟踪器
- 代码贡献
- 分支此存储库
- 创建pull请求
许可
- MIT