Files
g.hnyhua.cn/Mtxfw.shop/pay/wxpay.aspx
2026-02-07 15:48:27 +08:00

79 lines
4.0 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="wxpay.aspx.cs" Inherits="Mtxfw.shop.wxpay" %>
<!DOCTYPE html>
<html>
<head runat="server">
<title></title>
<meta http-equiv="content-type" content="text/html;charset=utf-8"/>
<script src="http://res.mail.qq.com/mmr/static/lib/js/jquery.js" type="text/javascript"></script>
<script src="http://res.mail.qq.com/mmr/static/lib/js/lazyloadv3.js" type="text/javascript"></script>
<meta id="viewport" name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1; user-scalable=no;" />
<style type="text/css">
.ulbox{float:left;width:100%; margin:0;}
.ulbox ul{float:left;width:100%;margin:0; list-style-type:none;}
.ulbox ul li{float:left;width:100%; line-height:40px; height:40px;}
.needMoney_Purple
{
margin:0 auto;
width:125px;
height:35px;
display:inline-block;display:-moz-inline-stack;zoom:1;*display:inline;
background-color:#ff4a00;
line-height:35px;
font-size:16px;
text-align:center;
color:#fff;
font-weight:bold;
cursor:pointer;
border:0;
-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;
}
</style>
</head>
<body>
<form runat="server">
<input type="hidden" name="hidBillID" value="" id="hidBillID" runat="server" />
<script type="text/javascript">
// 当微信内置浏览器完成内部初始化后会触发WeixinJSBridgeReady事件。
document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {
WeixinJSBridge.invoke('getBrandWCPayRequest', <%=wx_packageValue %>
, function (res) {
if (res.err_msg == "get_brand_wcpay_request:ok") {
location.replace("/wxpayreturn_url.aspx?bill="+$("#hidBill").val());
}else{
$(".ulbox").show();
//alert(res.err_msg);
}
// 使用以上方式判断前端返回,微信团队郑重提示res.err_msg将在用户支付成功后返回ok但并不保证它绝对可靠。
//因此微信团队建议当收到ok返回时向商户后台询问是否收到交易成功的通知若收到通知前端展示交易成功的界面若此时未收到通知商户后台主动调用查询订单接口查询订单的当前状态并反馈给前端展示相应的界面。
});
//公众号支付
jQuery('a#getBrandWCPayRequest').click(function (e) {
//alert("<%=wx_packageValue %>");
$(".ulbox").hide();
WeixinJSBridge.invoke('getBrandWCPayRequest', <%=wx_packageValue %>
, function (res) {
if (res.err_msg == "get_brand_wcpay_request:ok") {
location.replace("/wxpayreturn_url.aspx?bill="+$("#hidBill").val());
}else{
$(".ulbox").show();
}
// 使用以上方式判断前端返回,微信团队郑重提示res.err_msg将在用户支付成功后返回ok但并不保证它绝对可靠。
//因此微信团队建议当收到ok返回时向商户后台询问是否收到交易成功的通知若收到通知前端展示交易成功的界面若此时未收到通知商户后台主动调用查询订单接口查询订单的当前状态并反馈给前端展示相应的界面。
});
});
}, false)
</script>
<div class="ulbox" style=" display:none;">
<ul>
<li>您需要支付¥<span style=" color:Red; font-size:16px; font-weight:bold;"><asp:Label ID="paybill" runat="server"></asp:Label></span>元</li>
<li><a id="getBrandWCPayRequest" href="javascript:void(0);" class="needMoney_Purple">确认支付</a></li>
<li><a href="/Member_Orders_List.aspx" class="needMoney_Purple">查看订单</a>&nbsp;&nbsp;<a href="/" class="needMoney_Purple">返回首页</a></li>
</ul>
</div>
</form>
</body>
</html>