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; + } + }