PHP code example of zxyfaxcn / easytk

1. Go to this page and download the library: Download zxyfaxcn/easytk library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

zxyfaxcn / easytk example snippets



$client = \EasyTK\Factory::pinduoduo([
    'client_id' => 'PDD_CLIENT_ID',
    'client_secret' => 'PDD_CLIENT_SECRET',
    'format' => 'json'
]);
$req = new \EasyTK\PinDuoDuo\Request\DdkGoodsPromotionUrlGenerateRequest();
// GoodsSign https://jinbao.pinduoduo.com/qa-system?questionId=252
$pid = '37186626_266418764';
$goodsSign = ['c9_2jIGD8q9HeEqRwvfY5A2CBcK7_JOFdnZa6o'];
$customParams = [
    'uid' => '1',
    'foo' => 'bar',
];
$req->setGoodsSignList(json_encode($goodsSign, JSON_THROW_ON_ERROR));
$req->setPid($pid);
$req->setCustomParameters(json_encode($customParams, JSON_THROW_ON_ERROR));
$response = $client->execute($req);


$client = \EasyTK\Factory::jingdong([
    'app_key' => 'JD_APP_KEY',
    'app_secret' => 'JD_APP_SECRET',
    'format' => 'json'
]);
$request = new \EasyTK\JingDong\Request\JdUnionGoodsJingfenQueryRequest();
$request->setEliteId(1);
$request->setPageIndex(1);
$request->setPageSize(20);
print_r($client->execute($request));