提交 8bcf1841 编写于 作者: G gongfuxiang

wx pay

上级 ce264145
......@@ -210,7 +210,32 @@ class Weixin
// 微信中
if(!empty($_SERVER['HTTP_USER_AGENT']) && stripos($_SERVER['HTTP_USER_AGENT'], 'MicroMessenger') !== false)
{
$html = '<html>
$this->PayHtml($pay_data, $redirect_url);
} else {
$result = DataReturn('success', 0, $pay_data);
}
break;
// APP支付
case 'APP' :
$result = DataReturn('APP支付暂未开放', -1);
break;
}
return $result;
}
/**
* 支付代码
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2019-05-25T00:07:52+0800
* @param [array] $pay_data [支付信息]
* @param [string] $redirect_url [成功后的url]
*/
private function PayHtml($pay_data, $redirect_url)
{
exit('<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8"/>
<title>微信安全支付</title>
......@@ -229,7 +254,7 @@ class Weixin
function(res) {
if(res.err_msg == "get_brand_wcpay_request:ok" )
{
Prompt(result.msg, "success");
Prompt("支付成功", "success");
} else if(res.err_msg == "get_brand_wcpay_request:cancel")
{
Prompt("用户取消");
......@@ -257,19 +282,7 @@ class Weixin
</script>
</head>
<body>
</html>';
exit($html);
} else {
$result = DataReturn('success', 0, $pay_data);
}
break;
// APP支付
case 'APP' :
$result = DataReturn('APP支付暂未开放', -1);
break;
}
return $result;
</html>');
}
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册