autumndev/cdiscount-sdkphpapi 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

autumndev/cdiscount-sdkphpapi

Composer 安装命令:

composer require autumndev/cdiscount-sdkphpapi

包简介

PHP SDK for the Cdiscount Marketplace API

README 文档

README

This project is an update to the Cdiscount/API-MarketPlace-SDK-PHP parent.

Main Changes include the ability to pass in the username, password, token url and cURL options into the API functionality without the need to modify the supplied config.ini file.

The reasons for these changes are to better support frameworks like Laravel and to disuade users from directly editing files in the vendor directory.

1.1 - Min requirements :

  • Apache 2.2
  • Php 5.6

2.1- Clone the Git repository in your root project folder

The SDK is structured like that :

  • config/ : config files
  • samples/ : samples folder
  • sdk/ : content of the Cdiscount SDK (do not modifiy any file of this folder)

2.2- Run the 'composer update' command in the root path of the sdk folder to download Zend Framework dependencies

3 - Insert your API's credentials

3.1 - Requirements

To use Cdiscount Marketplace API and Cdiscount Marketplace SDK you first need to follow the steps described in the Cdiscount Marketplace API website.

The sections are the following :

  • Request your account creation.
  • Have set up your account

3.2 - Update the config files

Follow the procedure to insert your API credentials

  • Open the config folder
  • Open the config.ini file
  • Set the api mode : 'preprod' or 'prod'
  • Open the preprod.config.ini file or the prod.config.ini file (if you set mode to 'prod')
  • Set your api username
  • Set your api password

4 - Use the SDK

4.1 - Use the endpoints

The SDK contains the following endpoints :

  • Seller
  • Offer
  • Discussion
  • Product
  • Order
  • Relay

All the SDK methods are described in the MarketPlace API Website because they have the same names of the Cdiscount Marketplace API methods.

For each method, you have a PHP file with a sample to call the corresponding API function.

For example, to call the GetSellerInformation API method, open the GetSellerInformation.php file contained in the Seller folder and follow the same steps of the sample.

4.2 - CDSApiClient Object

The CDSApiClient allows you to call the API.

The CDSApiClient object contains all the endpoints. It's also create an API call to get a token for you.

Don't create a new CDSApiClient each time you call the API !

You can (have to) use the same CDSApiClient for all your API' calls.

Here an example of how use the same CDSApiClient for many API calls :

$client = new \Sdk\ApiClient\CDSApiClient(); $token = $client->init(); if ($token == null || !$client->isTokenValid()) { echo "Souci lors de la génération du token"; die; } $offerPoint = $client->getOfferPoint(); $offerListResponse = $offerPoint->getOfferList(null); /** Parse here $offerListResponse **/ $sellerPoint = $client->getSellerPoint(); $sellerResponse = $sellerPoint->getSellerInformation(); /** Parse here $sellerResponse **/

5 - Update the SDK

Download the new SDK Zip file from the CDiscount Marketplace API Website

Erase the SDK folder with the new one

Erase the vendor folder with the new one

Notes

In the sample, the parametrer error_reporting is set to '-1'. Do not let it in production mode.

autumndev/cdiscount-sdkphpapi 适用场景与选型建议

autumndev/cdiscount-sdkphpapi 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.81k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2019 年 09 月 23 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 autumndev/cdiscount-sdkphpapi 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 autumndev/cdiscount-sdkphpapi 我们能提供哪些服务?
定制开发 / 二次开发

基于 autumndev/cdiscount-sdkphpapi 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 1.81k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 38
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0
  • 更新时间: 2019-09-23