1 Star 2 Fork 3

MojoCube/McStore

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
WxPayJS.aspx 3.20 KB
一键复制 编辑 原始数据 按行查看 历史
MojoCube 提交于 4年前 . 20210512
<%@ page language="C#" autoeventwireup="true" inherits="Default_WxPayJS, App_Web_e1jp1m1s" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
<title>微信支付中...</title>
<script type="text/javascript">
var appId = '<%=appId%>';
var prepayId = '<%=prepayId%>';
var nonceStr = '<%=nonceStr%>';
var timeStamp = '<%=timeStamp%>';
var sign = '<%=sign%>';
function onBridgeReady() {
WeixinJSBridge.invoke(
'getBrandWCPayRequest', {
"appId": appId, //公众号名称,由商户传入
"timeStamp": timeStamp, //时间戳,自1970年以来的秒数
"nonceStr": nonceStr, //随机串
"package": "prepay_id=" + prepayId,
"signType": "MD5", //微信签名方式
"paySign": sign //微信签名
},
function (res) {
// 使用以上方式判断前端返回,微信团队郑重提示:res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠。
switch (res.err_msg) {
case "get_brand_wcpay_request:ok":
alert("支付成功");
break;
case "get_brand_wcpay_request:cancel":
alert("支付取消");
break;
default:
alert("支付失败");
break;
}
}
);
}
if (typeof WeixinJSBridge == "undefined") {
if (document.addEventListener) {
document.addEventListener('WeixinJSBridgeReady', onBridgeReady, false);
} else if (document.attachEvent) {
document.attachEvent('WeixinJSBridgeReady', onBridgeReady);
document.attachEvent('onWeixinJSBridgeReady', onBridgeReady);
}
} else {
onBridgeReady();
}
</script>
</head>
<body style="background:#F5F5F5;">
<form id="form1" runat="server">
<div>
<div style="text-align:center; padding:10px; padding-top:30px;">
<h2>正在打开微信支付,请稍等...</h2>
</div>
<div style="line-height:1.8em; color:#999; font-size:11pt; padding:10px;">
* 如果没有打开微信支付界面,请检查是否有装360杀毒、ES文件管理器等,这些防护软件有可能把我们的应用支付拦截了。您可以在软件里面解禁我们的应用。
</div>
<div style="padding:50px 0; text-align:center;">
<a href="Order.aspx" style="background:#2BA245; color:#fff; font-size:15pt; padding:20px; text-decoration:none; border-radius:10px;">支付完成,点击返回</a>
</div>
</div>
</form>
</body>
</html>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mojocube/mc-store.git
git@gitee.com:mojocube/mc-store.git
mojocube
mc-store
McStore
master

搜索帮助