laravel v2 SDK
composer require yc-hwc/laravel-shopee
$config = [
'shopeeUrl' => 'https://partner.test-stable.shopeemobile.com',
'partnerId' => '',
'partnerKey' => '',
'accessToken' => '',
'shopId' => '',
'merchantId' => '',
];
$shopeeSDK = \PHPShopee\ShopeeSDK::config($config);
$config = [
'shopeeUrl' => 'https://partner.test-stable.shopeemobile.com',
'partnerId' => 'xxxxxxx',
'partnerKey' => 'xxxxxxxxxxxxxx',
];
$shopeeSDK = \PHPShopee\ShopeeSDK::config($config);
$fullUrl = $shopeeSDK->shopAuth()
->api('auth_partner')
->withQueryString([
'redirect' => 'https://www.baidu.com/',
])
->fullUrl();
return redirect($fullUrl);
$config = [
'shopeeUrl' => 'https://partner.test-stable.shopeemobile.com',
'partnerId' => '',
'partnerKey' => '',
'accessToken' => '',
'shopId' => '',
];
$params = [
'declare_date' => '',
'quantity' => 1,
'seller_info' => [
'name' => "tom",
'address' => "xxxxxxx",
'region' => "CN",
'zipcode' => "1xxxx15",
'phone' => "186xxxxxx49"
]
]
$shopeeSDK = \PHPShopee\ShopeeSDK::config($config);
$response = $shopeeSDK->firstMile
->api('generate_firstMile_tracking_number')
->withBody($params)
->post();
print_r($response);
$content = file_get_contents('path/to/file');
$config = [
'shopeeUrl' => '',
'partnerId' => '',
'partnerKey' => '',
];
$shopeeSDK = \PHPShopee\ShopeeSDK::config($config);
$response = $shopeeSDK->mediaSpace()
->api('upload_image')
->attach('image', $content, md5($content))
->post(['scene' => 'normal']);
print_r($response);