From 51a7f9ef470875ca7d3344ac1689fb66dfb99b23 Mon Sep 17 00:00:00 2001 From: lyt Date: Mon, 22 Apr 2019 10:04:54 +0800 Subject: [PATCH] =?UTF-8?q?wxpay=20=E4=BF=AE=E6=94=B9=E8=AF=BB=E5=8F=96pos?= =?UTF-8?q?t=E6=95=B0=E6=8D=AE=E7=9A=84=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webht/third_party/pay/controllers/WxpayService.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/webht/third_party/pay/controllers/WxpayService.php b/webht/third_party/pay/controllers/WxpayService.php index e073dbd1..5f7f8e74 100644 --- a/webht/third_party/pay/controllers/WxpayService.php +++ b/webht/third_party/pay/controllers/WxpayService.php @@ -29,12 +29,14 @@ log_message('error','notify begin ----'); $response['return_msg'] = ''; $GLOBALS['__WX_SITE_NAME__'] = $site; $this->wx_site_config = $this->config->item($GLOBALS['__WX_SITE_NAME__'], 'wxpay'); - if (!isset($GLOBALS['HTTP_RAW_POST_DATA'])) { + $raw_post_data = file_get_contents('php://input'); +// log_message('error',var_export($raw_post_data, 1)); + if (empty($raw_post_data) ){ # 如果没有数据,直接返回失败 return $this->response_to_wx($response); } //获取通知的数据 - $xml = $GLOBALS['HTTP_RAW_POST_DATA']; + $xml = $raw_post_data; $xml_arr = from_xml($xml); // log_message('error',var_export($xml_arr, 1)); if ($this->check_sign($xml_arr) !== true) {