From a3fc4f3360a4de1565b4f359d4e703d03c7a037e Mon Sep 17 00:00:00 2001 From: devil_gong Date: Fri, 24 May 2019 18:25:57 +0800 Subject: [PATCH] wx pay debug --- .../index/pay/index.html | 1 + .../weixinwebauthorization/index/Pay.php | 48 +++++++++++++++++++ extend/payment/Weixin.php | 8 +++- 3 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 application/plugins/view/weixinwebauthorization/index/pay/index.html create mode 100644 application/plugins/weixinwebauthorization/index/Pay.php 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 000000000..16e421d4f --- /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 000000000..cc51ab7b7 --- /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 93271e920..6eef119ea 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; } -- GitLab