|
@@ -591,6 +591,20 @@ function __construct(){
|
|
|
$res = json_decode($res,true);
|
|
$res = json_decode($res,true);
|
|
|
return $res;
|
|
return $res;
|
|
|
}
|
|
}
|
|
|
|
|
+ //获取快递信息
|
|
|
|
|
+ public function getWaybillInfo($package_id,$shop){
|
|
|
|
|
+ $url = 'https://open-api.tiktokglobalshop.com';
|
|
|
|
|
+ $link = '/fulfillment/202309/packages/'.$package_id;
|
|
|
|
|
+ $time = time();
|
|
|
|
|
+ $link .= '?shop_cipher='.$shop['shop_cipher'].'&app_key='.$shop['app_key'].'×tamp='.$time."";
|
|
|
|
|
+ $sign = $this->sign($link,$shop['app_secret'],'');
|
|
|
|
|
+ $url .= $link.'&sign='.$sign;
|
|
|
|
|
+ $headers = array('Content-Type: application/json','x-tts-access-token:'.$shop['token']);
|
|
|
|
|
+ $res = $this->su_curl('',$url,$headers,$date_type='json',$timeout=300,$httptype="GET");
|
|
|
|
|
+ //$this->logic_ding->sendToDing($info['number']."获取TT快递服务信息MD".$res);
|
|
|
|
|
+ $res = json_decode($res,true);
|
|
|
|
|
+ return $res;
|
|
|
|
|
+ }
|
|
|
public function sign($url,$appSecret,$body='')
|
|
public function sign($url,$appSecret,$body='')
|
|
|
{
|
|
{
|
|
|
// 解析URL获取查询参数
|
|
// 解析URL获取查询参数
|