stanley-king 9 rokov pred
rodič
commit
c2ed5bf167

+ 28 - 0
core/framework/function/http.php

@@ -65,3 +65,31 @@ function http_request($url, $params = array(), $method = 'GET', $multi = false,
     curl_close($ci);
     return $response;
 }
+
+function http_post_data($url, $body, $headers = array())
+{
+    if (!function_exists('curl_init')) {
+        return NULL;
+    }
+
+    $ci = curl_init();
+    curl_setopt($ci, CURLOPT_USERAGENT, 'PHP-SDK OAuth2.0');
+    curl_setopt($ci, CURLOPT_CONNECTTIMEOUT, 3);
+    curl_setopt($ci, CURLOPT_TIMEOUT, 3);
+    curl_setopt($ci, CURLOPT_RETURNTRANSFER, true);
+    curl_setopt($ci, CURLOPT_SSL_VERIFYPEER, false);
+    curl_setopt($ci, CURLOPT_SSL_VERIFYHOST, false);
+    curl_setopt($ci, CURLOPT_HEADER, false);
+
+    curl_setopt($ci, CURLOPT_POSTFIELDS, $body);
+
+    curl_setopt($ci, CURLINFO_HEADER_OUT, TRUE);
+    curl_setopt($ci, CURLOPT_URL, $url);
+    if ($headers) {
+        curl_setopt($ci, CURLOPT_HTTPHEADER, $headers);
+    }
+
+    $response = curl_exec($ci);
+    curl_close($ci);
+    return $response;
+}

+ 3 - 5
data/logic/delivery.logic.php

@@ -51,9 +51,11 @@ class deliveryLogic
                 $delivery_order['trade_memo'] = '';
                 $delivery_order['receiver_name'] = $order_info['reciver_name'];
                 $delivery_area =  explode("\t", $order_info['reciver_info']['area']);
+
                 $delivery_order['receiver_state'] = $delivery_area[0];
                 $delivery_order['receiver_city'] = $delivery_area[1];
                 $delivery_order['receiver_district'] = $delivery_area[2];
+
                 $delivery_order['receiver_address'] = $order_info['reciver_info']['street'];
                 $delivery_order['receiver_zip'] = '000000';
                 $delivery_order['receiver_mobile'] = $order_info['reciver_info']['mob_phone'];
@@ -81,13 +83,9 @@ class deliveryLogic
         $data = array('type' => 'PUT_TRADE', 'data' => $delivery_order_list);
         $sign = $this->_getSign($data);
         $headers = array('v_appkey: '.self::$appkey, 'v_sign: '.$sign, 'Content-Type: application/json');
+        $result = http_post_data(self::$appURL,json_encode($data),$headers);
 
-        $outdata = json_encode($data);
-        Log::record($outdata,Log::DEBUG);
-        //$result = json_decode($this->_http_json_post(self::$appURL, json_encode($data), $headers));
-        $result = http_request(self::$appURL,$outdata,'POST',false,$headers);
         Log::record("post data={$result}",Log::DEBUG);
-
         return $result;
     }
 

+ 1 - 0
mobile/control/payment.php

@@ -33,6 +33,7 @@ class paymentControl extends mobileHomeControl{
 
     }
 
+
     /**
      * 支付回调
      */

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 26 - 10
mobile/control/test.php


+ 2 - 2
mobile/wxnotify.php

@@ -71,8 +71,8 @@ try
         } else {
             wxLog::DEBUG('wxpay success.');
             Log::record('wxpay success.',Log::DEBUG);
-            //$logic_delivery = Logic('delivery');
-            //$ret = $logic_delivery->putOrder($out_trade_no, $transaction_id);
+            $logic_delivery = Logic('delivery');
+            $ret = $logic_delivery->putOrder($out_trade_no, $transaction_id);
         }
 
         $ret_wx['return_code'] = 'SUCCESS';

+ 8 - 0
research/function_test.php

@@ -2,6 +2,14 @@
 
 require_once(BASE_CORE_PATH . '/framework/libraries/validate.php');
 
+$info = array();
+$info['receiver_state'] = '上海';
+$info['receiver_city'] = '上海市';
+$info['receiver_district'] = '徐汇区';
+
+$x = json_encode($info);
+
+$data = unserialize('a:7:{s:7:"address";s:36:"北京	北京市	东城区 123123123";s:5:"phone";s:11:"12345678901";s:4:"area";s:26:"北京	北京市	东城区";s:6:"street";s:9:"123123123";s:9:"mob_phone";s:11:"12345678901";s:9:"tel_phone";s:0:"";s:4:"dlyp";s:0:"";}');
 
 function test_ssl()
 {

+ 1 - 1
run.php

@@ -4,7 +4,7 @@
 define('BASE_ROOT_PATH',str_replace('\\','/',dirname(__FILE__)));
 
 require_once (BASE_ROOT_PATH . '/fooder.php');
-$gfcgi_run = 2;
+$gfcgi_run = 1;
 
 if($gfcgi_run == 0) { //模拟请求
     $file = BASE_ROOT_PATH . '/debug_run.php';