|
@@ -1081,6 +1081,39 @@ function __construct(){
|
|
|
return $list;
|
|
|
|
|
|
}
|
|
|
+ //注册物流轨迹
|
|
|
+ /**
|
|
|
+ *$order_info 订单信息
|
|
|
+ */
|
|
|
+ public function sub_logistics($order_info){
|
|
|
+ $data = [
|
|
|
+ "listenerURL"=>"http://1.wepolicy.cn/apiexpressv1/notifyusps",
|
|
|
+ "secret"=>md5($order_info['number']),
|
|
|
+ "adminNotification"=>[
|
|
|
+ [
|
|
|
+ "email"=>"2606071897@qq.com",
|
|
|
+ ]
|
|
|
+ ],
|
|
|
+ "filterProperties"=>[
|
|
|
+ "MID"=>"902510013",
|
|
|
+ "trackingEventTypes"=>[
|
|
|
+ "ALL"
|
|
|
+ ]
|
|
|
+ ]
|
|
|
+ ];
|
|
|
+ $url = "https://apis.usps.com/subscriptions-tracking/v3/subscriptions";
|
|
|
+ $token = $this->get_token();
|
|
|
+ $header = ['Content-Type: application/json',"Authorization: Bearer ".$token];
|
|
|
+ $res = $this->usps->su_curl($data,$url,$header);
|
|
|
+ $res = json_decode($res, true);
|
|
|
+ $this->logic_ding->sendToDing("usps注册信息监听".json_encode($res,JSON_UNESCAPED_UNICODE));
|
|
|
+ //返回信息异常
|
|
|
+ if(isset($res['error'])){
|
|
|
+ return $res;
|
|
|
+ }else{
|
|
|
+ return $res;
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
|
|
|
} //end class
|