79 lines
4.0 KiB
Plaintext
79 lines
4.0 KiB
Plaintext
|
|
<%@ 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> <a href="/" class="needMoney_Purple">返回首页</a></li>
|
|||
|
|
</ul>
|
|||
|
|
</div>
|
|||
|
|
</form>
|
|||
|
|
</body>
|
|||
|
|
</html>
|