代码拉取完成,页面将自动刷新
<h2>1- Install a web server (for example wamp for windows)</h2> <h3>1.1 - Min requirements :</h3> <ul> <li>Apache 2.2</li> <li>Php 5.6</li> </ul> <h2>2.1- Clone the Git repository in your root project folder and run composer update</h2> <p>The SDK is structured like that : </p> <ul> <li>config/ : config files</li> <li><a href="samples">samples/</a> : samples folder</li> <li>sdk/ : content of the Cdiscount SDK (do not modifiy any file of this folder)</li> </ul> <h2>2.2- Run the 'composer update' command in the root path of the sdk folder to download Zend Framework dependencies</h2> <h2>3 - Insert your API's credentials</h2> <h3>3.1 - Requirements</h3> <p>To use Cdiscount Marketplace API and Cdiscount Marketplace SDK you first need to follow the steps described in the Cdiscount Marketplace API website.</p> <p>The sections are the following : </p> <ul> <li>Request your account creation.</li> <li>Have set up your account</li> </ul> <h3>3.2 - Update the config files</h3> <p>Follow the procedure to insert your API credentials</p> <ul> <li>Open the config folder</li> <li>Open the config.ini file</li> <li>Set the api mode : 'preprod' or 'prod'</li> <li>Open the preprod.config.ini file or the prod.config.ini file (if you set mode to 'prod')</li> <li>Set your api username</li> <li>Set your api password</li> </ul> <h2>4 - Use the SDK</h2> <h3>4.1 - Use the endpoints</h3> <p>The SDK contains the following endpoints :</p> <ul> <li>Seller</li> <li>Offer</li> <li>Discussion</li> <li>Product</li> <li>Order</li> <li>Relays</li> </ul> <p>All the SDK methods are described in the MarketPlace API Website because they have the same names of the Cdiscount Marketplace API methods.</p> <p>For each method, you have a PHP file with a sample to call the corresponding API function.</p> <p>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.</p> <h3>4.2 - CDSApiClient Object</h3> <p>The CDSApiClient allows you to call the API.</p> <p>The CDSApiClient object contains all the endpoints. It's also create an API call to get a token for you.</p> <p>Don't create a new CDSApiClient each time you call the API !</p> <p>You can (have to) use the same CDSApiClient for all your API' calls.</p> <p>Here an example of how use the same CDSApiClient for many API calls : </p> <br/> <code> $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 **/ </code> <h2>5 - Update the SDK</h2> <p>Download the new SDK Zip file from the CDiscount Marketplace API Website</p> <p>Erase the SDK folder with the new one</p> <p>Erase the vendor folder with the new one</p> <h2>Notes</h2> <p>In the sample, the parametrer error_reporting is set to '-1'. Do not let it in production mode.</p>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。