コード例 #1
0
 public function OrderConfirmRequest($orderid, $mailno, $dealtype, $options = array())
 {
     $params = array();
     $params['dealtype '] = $dealtype;
     $params['orderid'] = $orderid;
     $params['mailno '] = $mailno;
     $OrderConfirm = '';
     if (count($params) > 0) {
         $OrderConfirm = '<OrderConfirm ';
         foreach ($params as $k => $v) {
             $OrderConfirm .= $k . '=' . '"' . $v . '" ';
         }
         $OrderConfirm = trim($OrderConfirm) . '>';
         if (count($options) > 0) {
             $OrderConfirm .= $this->OrderConfirmOption($options);
         }
         $OrderConfirm .= '</OrderConfirm>';
     } else {
         return false;
     }
     $xml = $this->buildXml($OrderConfirm);
     $verifyCode = Auth::sign($xml, $this->config['checkword']);
     $params = array('xml' => $xml, 'verifyCode' => $verifyCode);
     $data = $this->ApiPost($params);
     return $this->OrderConfirmResponse($data);
 }
コード例 #2
0
 /**
  * 下订单(含筛选)
  * 下订单接口根据客户需要,可提供以下三个功能:
  * 1) 客户系统向顺丰下发订单。
  * 2) 为订单分配运单号。
  * 3) 筛单(可选,具体商务沟通中双方约定,由顺丰内部为客户配置)。
  * 此接口也用于路由推送注册。客户的顺丰运单号不是通过此下订单接口获取,但却需要获取BSP的路由推送时,
  * 需要通过此接口对相应的顺丰运单进行注册以使用BSP的路由推送 接口。
  *
  * @param string $orderid //客户订单号
  * @param string $d_company //到件方公司名称
  * @param string $d_contact //到件方联系人
  * @param string $d_tel //到件方联系电话
  * @param string $d_address //到件方详细地址,如果不传输 d_province/d_city 字段,此详细地址 需包含省市信息,以提高地址识别的 成功率,示例:“广东省深圳市福田 区新洲十一街万基商务大厦 10楼”。
  * @param array $params //可选参数的数组
  * @param array $cargoes
  * @param array $addedServices
  * @return string
  */
 public function Order($orderid, $d_company, $d_contact, $d_tel, $d_address, $params = array(), $cargoes = array(), $addedServices = array())
 {
     $params['orderid'] = $orderid;
     $params['d_company'] = $d_company;
     $params['d_contact'] = $d_contact;
     $params['d_tel'] = $d_tel;
     $params['d_address'] = $d_address;
     $order = '<Order ';
     foreach ($params as $k => $v) {
         $order .= $k . '=' . '"' . $v . '" ';
     }
     if (count($cargoes) > 0 || count($addedServices) > 0) {
         $order = trim($order) . '>';
         if (is_array($cargoes) && count($cargoes) > 0) {
             $order .= $this->Cargo($cargoes);
         }
         if (is_array($addedServices) && count($addedServices) > 0) {
             $order .= $this->AddedService($addedServices);
         }
         $order .= '</Order>';
     } else {
         $order .= ' />';
     }
     $xml = $this->buildXml($order);
     $verifyCode = Auth::sign($xml, $this->config['checkword']);
     $params = array('xml' => $xml, 'verifyCode' => $verifyCode);
     $data = $this->ApiPost($params);
     return $this->OrderResponse($data);
 }
コード例 #3
0
 public function OrderSearch($orderid)
 {
     $OrderSearch = '<OrderSearch orderid="' . $orderid . '" />';
     $xml = $this->buildXml($OrderSearch);
     $verifyCode = Auth::sign($xml, $this->config['checkword']);
     $params = array('xml' => $xml, 'verifyCode' => $verifyCode);
     $data = $this->ApiPost($params);
     return $this->OrderSearchResponse($data);
 }
コード例 #4
0
 /**
  * Item Request
  * @param $item
  * @return array
  */
 public function ItemRequest($item)
 {
     $itemRequest = '<ItemRequest>';
     $itemRequest .= '<CompanyCode>' . $this->config['companycode'] . '</CompanyCode>';
     $itemRequest .= $this->Items($item);
     $itemRequest .= '</ItemRequest>';
     $xml = $this->buildXml($itemRequest);
     $verifyCode = Auth::sign($xml, $this->config['checkword']);
     $params = array('logistics_interface' => urlencode($xml), 'data_digest' => urlencode($verifyCode));
     $data = $this->ApiPost($params);
     return $this->ItemResponse($data);
 }
コード例 #5
0
 public function OrderFilter($d_address, $filter_type = 1, $orderid = '', $options = array())
 {
     $params = array();
     $params['d_address'] = $d_address;
     $params['filter_type '] = $filter_type;
     if (!empty($orderid)) {
         $params['orderid '] = $orderid;
     }
     $OrderFilter = '<OrderFilter ';
     foreach ($params as $k => $v) {
         $OrderFilter .= $k . '=' . '"' . $v . '" ';
     }
     $OrderFilter = trim($OrderFilter) . '>';
     if (count($options) > 0) {
         $OrderFilter .= $this->OrderFilterOption($options);
     }
     $OrderFilter .= '</OrderFilter>';
     $xml = $this->buildXml($OrderFilter);
     $verifyCode = Auth::sign($xml, $this->checkword);
     $params = array('xml' => $xml, 'verifyCode' => $verifyCode);
     $data = $this->ApiPost($params);
     return $this->OrderFilterResponse($data);
 }