|
@@ -342,6 +342,9 @@ function __construct(){
|
|
|
$url = 'https://apis.usps.com/labels/v3/label';
|
|
|
$header = array('X-Payment-Authorization-Token:'.$payment_token,'Authorization: Bearer '.$token,'Content-Type: application/json',"Accept: application/vnd.usps.labels+json");
|
|
|
$list = json_encode($list);
|
|
|
+ $this->logic_ding->sendToDing("usps获取快递面单的请求数据".$list);
|
|
|
+ $this->logic_ding->sendToDing("usps获取快递面单的pay_token".$payment_token);
|
|
|
+ $this->logic_ding->sendToDing("usps获取快递面单的token".$token);
|
|
|
$ch = curl_init();
|
|
|
curl_setopt($ch,CURLOPT_URL,$url);
|
|
|
curl_setopt($ch, CURLOPT_POST, 1);
|
|
@@ -354,6 +357,7 @@ function __construct(){
|
|
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
|
|
curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,1800000);
|
|
|
$res = curl_exec($ch);
|
|
|
+ $this->logic_ding->sendToDing("usps获取快递面单的返回信息".$res);
|
|
|
curl_close($ch);
|
|
|
$res = json_decode($res, true);
|
|
|
return $res;
|
|
@@ -447,6 +451,12 @@ function __construct(){
|
|
|
$url = 'https://apis.usps.com/labels/v3/return-label';
|
|
|
$header = array('X-Payment-Authorization-Token:'.$payment_token,'Authorization: Bearer '.$token,'Content-Type: application/json',"Accept: application/vnd.usps.labels+json");
|
|
|
$list = json_encode($list);
|
|
|
+
|
|
|
+ $this->logic_ding->sendToDing("usps获取退货面单的请求数据".$list);
|
|
|
+ $this->logic_ding->sendToDing("usps获取退货面单的pay_token".$payment_token);
|
|
|
+ $this->logic_ding->sendToDing("usps获取退货面单的token".$token);
|
|
|
+
|
|
|
+
|
|
|
$ch = curl_init();
|
|
|
curl_setopt($ch,CURLOPT_URL,$url);
|
|
|
curl_setopt($ch, CURLOPT_POST, 1);
|
|
@@ -460,6 +470,7 @@ function __construct(){
|
|
|
curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,1800000);
|
|
|
$res = curl_exec($ch);
|
|
|
curl_close($ch);
|
|
|
+ $this->logic_ding->sendToDing("usps获取退货面单的返回参数".$res);
|
|
|
$res = json_decode($res, true);
|
|
|
return $res;
|
|
|
}
|
|
@@ -1040,12 +1051,14 @@ function __construct(){
|
|
|
$number = $info['waybill'];
|
|
|
|
|
|
$token = $this->get_token();
|
|
|
-
|
|
|
+ $this->logic_ding->sendToDing("usps获取退货面单的请求数据".$number);
|
|
|
+ $this->logic_ding->sendToDing("usps获取退货面单的token".$token);
|
|
|
+
|
|
|
$url = 'https://apis.usps.com/tracking/v3/tracking/'.$number."?expand=DETAIL";
|
|
|
$header = array('Authorization: Bearer '.$token,'Content-Type: application/json',"Accept:application/json");
|
|
|
$res= $this->su_curl([
|
|
|
],$url,$header,'http_build_query',$timeout=300,"GET",'');
|
|
|
-
|
|
|
+ $this->logic_ding->sendToDing("usps获取运单".$res);
|
|
|
if(is_string($res)){
|
|
|
$res = json_decode($res,true);
|
|
|
}
|