quynp/lazada
Composer 安装命令:
composer require quynp/lazada
包简介
Lazada SDK by Quy Nguyen
README 文档
README
This is a Lazada Open API Client for PHP.
Requirements
- PHP >= 7.1
- Composer
Installation
Execute the following command to get the package:
$ composer require quynp/lazada
Usage
Create an instance of the Lazada client, then use to access the Lazada Open Platform API.
<?php use Lazada\LazopClient; use Lazada\LazopRequest; use Exception; class lazada { public $lazada; public $partner_id; public $partner_key; public $access_token; public $auth_url = 'https://auth.lazada.com/rest'; public $api_url = 'https://api.lazada.vn/rest'; public function __construct($access_token = '') { $this->partner_id = 'Lazada App ID'; $this->partner_key = 'Lazada App Secret'; $this->access_token = $access_token; $this->lazada = new LazopClient($this->api_url, $this->partner_id, $this->partner_key); } public function request($path, $params = [], $method = 'GET') { $request = new LazopRequest($path, $method); if(!empty($params)) { foreach($params as $key => $value) { $request->addApiParam($key, $value); } } return $this->lazada->execute($request, $this->access_token); } public function authorization($return_url) { try { $auth_url = 'https://auth.lazada.com/oauth/authorize?response_type=code&force_auth=true&redirect_uri='.$return_url."&client_id=".$this->partner_id; return $auth_url; } catch(\Exception $e) { return false; } } public function get_access_token($code) { try { $lazada = new LazopClient($this->auth_url, $this->partner_id, $this->partner_key); $request = new LazopRequest('/auth/token/create'); $request->addApiParam('code', $code); return $lazada->execute($request); } catch(\Exception $e) { return false; } } }
Examples
Get seller shop information
public function getShopInfo() { return $this->request('/seller/get'); }
quynp/lazada 适用场景与选型建议
quynp/lazada 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 4.16k 次下载、GitHub Stars 达 6, 最近一次更新时间为 2019 年 05 月 03 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「openapi」 「Lazada」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 quynp/lazada 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 quynp/lazada 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 quynp/lazada 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
The following pages give you some general information on how to use our APIs.<br/>The actual API services documentation then follows further below. You can use the menu to jump between API sections.<br/><br/>This page has a built-in HTTP(S) client, so you can test the services directly from within t
A Lazada PHP SDK for Laravel
Lazada Seller API wrapper
Interaction with the lazada api for seller
A Lazada PHP SDK for Laravel
A Lazada PHP SDK
统计信息
- 总下载量: 4.16k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 6
- 点击次数: 11
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2019-05-03