diff --git a/application/plugins/view/weixinwebauthorization/index/pay/index.html b/application/plugins/view/weixinwebauthorization/index/pay/index.html new file mode 100644 index 0000000000000000000000000000000000000000..16e421d4fd2db12ae0a52121343c0cce07abd52d --- /dev/null +++ b/application/plugins/view/weixinwebauthorization/index/pay/index.html @@ -0,0 +1 @@ +pay \ No newline at end of file diff --git a/application/plugins/weixinwebauthorization/index/Pay.php b/application/plugins/weixinwebauthorization/index/Pay.php new file mode 100644 index 0000000000000000000000000000000000000000..cc51ab7b7cacbf9288aac68285992ae8a8ade41e --- /dev/null +++ b/application/plugins/weixinwebauthorization/index/Pay.php @@ -0,0 +1,48 @@ +fetch('../../../plugins/view/weixinwebauthorization/index/pay/index'); + } else { + $this->assign('msg', '支付参数错误'); + return $this->fetch('public/tips_error'); + } + } + + +} +?> \ No newline at end of file diff --git a/extend/payment/Weixin.php b/extend/payment/Weixin.php index 93271e920f81c2713701a329bb231f901b9147f5..6eef119ea2cf29f7b3c3a77298bdcc44ba2f11a0 100755 --- a/extend/payment/Weixin.php +++ b/extend/payment/Weixin.php @@ -205,6 +205,13 @@ class Weixin 'timeStamp' => (string) time(), ); $pay_data['paySign'] = $this->GetSign($pay_data); + + // 微信中 + if(!empty($_SERVER['HTTP_USER_AGENT']) && stripos($_SERVER['HTTP_USER_AGENT'], 'MicroMessenger') !== false) + { + $url = PluginsHomeUrl('weixinwebauthorization', 'pay', 'index', ['pay_data'=>urlencode(json_encode($pay_data))]); + $result = DataReturn('success', 0, $url); + } $result = DataReturn('success', 0, $pay_data); break; @@ -213,7 +220,6 @@ class Weixin $result = DataReturn('APP支付暂未开放', -1); break; } - print_r($result);die; return $result; }