在一些中间件的履行周期上工作并开始自动履行订单后,我注意到没有一个订单有与履行相关的透视跟踪号。我有以下 PHP 代码提交履行请求:
$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,不确定它是否还有其他问题。