|
@@ -733,14 +733,33 @@ function __construct(){
|
|
|
}
|
|
|
$url = 'https://'.$shopname.'.myshopify.com/admin/api/2022-10/orders/'.$shopifyid.'/fulfillment_orders.json';
|
|
|
$headerA[] = "X-Shopify-Access-Token: ".$shop['token'];
|
|
|
- $ch = curl_init();
|
|
|
- curl_setopt($ch, CURLOPT_URL, $url);
|
|
|
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
|
|
- curl_setopt($ch, CURLOPT_HTTPHEADER, $headerA);
|
|
|
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
|
|
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
|
|
|
- $res = curl_exec($ch);
|
|
|
- $headerA = curl_getinfo($ch);
|
|
|
+ // $ch = curl_init();
|
|
|
+ // curl_setopt($ch, CURLOPT_URL, $url);
|
|
|
+ // curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
|
|
+ // curl_setopt($ch, CURLOPT_HTTPHEADER, $headerA);
|
|
|
+ // curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
|
|
+ // curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
|
|
|
+ // $res = curl_exec($ch);
|
|
|
+ // $headerA = curl_getinfo($ch);
|
|
|
+ $post = [];
|
|
|
+ $post['shopify_yd_one'] = 1;
|
|
|
+ $post['url'] = $url;
|
|
|
+ $post['token'] = $shop['token'];
|
|
|
+
|
|
|
+ $ch = curl_init();
|
|
|
+ curl_setopt($ch,CURLOPT_URL,'https://edm.alipearl.net/soapapi.php');
|
|
|
+ curl_setopt($ch, CURLOPT_POST, 1);
|
|
|
+ curl_setopt($ch, CURLOPT_HEADER, 0);
|
|
|
+ curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
|
|
|
+ curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
|
|
|
+ curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1);
|
|
|
+ curl_setopt($ch, CURLOPT_POSTFIELDS,http_build_query($post));
|
|
|
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
|
|
+ curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,1800000);
|
|
|
+ $res = curl_exec($ch);
|
|
|
+
|
|
|
+ $this->logic_ding->sendToDing("shopfiy的运单同步第一步".json_encode($post)."|".$res);
|
|
|
+
|
|
|
$a = json_decode($res,true);
|
|
|
$od = array();
|
|
|
foreach ($a['fulfillment_orders'] as $v)
|
|
@@ -749,22 +768,42 @@ function __construct(){
|
|
|
}
|
|
|
$data = array('fulfillment'=>array('notify_customer'=>false,'tracking_info'=>array('number'=>$ydh,'company'=>$ex['title']),
|
|
|
'line_items_by_fulfillment_order'=>$od));
|
|
|
- $data = json_encode($data);
|
|
|
- $this->logic_ding->sendToDing("erp同步独立站的信息tijiao".$data);
|
|
|
- $url = 'https://'.$shopname.'.myshopify.com/admin/api/2022-10/fulfillments.json';
|
|
|
- $header[] = "Content-Type: application/json";
|
|
|
- $header[] = "X-Shopify-Access-Token: ".$shop['token'];
|
|
|
- $ch = curl_init();
|
|
|
- curl_setopt($ch, CURLOPT_URL, $url);
|
|
|
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
|
|
- curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
|
|
|
- curl_setopt($ch, CURLINFO_HEADER_OUT, TRUE);
|
|
|
+
|
|
|
+ // $url = 'https://'.$shopname.'.myshopify.com/admin/api/2022-10/fulfillments.json';
|
|
|
+ // $header[] = "Content-Type: application/json";
|
|
|
+ // $header[] = "X-Shopify-Access-Token: ".$shop['token'];
|
|
|
+ // $ch = curl_init();
|
|
|
+ // curl_setopt($ch, CURLOPT_URL, $url);
|
|
|
+ // curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
|
|
+ // curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
|
|
|
+ // curl_setopt($ch, CURLINFO_HEADER_OUT, TRUE);
|
|
|
+ // curl_setopt($ch, CURLOPT_POST, 1);
|
|
|
+ // curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
|
|
|
+ // curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
|
|
+ // curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
|
|
|
+ // $res = curl_exec($ch);
|
|
|
+ // $header = curl_getinfo($ch);
|
|
|
+
|
|
|
+ $post = [
|
|
|
+ 'shopify_yd_two'=>1,
|
|
|
+ 'token'=>$shop['token'],
|
|
|
+ 'url'=>'https://'.$shopname.'.myshopify.com/admin/api/2022-10/fulfillments.json',
|
|
|
+ 'data'=>$data,
|
|
|
+ ];
|
|
|
+ $ch = curl_init();
|
|
|
+ curl_setopt($ch,CURLOPT_URL,'https://edm.alipearl.net/soapapi.php');
|
|
|
curl_setopt($ch, CURLOPT_POST, 1);
|
|
|
- curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
|
|
|
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
|
|
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
|
|
|
- $res = curl_exec($ch);
|
|
|
- $header = curl_getinfo($ch);
|
|
|
+ curl_setopt($ch, CURLOPT_HEADER, 0);
|
|
|
+ curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
|
|
|
+ curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
|
|
|
+ curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1);
|
|
|
+ curl_setopt($ch, CURLOPT_POSTFIELDS,http_build_query($post));
|
|
|
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
|
|
+ curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,1800000);
|
|
|
+ $res = curl_exec($ch);
|
|
|
+ $this->logic_ding->sendToDing("shopfiy的运单同步第二步".json_encode($post)."|".$res);
|
|
|
+
|
|
|
+
|
|
|
$b = json_decode($res,true);
|
|
|
|
|
|
$this->logic_ding->sendToDing("erp同步独立站的信息_".$ydh."_".json_encode($b,JSON_UNESCAPED_UNICODE));
|