From d6d761bc4d486e900e059187052c8ce35316c31e Mon Sep 17 00:00:00 2001 From: lyt Date: Mon, 6 May 2019 11:33:58 +0800 Subject: [PATCH] =?UTF-8?q?alipay=20=E4=B8=B4=E6=97=B6=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E8=B7=A8=E5=9F=9F,=20=E8=BF=81=E7=A7=BB144=E5=90=8E=E5=88=A0?= =?UTF-8?q?=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pay/controllers/AlipayTradeService.php | 4 ++++ .../pay/controllers/WxpayService.php | 18 +++++++++--------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/webht/third_party/pay/controllers/AlipayTradeService.php b/webht/third_party/pay/controllers/AlipayTradeService.php index 9800c519..af470043 100644 --- a/webht/third_party/pay/controllers/AlipayTradeService.php +++ b/webht/third_party/pay/controllers/AlipayTradeService.php @@ -78,6 +78,10 @@ class AlipayTradeService extends CI_Controller if(empty($this->gateway_url)||trim($this->gateway_url)==""){ log_message('error','Alipay ERROR gateway_url should not be NULL!'); } + header('Access-Control-Allow-Origin:*'); + header('Access-Control-Allow-Methods:POST, GET'); + header('Access-Control-Max-Age:0'); + header('Access-Control-Allow-Headers:x-requested-with, Content-Type'); } public function index() { diff --git a/webht/third_party/pay/controllers/WxpayService.php b/webht/third_party/pay/controllers/WxpayService.php index 1f39a0ed..145ecb49 100644 --- a/webht/third_party/pay/controllers/WxpayService.php +++ b/webht/third_party/pay/controllers/WxpayService.php @@ -139,18 +139,18 @@ log_message('error','notify begin ----'); * 格式化参数格式化成url参数 */ public function to_url_params($xml_arr) + { + $buff = ""; + foreach ($xml_arr as $k => $v) { - $buff = ""; - foreach ($xml_arr as $k => $v) - { - if($k != "sign" && $v != "" && !is_array($v)){ - $buff .= $k . "=" . $v . "&"; - } + if($k != "sign" && $v != "" && !is_array($v)){ + $buff .= $k . "=" . $v . "&"; } - - $buff = trim($buff, "&"); - return $buff; } + $buff = trim($buff, "&"); + return $buff; + } + }