2012-10-26 40 views
0

在一些中間件的工作週期和開始自動履行訂單後,我注意到沒有任何訂單的履約跟蹤數字與履行相關。 我有以下的PHP代碼提交的履行請求:追蹤號碼未提交到訂單履行Shopify

$options = array(CURLOPT_URL => 'https://'.$this->config->item('api_key').':'.$this->config->item('api_pass').'@'.$this->config->item('api_domain').'/admin/orders/'.$order['order_id'].'/fulfillments.json', 
      CURLOPT_HEADER => true, 
      CURLOPT_RETURNTRANSFER => true, 
      CURLOPT_POST => true, 
      CURLOPT_MAXREDIRS => 3, 
      CURLOPT_SSL_VERIFYPEER => true, 
      CURLOPT_SSL_VERIFYHOST => 2, 
      CURLOPT_USERAGENT => 'HAC', 
      CURLOPT_CONNECTTIMEOUT =>30, 
      CURLOPT_TIMEOUT => 30, 
      CURLOPT_POSTFIELDS => $fulfill_json 
      ); 
     if($send == true){ 
      $ch = curl_init(); 
      curl_setopt_array($ch, $options); 
      $response = curl_exec($ch); 
      $response_header = curl_getinfo($ch, CURLINFO_HTTP_CODE); 
      curl_close($ch); 
      if($response_header == 201){ 
       //success 

      }else{ 
       //error 

      } 
     } 

這裏是我送的$ fulfill_json一個例子:

{"fulfilment":{"tracking_number":"1Z6V66666666666666","notify_customer":true,"line_items":[{"id":111111111}]}} 

{"fulfilment":{"tracking_number":"1Z6V66666666666666","notify_customer":true,"line_items":[{"id":111111111},{"id":111111111},{"id":111111111}]}} 

對我來說,它看起來像正常提交JSON,不知道它還有其他問題。

回答

1

我會嘗試改變的第一件事是你的拼寫:

履行沒有履行

+0

良好的漁獲!這可能是。 – dethfactor