示例#1
0
 public function actionIndex($backend = false)
 {
     header('Content-Type: text/html; charset=UTF-8');
     $backend = $backend ? true : $backend;
     if (isset($_POST) && $_POST) {
         $cnpnr = new ChinaPNR();
         $cnpnr->setResponse($_POST, $backend);
         if ($response = $cnpnr->getResponse()) {
             $this->response = $response;
             $result = $this->_responser();
             if ($backend) {
                 exit('RECV_ORD_ID_' . $response[$response[ChinaPNR::PARAM_MERPRIV]['showId']]);
             }
         }
     }
 }
示例#2
0
 public function actionOpen()
 {
     $cnpnr = new ChinaPNR();
     $cnpnr->creditAssignReconciliation('20140901', '20140911');
     $ch = curl_init($cnpnr->getLink());
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
     $result = curl_exec($ch);
     curl_close($ch);
     $result = json_decode($result, true);
     foreach ($result as $k => $v) {
         $result[$k] = is_string($v) ? urldecode($v) : $v;
     }
     var_dump($result);
 }