To use the SDK, initialize the PinDuoDuo class with a configuration array. The configuration requires client_id, client_secret, and a member_type defining the user role.
Available member_type values:
MERCHANT: Merchant authorizationH5: Mobile endJINBAO: Duoduo Jinbao promoter (多多进宝推手)KTT: Kuaituantuan leader (快团团团长)LOGISTICS: Pinduoduo electronic shipping label user (拼多多电子面单用户)
use \Justmd5\PinDuoDuo\PinDuoDuo;
require __DIR__ . '/vendor/autoload.php';
$config = [
'client_id' => 'xxxxxx69e3940c6b93xxxxxx',
'client_secret' => 'c2eda0c398xxxxxxbd63ff57bf22c05xxxxxx',
'debug' => true,
'member_type' => 'JINBAO', // e.g., MERCHANT, H5, JINBAO, KTT, LOGISTICS
'redirect_uri' => 'https://test.xxx.com/callback',
'log' => [
'name' => 'pinduoduo',
'file' => __DIR__ . '/pinduoduo.log',
'level' => 'debug',
'permission' => 0777,
],
];
$pinduoduo = new PinDuoDuo($config);