mirror of
https://gitee.com/technical-laohu/mpay_v2_webman.git
synced 2026-05-10 02:44:27 +08:00
1. 维护代码健壮
2. 更新项目结构文档
This commit is contained in:
109
doc/api/pages/alipay_h5.php
Normal file
109
doc/api/pages/alipay_h5.php
Normal file
@@ -0,0 +1,109 @@
|
||||
<?php
|
||||
// 支付宝H5支付页面
|
||||
|
||||
if (!defined('IN_PLUGIN'))
|
||||
exit();
|
||||
?>
|
||||
<html lang="zh-cn">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
|
||||
<meta name="renderer" content="webkit" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<title>支付宝支付手机版</title>
|
||||
<link href="<?php echo $cdnpublic ?>twitter-bootstrap/3.4.1/css/bootstrap.min.css" rel="stylesheet" />
|
||||
<link href="/assets/pay/css/mobile-style.css" rel="stylesheet" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="main">
|
||||
<div class="bg-ali"></div>
|
||||
<div class="payment-logo">
|
||||
<img src="/assets/pay/icon/alipay-white.svg" alt="logo">
|
||||
<span class="logo-tile">支付宝支付</span>
|
||||
</div>
|
||||
<div class="payment-content">
|
||||
<div class="content-info">
|
||||
<h1>¥<?php echo $order['realmoney'] ?></h1>
|
||||
<ul class="nk-activity">
|
||||
<li class="nk-activity-item">
|
||||
<span>商品名称:<?php echo $order['name'] ?></span>
|
||||
</li>
|
||||
<li class="nk-activity-item">
|
||||
<span>商户订单号:<?php echo $order['trade_no'] ?></span>
|
||||
</li>
|
||||
<li class="nk-activity-item">
|
||||
<span>创建时间:<?php echo $order['addtime'] ?></span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="content-footer">
|
||||
<a href="javascript:;" id="openUrl" class="btn btn-primary btn-block btn-lg">跳转到支付宝支付</a>
|
||||
<a href="javascript:checkresult()" onclick="" class="btn btn-info btn-block btn-lg">检测支付状态</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="<?php echo $cdnpublic ?>jquery/1.12.4/jquery.min.js"></script>
|
||||
<script src="<?php echo $cdnpublic ?>layer/3.1.1/layer.js"></script>
|
||||
<script>
|
||||
var url_scheme = '<?php echo $code_url ?>';
|
||||
function loadmsg() {
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
dataType: "json",
|
||||
url: "/getshop.php",
|
||||
data: { type: "wxpay", trade_no: "<?php echo $order['trade_no'] ?>" },
|
||||
success: function (data) {
|
||||
if (data.code == 1) {
|
||||
layer.msg('支付成功,正在跳转中...', { icon: 16, shade: 0.01, time: 15000 });
|
||||
setTimeout(window.location.href = <?php echo $redirect_url ?>, 1000);
|
||||
} else {
|
||||
setTimeout("loadmsg()", 2000);
|
||||
}
|
||||
},
|
||||
error: function () {
|
||||
setTimeout("loadmsg()", 2000);
|
||||
}
|
||||
});
|
||||
}
|
||||
function checkresult() {
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
dataType: "json",
|
||||
url: "/getshop.php",
|
||||
data: { type: "wxpay", trade_no: "<?php echo $order['trade_no'] ?>" },
|
||||
success: function (data) {
|
||||
if (data.code == 1) {
|
||||
layer.msg('支付成功,正在跳转中...', { icon: 16, shade: 0.01, time: 15000 });
|
||||
setTimeout(window.location.href = <?php echo $redirect_url ?>, 1000);
|
||||
} else {
|
||||
layer.msg('您还未完成付款,请继续付款', { shade: 0, time: 1500 });
|
||||
}
|
||||
},
|
||||
error: function () {
|
||||
layer.msg('服务器错误');
|
||||
}
|
||||
});
|
||||
}
|
||||
window.onload = function () {
|
||||
window.onpopstate = function (e) {
|
||||
if (e.state == 'forward' || confirm('是否取消支付并返回?')) {
|
||||
window.history.back();
|
||||
} else {
|
||||
e.preventDefault();
|
||||
window.history.pushState('forward', null, '');
|
||||
}
|
||||
};
|
||||
window.history.pushState('forward', null, '');
|
||||
|
||||
document.getElementById("openUrl").href = url_scheme;
|
||||
if (!url_scheme.startsWith('http://') && !url_scheme.startsWith('https://') && navigator.userAgent.indexOf('EdgA/') == -1) {
|
||||
window.location.href = url_scheme;
|
||||
}
|
||||
setTimeout("loadmsg()", 3000);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
84
doc/api/pages/alipay_jspay.php
Normal file
84
doc/api/pages/alipay_jspay.php
Normal file
@@ -0,0 +1,84 @@
|
||||
<?php
|
||||
// 支付宝JS支付页面
|
||||
|
||||
if(!defined('IN_PLUGIN'))exit();
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
|
||||
<title>支付宝支付</title>
|
||||
<link href="/assets/pay/css/weui.css" rel="stylesheet" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="container js_container">
|
||||
<div class="page msg">
|
||||
<div class="weui_msg">
|
||||
<div class="weui_icon_area"><i class="weui_icon_info weui_icon_msg"></i></div>
|
||||
<div class="weui_text_area">
|
||||
<h2 class="weui_msg_title">正在跳转支付...</h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="<?php echo $cdnpublic?>jquery/1.12.4/jquery.min.js"></script>
|
||||
<script src="<?php echo $cdnpublic?>layer/3.1.1/layer.js"></script>
|
||||
<script>
|
||||
document.body.addEventListener('touchmove', function (event) {
|
||||
event.preventDefault();
|
||||
},{ passive: false });
|
||||
|
||||
var tradeNO = '<?php echo $alipay_trade_no?>';
|
||||
|
||||
function Alipayready(callback) {
|
||||
if (window.AlipayJSBridge) {
|
||||
callback && callback();
|
||||
} else {
|
||||
document.addEventListener('AlipayJSBridgeReady', callback, false);
|
||||
}
|
||||
}
|
||||
function AlipayJsPay() {
|
||||
Alipayready(function(){
|
||||
AlipayJSBridge.call("tradePay",{
|
||||
tradeNO: tradeNO
|
||||
}, function(result){
|
||||
var msg = "";
|
||||
if(result.resultCode == "9000"){
|
||||
loadmsg();
|
||||
}else if(result.resultCode == "8000"){
|
||||
msg = "正在处理中";
|
||||
}else if(result.resultCode == "4000"){
|
||||
msg = "订单支付失败";
|
||||
}else if(result.resultCode == "6002"){
|
||||
msg = "网络连接出错";
|
||||
}
|
||||
if (msg!="") {
|
||||
layer.msg(msg);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
function loadmsg() {
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
dataType: "json",
|
||||
url: "/getshop.php",
|
||||
data: {type: "wxpay", trade_no: "<?php echo TRADE_NO?>"},
|
||||
success: function (data) {
|
||||
if (data.code == 1) {
|
||||
layer.msg('支付成功,正在跳转中...', {icon: 16,shade: 0.01,time: 15000});
|
||||
window.location.href=<?php echo $redirect_url?>;
|
||||
}else{
|
||||
setTimeout("loadmsg()", 2000);
|
||||
}
|
||||
},
|
||||
error: function () {
|
||||
setTimeout("loadmsg()", 2000);
|
||||
}
|
||||
});
|
||||
}
|
||||
window.onload = AlipayJsPay();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
169
doc/api/pages/alipay_qrcode.php
Normal file
169
doc/api/pages/alipay_qrcode.php
Normal file
@@ -0,0 +1,169 @@
|
||||
<?php
|
||||
// 支付宝扫码支付页面
|
||||
|
||||
if(!defined('IN_PLUGIN'))exit();
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<meta http-equiv="Content-Language" content="zh-cn">
|
||||
<meta name="renderer" content="webkit">
|
||||
<title>支付宝扫码支付</title>
|
||||
<link href="/assets/css/alipay_pay.css?v=3" rel="stylesheet" media="screen">
|
||||
</head>
|
||||
<body>
|
||||
<img src="/assets/img/guide1.png" alt="引导图" class="top-guide" style="max-width: 100%;margin: auto;display:none">
|
||||
<div class="guide" style="display:none"><img src="/assets/img/guide2.png" alt="引导图" style="width: 96%;"></div>
|
||||
<div class="body">
|
||||
<h1 class="mod-title">
|
||||
<span class="ico-wechat"></span><span class="text">支付宝扫码支付</span>
|
||||
</h1>
|
||||
<div class="mod-ct">
|
||||
<div class="order">
|
||||
</div>
|
||||
<div class="amount">¥<?php echo $order['realmoney']?></div>
|
||||
<div class="qr-image" id="qrcode">
|
||||
</div>
|
||||
<div class="open_app" style="display: none;">
|
||||
<a class="btn-open-app">打开支付宝APP继续付款</a><br/><br/><br/>
|
||||
<a onclick="checkresult()" class="btn-check">我已付款,返回查看订单</a>
|
||||
</div>
|
||||
<div class="detail" id="orderDetail">
|
||||
<dl class="detail-ct" style="display: none;">
|
||||
<dt>购买物品</dt>
|
||||
<dd id="productName"><?php echo $order['name']?></dd>
|
||||
<dt>商户订单号</dt>
|
||||
<dd id="billId"><?php echo $order['trade_no']?></dd>
|
||||
<dt>创建时间</dt>
|
||||
<dd id="createTime"><?php echo $order['addtime']?></dd>
|
||||
</dl>
|
||||
<a href="javascript:void(0)" class="arrow"><i class="ico-arrow"></i></a>
|
||||
</div>
|
||||
<div class="tip">
|
||||
<span class="dec dec-left"></span>
|
||||
<span class="dec dec-right"></span>
|
||||
<div class="ico-scan"></div>
|
||||
<div class="tip-text">
|
||||
<p>请使用支付宝扫一扫</p>
|
||||
<p>扫描二维码完成支付</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tip-text">
|
||||
</div>
|
||||
</div>
|
||||
<script src="<?php echo $cdnpublic?>jquery/1.12.4/jquery.min.js"></script>
|
||||
<script src="<?php echo $cdnpublic?>layer/3.1.1/layer.js"></script>
|
||||
<script src="<?php echo $cdnpublic?>jquery.qrcode/1.0/jquery.qrcode.min.js"></script>
|
||||
<script>
|
||||
var code_url = '<?php echo $code_url?>';
|
||||
var code_type = code_url.indexOf('data:image/')>-1?1:0;
|
||||
if(code_type == 0){
|
||||
var url_scheme = 'alipays://platformapi/startapp?appId=20000067&url=' + encodeURIComponent(code_url);
|
||||
$('#qrcode').qrcode({
|
||||
text: code_url,
|
||||
width: 230,
|
||||
height: 230,
|
||||
foreground: "#000000",
|
||||
background: "#ffffff",
|
||||
typeNumber: -1
|
||||
});
|
||||
}else{
|
||||
$('#qrcode').html('<img src="'+code_url+'"/>');
|
||||
}
|
||||
// 订单详情
|
||||
$('#orderDetail .arrow').click(function (event) {
|
||||
if ($('#orderDetail').hasClass('detail-open')) {
|
||||
$('#orderDetail .detail-ct').slideUp(500, function () {
|
||||
$('#orderDetail').removeClass('detail-open');
|
||||
});
|
||||
} else {
|
||||
$('#orderDetail .detail-ct').slideDown(500, function () {
|
||||
$('#orderDetail').addClass('detail-open');
|
||||
});
|
||||
}
|
||||
});
|
||||
function loadmsg() {
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
dataType: "json",
|
||||
url: "/getshop.php",
|
||||
data: {type: "alipay", trade_no: "<?php echo $order['trade_no']?>"},
|
||||
success: function (data) {
|
||||
if (data.code == 1) {
|
||||
layer.msg('支付成功,正在跳转中...', {icon: 16,shade: 0.1,time: 15000});
|
||||
setTimeout(window.location.href=data.backurl, 1000);
|
||||
}else{
|
||||
setTimeout("loadmsg()", 2000);
|
||||
}
|
||||
},
|
||||
error: function () {
|
||||
setTimeout("loadmsg()", 2000);
|
||||
}
|
||||
});
|
||||
}
|
||||
function checkresult() {
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
dataType: "json",
|
||||
url: "/getshop.php",
|
||||
data: {type: "alipay", trade_no: "<?php echo $order['trade_no']?>"},
|
||||
success: function (data) {
|
||||
if (data.code == 1) {
|
||||
layer.msg('支付成功,正在跳转中...', {icon: 16,shade: 0.1,time: 15000});
|
||||
setTimeout(window.location.href=data.backurl, 1000);
|
||||
}else{
|
||||
layer.msg('您还未完成付款,请继续付款', {shade: 0,time: 1500});
|
||||
}
|
||||
},
|
||||
error: function () {
|
||||
layer.msg('服务器错误');
|
||||
}
|
||||
});
|
||||
}
|
||||
var isMobile = function (){
|
||||
var ua = navigator.userAgent;
|
||||
var ipad = ua.match(/(iPad).*OS\s([\d_]+)/),
|
||||
isIphone =!ipad && ua.match(/(iPhone\sOS)\s([\d_]+)/),
|
||||
isAndroid = ua.match(/(Android)\s+([\d.]+)/);
|
||||
return isIphone || isAndroid;
|
||||
}
|
||||
function wx_open(){
|
||||
$(".guide").show();
|
||||
//layer.alert('请点击屏幕右上角,<b>在浏览器打开</b>即可跳转支付。<br/><font color="red">支付成功后,回到微信查看结果</font>', {title:'支付提示'});
|
||||
}
|
||||
window.onload = function(){
|
||||
if(isMobile()){
|
||||
window.onpopstate=function (e) {
|
||||
if(e.state=='forward' || confirm('是否取消支付并返回?')){
|
||||
window.history.back();
|
||||
}else{
|
||||
e.preventDefault();
|
||||
window.history.pushState('forward', null, '');
|
||||
}
|
||||
};
|
||||
window.history.pushState('forward', null, '');
|
||||
}
|
||||
if(isMobile() && code_type==0){
|
||||
$('.open_app').show();
|
||||
if(navigator.userAgent.indexOf('MicroMessenger/')>0){
|
||||
$(".top-guide").show();
|
||||
$('.btn-open-app').attr('href', 'javascript:wx_open()');
|
||||
}else{
|
||||
$('.btn-open-app').attr('href', url_scheme)
|
||||
if(navigator.userAgent.indexOf('EdgA/')==-1 && $(window).height() > $(window).width()){
|
||||
setTimeout(window.location.href = url_scheme, 1000);
|
||||
}
|
||||
}
|
||||
}
|
||||
$("body").click(function(){
|
||||
if (!$(".guide").is(":hidden")) {
|
||||
$(".guide").hide();
|
||||
}
|
||||
});
|
||||
setTimeout("loadmsg()", 2000);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
91
doc/api/pages/alipay_qrcodepc.php
Normal file
91
doc/api/pages/alipay_qrcodepc.php
Normal file
@@ -0,0 +1,91 @@
|
||||
<?php
|
||||
// 支付宝扫码支付页面
|
||||
|
||||
if(!defined('IN_PLUGIN'))exit();
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<meta http-equiv="Content-Language" content="zh-cn">
|
||||
<meta name="renderer" content="webkit">
|
||||
<title>支付宝扫码支付</title>
|
||||
<link href="/assets/css/alipay_pay.css?v=2" rel="stylesheet" media="screen">
|
||||
</head>
|
||||
<body>
|
||||
<div class="body">
|
||||
<h1 class="mod-title">
|
||||
<span class="ico-wechat"></span><span class="text">支付宝扫码支付</span>
|
||||
</h1>
|
||||
<div class="mod-ct">
|
||||
<div class="order">
|
||||
</div>
|
||||
<div class="amount">¥<?php echo $order['realmoney']?></div>
|
||||
<div class="qr-image" id="qrcode">
|
||||
<iframe src="<?php echo $code_url?>" width="230px" height="230px" frameborder="0" scrolling="no" seamless></iframe>
|
||||
</div>
|
||||
<div class="detail" id="orderDetail">
|
||||
<dl class="detail-ct" style="display: none;">
|
||||
<dt>购买物品</dt>
|
||||
<dd id="productName"><?php echo $order['name']?></dd>
|
||||
<dt>商户订单号</dt>
|
||||
<dd id="billId"><?php echo $order['trade_no']?></dd>
|
||||
<dt>创建时间</dt>
|
||||
<dd id="createTime"><?php echo $order['addtime']?></dd>
|
||||
</dl>
|
||||
<a href="javascript:void(0)" class="arrow"><i class="ico-arrow"></i></a>
|
||||
</div>
|
||||
<div class="tip">
|
||||
<span class="dec dec-left"></span>
|
||||
<span class="dec dec-right"></span>
|
||||
<div class="ico-scan"></div>
|
||||
<div class="tip-text">
|
||||
<p>请使用支付宝扫一扫</p>
|
||||
<p>扫描二维码完成支付</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tip-text">
|
||||
</div>
|
||||
</div>
|
||||
<script src="<?php echo $cdnpublic?>jquery/1.12.4/jquery.min.js"></script>
|
||||
<script src="<?php echo $cdnpublic?>layer/3.1.1/layer.js"></script>
|
||||
<script src="<?php echo $cdnpublic?>jquery.qrcode/1.0/jquery.qrcode.min.js"></script>
|
||||
<script>
|
||||
// 订单详情
|
||||
$('#orderDetail .arrow').click(function (event) {
|
||||
if ($('#orderDetail').hasClass('detail-open')) {
|
||||
$('#orderDetail .detail-ct').slideUp(500, function () {
|
||||
$('#orderDetail').removeClass('detail-open');
|
||||
});
|
||||
} else {
|
||||
$('#orderDetail .detail-ct').slideDown(500, function () {
|
||||
$('#orderDetail').addClass('detail-open');
|
||||
});
|
||||
}
|
||||
});
|
||||
function loadmsg() {
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
dataType: "json",
|
||||
url: "/getshop.php",
|
||||
data: {type: "alipay", trade_no: "<?php echo $order['trade_no']?>"},
|
||||
success: function (data) {
|
||||
if (data.code == 1) {
|
||||
layer.msg('支付成功,正在跳转中...', {icon: 16,shade: 0.1,time: 15000});
|
||||
setTimeout(window.location.href=data.backurl, 1000);
|
||||
}else{
|
||||
setTimeout("loadmsg()", 2000);
|
||||
}
|
||||
},
|
||||
error: function () {
|
||||
setTimeout("loadmsg()", 2000);
|
||||
}
|
||||
});
|
||||
}
|
||||
window.onload = function(){
|
||||
setTimeout("loadmsg()", 2000);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
149
doc/api/pages/bank_qrcode.php
Normal file
149
doc/api/pages/bank_qrcode.php
Normal file
@@ -0,0 +1,149 @@
|
||||
<?php
|
||||
// 银联云闪付扫码支付页面
|
||||
|
||||
if(!defined('IN_PLUGIN'))exit();
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<meta http-equiv="Content-Language" content="zh-cn">
|
||||
<meta name="renderer" content="webkit">
|
||||
<title>银联云闪付扫码支付</title>
|
||||
<link href="/assets/css/bank_pay.css?v=3" rel="stylesheet" media="screen">
|
||||
</head>
|
||||
<body>
|
||||
<div class="body">
|
||||
<h1 class="mod-title">
|
||||
<span class="ico-wechat"></span><span class="text">银联云闪付扫码支付</span>
|
||||
</h1>
|
||||
<div class="mod-ct">
|
||||
<div class="order">
|
||||
</div>
|
||||
<div class="amount">¥<?php echo $order['realmoney']?></div>
|
||||
<div class="qr-image" id="qrcode">
|
||||
</div>
|
||||
<div class="open_app" style="display: none;">
|
||||
<a class="btn-open-app">打开云闪付APP继续付款</a><br/><br/><br/>
|
||||
<a onclick="checkresult()" class="btn-check">我已付款,返回查看订单</a>
|
||||
</div>
|
||||
<div class="detail" id="orderDetail">
|
||||
<dl class="detail-ct" style="display: none;">
|
||||
<dt>购买物品</dt>
|
||||
<dd id="productName"><?php echo $order['name']?></dd>
|
||||
<dt>商户订单号</dt>
|
||||
<dd id="billId"><?php echo $order['trade_no']?></dd>
|
||||
<dt>创建时间</dt>
|
||||
<dd id="createTime"><?php echo $order['addtime']?></dd>
|
||||
</dl>
|
||||
<a href="javascript:void(0)" class="arrow"><i class="ico-arrow"></i></a>
|
||||
</div>
|
||||
<div class="tip">
|
||||
<span class="dec dec-left"></span>
|
||||
<span class="dec dec-right"></span>
|
||||
<div class="ico-scan"></div>
|
||||
<div class="tip-text">
|
||||
<p>请使用银联云闪付扫一扫</p>
|
||||
<p>扫描二维码完成支付</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tip-text">
|
||||
</div>
|
||||
</div>
|
||||
<script src="<?php echo $cdnpublic?>jquery/1.12.4/jquery.min.js"></script>
|
||||
<script src="<?php echo $cdnpublic?>layer/3.1.1/layer.js"></script>
|
||||
<script src="<?php echo $cdnpublic?>jquery.qrcode/1.0/jquery.qrcode.min.js"></script>
|
||||
<script>
|
||||
var code_url = '<?php echo $code_url?>';
|
||||
var code_type = code_url.indexOf('data:image/')>-1?1:0;
|
||||
if(code_type == 0){
|
||||
var url_scheme = 'upwallet://html/' + code_url.replace('https://', '').replace('http://', '');
|
||||
$('#qrcode').qrcode({
|
||||
text: code_url,
|
||||
width: 230,
|
||||
height: 230,
|
||||
foreground: "#000000",
|
||||
background: "#ffffff",
|
||||
typeNumber: -1
|
||||
});
|
||||
}else{
|
||||
$('#qrcode').html('<img src="'+code_url+'"/>');
|
||||
}
|
||||
// 订单详情
|
||||
$('#orderDetail .arrow').click(function (event) {
|
||||
if ($('#orderDetail').hasClass('detail-open')) {
|
||||
$('#orderDetail .detail-ct').slideUp(500, function () {
|
||||
$('#orderDetail').removeClass('detail-open');
|
||||
});
|
||||
} else {
|
||||
$('#orderDetail .detail-ct').slideDown(500, function () {
|
||||
$('#orderDetail').addClass('detail-open');
|
||||
});
|
||||
}
|
||||
});
|
||||
function loadmsg() {
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
dataType: "json",
|
||||
url: "/getshop.php",
|
||||
data: {type: "bank", trade_no: "<?php echo $order['trade_no']?>"},
|
||||
success: function (data) {
|
||||
if (data.code == 1) {
|
||||
layer.msg('支付成功,正在跳转中...', {icon: 16,shade: 0.1,time: 15000});
|
||||
setTimeout(window.location.href=data.backurl, 1000);
|
||||
}else{
|
||||
setTimeout("loadmsg()", 2000);
|
||||
}
|
||||
},
|
||||
error: function () {
|
||||
setTimeout("loadmsg()", 2000);
|
||||
}
|
||||
});
|
||||
}
|
||||
function checkresult() {
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
dataType: "json",
|
||||
url: "/getshop.php",
|
||||
data: {type: "bank", trade_no: "<?php echo $order['trade_no']?>"},
|
||||
success: function (data) {
|
||||
if (data.code == 1) {
|
||||
layer.msg('支付成功,正在跳转中...', {icon: 16,shade: 0.1,time: 15000});
|
||||
setTimeout(window.location.href=data.backurl, 1000);
|
||||
}else{
|
||||
layer.msg('您还未完成付款,请继续付款', {shade: 0,time: 1500});
|
||||
}
|
||||
},
|
||||
error: function () {
|
||||
layer.msg('服务器错误');
|
||||
}
|
||||
});
|
||||
}
|
||||
var isMobile = function (){
|
||||
var ua = navigator.userAgent;
|
||||
var ipad = ua.match(/(iPad).*OS\s([\d_]+)/),
|
||||
isIphone =!ipad && ua.match(/(iPhone\sOS)\s([\d_]+)/),
|
||||
isAndroid = ua.match(/(Android)\s+([\d.]+)/);
|
||||
return isIphone || isAndroid;
|
||||
}
|
||||
function wx_open(){
|
||||
layer.alert('请点击屏幕右上角,<b>在浏览器打开</b>即可跳转支付。<br/><font color="red">支付成功后,回到微信查看结果</font>', {title:'支付提示'});
|
||||
}
|
||||
window.onload = function(){
|
||||
if(isMobile() && code_type==0){
|
||||
$('.open_app').show();
|
||||
if(navigator.userAgent.indexOf('MicroMessenger/')>0){
|
||||
$('.btn-open-app').attr('onclick', 'wx_open()');
|
||||
}else{
|
||||
$('.btn-open-app').attr('href', url_scheme);
|
||||
if(navigator.userAgent.indexOf('EdgA/')==-1 && $(window).height() > $(window).width()){
|
||||
window.location.href = url_scheme;
|
||||
}
|
||||
}
|
||||
}
|
||||
setTimeout("loadmsg()", 2000);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
79
doc/api/pages/certok.php
Normal file
79
doc/api/pages/certok.php
Normal file
@@ -0,0 +1,79 @@
|
||||
<?php
|
||||
/**
|
||||
* 实名认证成功页面
|
||||
**/
|
||||
if(!defined('IN_CRONLITE'))exit();
|
||||
?>
|
||||
<html class="weui-msg">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta id="viewport" name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
||||
<title>实名认证成功</title>
|
||||
<link href="/assets/css/weui.min.css" rel="stylesheet">
|
||||
<style>.page{position:absolute;top:0;right:0;bottom:0;left:0;overflow-y:auto;-webkit-overflow-scrolling:touch;box-sizing:border-box}</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<div class="page">
|
||||
<div class="weui-msg">
|
||||
<div class="weui-msg__icon-area">
|
||||
<i class="weui-icon-success weui-icon_msg"></i>
|
||||
</div>
|
||||
<div class="weui-msg__text-area">
|
||||
<h2 class="weui-msg__title">实名认证成功</h2>
|
||||
<p class="weui-msg__desc">请返回浏览器查看结果</p>
|
||||
</div>
|
||||
<div class="weui-msg__opr-area">
|
||||
<p class="weui-btn-area">
|
||||
<a href="javascript:;" class="weui-btn weui-btn_default" id="Close">关闭</a>
|
||||
</p>
|
||||
</div>
|
||||
<div class="weui-msg__extra-area">
|
||||
<div class="weui-footer"><p class="weui-footer__links"></p></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="<?php echo $cdnpublic?>jquery/1.12.4/jquery.min.js"></script>
|
||||
<script>
|
||||
document.body.addEventListener('touchmove', function (event) {
|
||||
event.preventDefault();
|
||||
},{ passive: false });
|
||||
|
||||
if(navigator.userAgent.indexOf("AlipayClient") > -1){
|
||||
function Alipayready(callback) {
|
||||
if (window.AlipayJSBridge) {
|
||||
callback && callback();
|
||||
} else {
|
||||
document.addEventListener('AlipayJSBridgeReady', callback, false);
|
||||
}
|
||||
}
|
||||
Alipayready(function(){
|
||||
$('#Close').click(function() {
|
||||
AlipayJSBridge.call('popWindow');
|
||||
});
|
||||
})
|
||||
}else if(navigator.userAgent.indexOf("MicroMessenger") > -1){
|
||||
if (typeof WeixinJSBridge == "undefined") {
|
||||
if (document.addEventListener) {
|
||||
document.addEventListener('WeixinJSBridgeReady', jsApiCall, false);
|
||||
} else if (document.attachEvent) {
|
||||
document.attachEvent('WeixinJSBridgeReady', jsApiCall);
|
||||
document.attachEvent('onWeixinJSBridgeReady', jsApiCall);
|
||||
}
|
||||
} else {
|
||||
jsApiCall();
|
||||
}
|
||||
function jsApiCall() {
|
||||
$('#Close').click(function() {
|
||||
WeixinJSBridge.call('closeWindow');
|
||||
});
|
||||
}
|
||||
}else{
|
||||
$('#Close').click(function() {
|
||||
window.opener=null;window.close();
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
38
doc/api/pages/error.php
Normal file
38
doc/api/pages/error.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/*
|
||||
* 支付失败提示页面
|
||||
*/
|
||||
if(!defined('IN_PLUGIN'))exit();
|
||||
?>
|
||||
<html class="weui-msg">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta id="viewport" name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
||||
<title>错误提示</title>
|
||||
<link href="/assets/css/weui.min.css" rel="stylesheet">
|
||||
<style>.page{position:absolute;top:0;right:0;bottom:0;left:0;overflow-y:auto;-webkit-overflow-scrolling:touch;box-sizing:border-box}</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<div class="page">
|
||||
<div class="weui-msg">
|
||||
<div class="weui-msg__icon-area">
|
||||
<i class="weui-icon-warn weui-icon_msg"></i>
|
||||
</div>
|
||||
<div class="weui-msg__text-area">
|
||||
<h2 class="weui-msg__title">错误提示</h2>
|
||||
<p class="weui-msg__desc">支付失败或支付超时,请返回重新发起支付</p>
|
||||
</div>
|
||||
<div class="weui-msg__extra-area">
|
||||
<div class="weui-footer"><p class="weui-footer__links"></p></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
document.body.addEventListener('touchmove', function (event) {
|
||||
event.preventDefault();
|
||||
},{ passive: false });
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
108
doc/api/pages/jdpay_qrcode.php
Normal file
108
doc/api/pages/jdpay_qrcode.php
Normal file
@@ -0,0 +1,108 @@
|
||||
<?php
|
||||
// 京东扫码支付页面
|
||||
|
||||
if(!defined('IN_PLUGIN'))exit();
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<meta http-equiv="Content-Language" content="zh-cn">
|
||||
<meta name="renderer" content="webkit">
|
||||
<title>京东扫码支付</title>
|
||||
<link href="/assets/css/jd_pay.css" rel="stylesheet" media="screen">
|
||||
</head>
|
||||
<body>
|
||||
<div class="body">
|
||||
<h1 class="mod-title">
|
||||
<span class="ico-wechat"></span><span class="text">京东扫码支付</span>
|
||||
</h1>
|
||||
<div class="mod-ct">
|
||||
<div class="order">
|
||||
</div>
|
||||
<div class="amount">¥<?php echo $order['realmoney']?></div>
|
||||
<div class="qr-image" id="qrcode">
|
||||
</div>
|
||||
|
||||
<div class="detail" id="orderDetail">
|
||||
<dl class="detail-ct" style="display: none;">
|
||||
<dt>商家</dt>
|
||||
<dd id="storeName"><?php echo $sitename?></dd>
|
||||
<dt>购买物品</dt>
|
||||
<dd id="productName"><?php echo $order['name']?></dd>
|
||||
<dt>商户订单号</dt>
|
||||
<dd id="billId"><?php echo $order['trade_no']?></dd>
|
||||
<dt>创建时间</dt>
|
||||
<dd id="createTime"><?php echo $order['addtime']?></dd>
|
||||
</dl>
|
||||
<a href="javascript:void(0)" class="arrow"><i class="ico-arrow"></i></a>
|
||||
</div>
|
||||
<div class="tip">
|
||||
<span class="dec dec-left"></span>
|
||||
<span class="dec dec-right"></span>
|
||||
<div class="ico-scan"></div>
|
||||
<div class="tip-text">
|
||||
<p>请使用京东APP扫一扫</p>
|
||||
<p>扫描二维码完成支付</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tip-text">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="<?php echo $cdnpublic?>jquery/1.12.4/jquery.min.js"></script>
|
||||
<script src="<?php echo $cdnpublic?>layer/3.1.1/layer.js"></script>
|
||||
<script src="<?php echo $cdnpublic?>jquery.qrcode/1.0/jquery.qrcode.min.js"></script>
|
||||
<script>
|
||||
var code_url = '<?php echo $code_url?>';
|
||||
var code_type = code_url.indexOf('data:image/')>-1?1:0;
|
||||
if(code_type == 0){
|
||||
$('#qrcode').qrcode({
|
||||
text: code_url,
|
||||
width: 230,
|
||||
height: 230,
|
||||
foreground: "#000000",
|
||||
background: "#ffffff",
|
||||
typeNumber: -1
|
||||
});
|
||||
}else{
|
||||
$('#qrcode').html('<img src="'+code_url+'"/>');
|
||||
}
|
||||
// 订单详情
|
||||
$('#orderDetail .arrow').click(function (event) {
|
||||
if ($('#orderDetail').hasClass('detail-open')) {
|
||||
$('#orderDetail .detail-ct').slideUp(500, function () {
|
||||
$('#orderDetail').removeClass('detail-open');
|
||||
});
|
||||
} else {
|
||||
$('#orderDetail .detail-ct').slideDown(500, function () {
|
||||
$('#orderDetail').addClass('detail-open');
|
||||
});
|
||||
}
|
||||
});
|
||||
function loadmsg() {
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
dataType: "json",
|
||||
url: "/getshop.php",
|
||||
data: {type: "jdpay", trade_no: "<?php echo $order['trade_no']?>"},
|
||||
success: function (data) {
|
||||
if (data.code == 1) {
|
||||
layer.msg('支付成功,正在跳转中...', {icon: 16,shade: 0.1,time: 15000});
|
||||
setTimeout(window.location.href=data.backurl, 1000);
|
||||
}else{
|
||||
setTimeout("loadmsg()", 2000);
|
||||
}
|
||||
},
|
||||
error: function () {
|
||||
setTimeout("loadmsg()", 2000);
|
||||
}
|
||||
});
|
||||
}
|
||||
window.onload = function(){
|
||||
setTimeout("loadmsg()", 2000);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
67
doc/api/pages/jump.php
Normal file
67
doc/api/pages/jump.php
Normal file
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
if(!defined('IN_PLUGIN'))exit();
|
||||
$useragent = strtolower($_SERVER['HTTP_USER_AGENT']);
|
||||
if(strpos($useragent, 'iphone')!==false || strpos($useragent, 'ipod')!==false){
|
||||
$alert = '<img src="//puep.qpic.cn/coral/Q3auHgzwzM4fgQ41VTF2rLrNvRzmibibqrjTFj5g2kzGyoQj3ViartAEQ/0" class="icon-safari" /> <span id="openm">Safari打开</span>';
|
||||
}elseif(strpos($useragent, 'micromessenger')!==false){
|
||||
$alert = '<img src="//puep.qpic.cn/coral/Q3auHgzwzM4fgQ41VTF2rLbNVmztN9ia6GPRJ0IFicucFTr4Pp8xzibsw/0" class="icon-safari" /> <span id="openm">浏览器打开</span>';
|
||||
}else{
|
||||
$alert = '<img src="//puep.qpic.cn/coral/Q3auHgzwzM4fgQ41VTF2rOCTm6gtUeQKX7m84xg47iaVosibGckrP0JQ/0" class="icon-safari" /> <span id="openm">浏览器打开</span>';
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>请使用浏览器打开</title>
|
||||
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport"/>
|
||||
<meta content="yes" name="apple-mobile-web-app-capable"/>
|
||||
<meta content="black" name="apple-mobile-web-app-status-bar-style"/>
|
||||
<meta name="format-detection" content="telephone=no"/>
|
||||
<meta content="false" name="twcClient" id="twcClient"/>
|
||||
<meta name="aplus-touch" content="1"/>
|
||||
<style>
|
||||
body,html{width:100%;height:100%}
|
||||
*{margin:0;padding:0}
|
||||
body{background-color:#fff}
|
||||
.top-bar-guidance{font-size:15px;color:#fff;height:70%;line-height:1.8;padding-left:20px;padding-top:20px;background:url(//gw.alicdn.com/tfs/TB1eSZaNFXXXXb.XXXXXXXXXXXX-750-234.png) center top/contain no-repeat}
|
||||
.top-bar-guidance .icon-safari{width:25px;height:25px;vertical-align:middle;margin:0 .2em}
|
||||
.app-download-tip{margin:0 auto;width:290px;text-align:center;font-size:15px;color:#2466f4;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAcAQMAAACak0ePAAAABlBMVEUAAAAdYfh+GakkAAAAAXRSTlMAQObYZgAAAA5JREFUCNdjwA8acEkAAAy4AIE4hQq/AAAAAElFTkSuQmCC) left center/auto 15px repeat-x}
|
||||
.app-download-tip .guidance-desc{background-color:#fff;padding:0 5px}
|
||||
.app-download-btn{display:block;width:214px;height:40px;line-height:40px;margin:18px auto 0 auto;text-align:center;font-size:18px;color:#2466f4;border-radius:20px;border:.5px #2466f4 solid;text-decoration:none}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="top-bar-guidance">
|
||||
<p>点击右上角<?php echo $alert?></p>
|
||||
<p>可以继续浏览本站哦~</p>
|
||||
</div>
|
||||
<div class="app-download-tip">
|
||||
<span class="guidance-desc">您也可以复制本站网址,到其它浏览器打开</span>
|
||||
</div>
|
||||
<a class="app-download-btn" id="J_BtnDowanloadApp">点此继续访问</a>
|
||||
<a style="display: none;" href="" id="vurl" rel="noreferrer"></a>
|
||||
|
||||
<script src="//lib.baomitu.com/jquery/1.12.4/jquery.min.js"></script>
|
||||
<script>
|
||||
function openu(u){
|
||||
document.getElementById("vurl").href= u;
|
||||
document.getElementById("vurl").click();
|
||||
}
|
||||
var url = window.location.href;
|
||||
document.querySelector('body').addEventListener('touchmove', function (event) {
|
||||
event.preventDefault();
|
||||
});
|
||||
if(navigator.userAgent.indexOf("QQ/") > -1){
|
||||
openu("ucbrowser://"+url);
|
||||
openu("mttbrowser://url="+url);
|
||||
openu("googlechrome://"+url);
|
||||
$("html").on("click",function(){
|
||||
openu("ucbrowser://"+url);
|
||||
openu("mttbrowser://url="+url);
|
||||
openu("googlechrome://"+url);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
73
doc/api/pages/ok.php
Normal file
73
doc/api/pages/ok.php
Normal file
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
// 支付成功页面
|
||||
|
||||
if(!defined('IN_PLUGIN'))exit();
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
|
||||
<title>支付结果</title>
|
||||
<link href="/assets/pay/css/weui.css" rel="stylesheet" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="container js_container">
|
||||
<div class="page msg">
|
||||
<div class="weui_msg">
|
||||
<div class="weui_icon_area"><i class="weui_icon_success weui_icon_msg"></i></div>
|
||||
<div class="weui_text_area">
|
||||
<h2 class="weui_msg_title">支付成功</h2>
|
||||
<p class="weui_msg_desc">支付成功,请回到浏览器查看订单</p>
|
||||
</div>
|
||||
<div class="weui_opr_area">
|
||||
<p class="weui_btn_area">
|
||||
<a href="javascript:;" class="weui_btn weui_btn_primary" id="Close">关闭</a>
|
||||
<!--a href="javascript:;" class="weui_btn weui_btn_default">返回</a-->
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="<?php echo $cdnpublic?>jquery/1.12.4/jquery.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
document.body.addEventListener('touchmove', function (event) {
|
||||
event.preventDefault();
|
||||
},{ passive: false });
|
||||
if(navigator.userAgent.indexOf("AlipayClient") > -1){
|
||||
function Alipayready(callback) {
|
||||
if (window.AlipayJSBridge) {
|
||||
callback && callback();
|
||||
} else {
|
||||
document.addEventListener('AlipayJSBridgeReady', callback, false);
|
||||
}
|
||||
}
|
||||
Alipayready(function(){
|
||||
$('.weui_opr_area #Close').click(function() {
|
||||
AlipayJSBridge.call('popWindow');
|
||||
});
|
||||
})
|
||||
}else if(navigator.userAgent.indexOf("MicroMessenger") > -1){
|
||||
if (typeof WeixinJSBridge == "undefined") {
|
||||
if (document.addEventListener) {
|
||||
document.addEventListener('WeixinJSBridgeReady', jsApiCall, false);
|
||||
} else if (document.attachEvent) {
|
||||
document.attachEvent('WeixinJSBridgeReady', jsApiCall);
|
||||
document.attachEvent('onWeixinJSBridgeReady', jsApiCall);
|
||||
}
|
||||
} else {
|
||||
jsApiCall();
|
||||
}
|
||||
function jsApiCall() {
|
||||
$('.weui_opr_area #Close').click(function() {
|
||||
WeixinJSBridge.call('closeWindow');
|
||||
});
|
||||
}
|
||||
}else{
|
||||
$('.weui_opr_area #Close').click(function() {
|
||||
window.opener=null;window.close();
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
101
doc/api/pages/openid.php
Normal file
101
doc/api/pages/openid.php
Normal file
@@ -0,0 +1,101 @@
|
||||
<?php
|
||||
/*
|
||||
* 获取openid结果页面
|
||||
*/
|
||||
if(!defined('IN_CRONLITE'))exit();
|
||||
?>
|
||||
<html class="weui-msg">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta id="viewport" name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
||||
<title>获取<?php echo $openid_name?></title>
|
||||
<link href="/assets/css/weui.min.css" rel="stylesheet">
|
||||
<style>.page{position:absolute;top:0;right:0;bottom:0;left:0;overflow-y:auto;-webkit-overflow-scrolling:touch;box-sizing:border-box}</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<div class="page">
|
||||
<div class="weui-form">
|
||||
<div class="weui-msg__icon-area">
|
||||
<i class="weui-icon-success weui-icon_msg"></i>
|
||||
</div>
|
||||
<div class="weui-form__text-area">
|
||||
<h2 class="weui-form__title">获取<?php echo $openid_name?>成功</h2>
|
||||
</div>
|
||||
<div class="weui-form__control-area">
|
||||
<div class="weui-cells__group weui-cells__group_form">
|
||||
<div class="weui-cells__title">如未自动填写,请手动复制下方<?php echo $openid_name?>:</div>
|
||||
<div class="weui-cells weui-cells_form">
|
||||
<div class="weui-cell weui-cell_active">
|
||||
<div class="weui-cell__bd">
|
||||
<textarea class="weui-textarea" rows="2" style="text-align:center"><?php echo $openid_content?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="weui-form__opr-area">
|
||||
<a role="button" class="weui-btn weui-btn_default copy-btn" href="javascript:" data-clipboard-text="<?php echo $openid_content?>">点击复制</a>
|
||||
<a href="javascript:;" class="weui-btn weui-btn_warn" id="Close">关闭</a>
|
||||
</div>
|
||||
<div class="weui-form__extra-area">
|
||||
<div class="weui-footer"><p class="weui-footer__links"></p><p class="weui-footer__text">Copyright © <?php echo date("Y")?> <?php echo $conf['sitename']?></p></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="<?php echo $cdnpublic?>jquery/1.12.4/jquery.min.js"></script>
|
||||
<script src="<?php echo $cdnpublic?>layer/3.1.1/layer.js"></script>
|
||||
<script src="<?php echo $cdnpublic?>clipboard.js/1.7.1/clipboard.min.js"></script>
|
||||
<script>
|
||||
document.body.addEventListener('touchmove', function (event) {
|
||||
event.preventDefault();
|
||||
},{ passive: false });
|
||||
$(document).ready(function(){
|
||||
var clipboard = new Clipboard('.copy-btn');
|
||||
clipboard.on('success', function (e) {
|
||||
layer.msg('复制成功!', {icon: 1});
|
||||
});
|
||||
clipboard.on('error', function (e) {
|
||||
layer.msg('复制失败,请长按链接后手动复制', {icon: 2});
|
||||
});
|
||||
});
|
||||
if(navigator.userAgent.indexOf("AlipayClient/") > -1){
|
||||
function Alipayready(callback) {
|
||||
if (window.AlipayJSBridge) {
|
||||
callback && callback();
|
||||
} else {
|
||||
document.addEventListener('AlipayJSBridgeReady', callback, false);
|
||||
}
|
||||
}
|
||||
Alipayready(function(){
|
||||
$('#Close').click(function() {
|
||||
AlipayJSBridge.call('popWindow');
|
||||
});
|
||||
})
|
||||
}else if(navigator.userAgent.indexOf("MicroMessenger/") > -1){
|
||||
if (typeof WeixinJSBridge == "undefined") {
|
||||
if (document.addEventListener) {
|
||||
document.addEventListener('WeixinJSBridgeReady', jsApiCall, false);
|
||||
} else if (document.attachEvent) {
|
||||
document.attachEvent('WeixinJSBridgeReady', jsApiCall);
|
||||
document.attachEvent('onWeixinJSBridgeReady', jsApiCall);
|
||||
}
|
||||
} else {
|
||||
jsApiCall();
|
||||
}
|
||||
function jsApiCall() {
|
||||
$('#Close').click(function() {
|
||||
WeixinJSBridge.call('closeWindow');
|
||||
});
|
||||
}
|
||||
}else if(navigator.userAgent.indexOf("QQ/") > -1){
|
||||
$('#Close').hide();
|
||||
}else {
|
||||
$('#Close').click(function() {
|
||||
window.opener=null;window.close();
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
68
doc/api/pages/qqpay_jspay.php
Normal file
68
doc/api/pages/qqpay_jspay.php
Normal file
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
// QQ公众号支付页面
|
||||
|
||||
if(!defined('IN_PLUGIN'))exit();
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
|
||||
<title>支付宝支付</title>
|
||||
<link href="/assets/pay/css/weui.css" rel="stylesheet" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="container js_container">
|
||||
<div class="page msg">
|
||||
<div class="weui_msg">
|
||||
<div class="weui_icon_area"><i class="weui_icon_info weui_icon_msg"></i></div>
|
||||
<div class="weui_text_area">
|
||||
<h2 class="weui_msg_title">正在跳转支付...</h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="<?php echo $cdnpublic?>jquery/1.12.4/jquery.min.js"></script>
|
||||
<script src="<?php echo $cdnpublic?>layer/3.1.1/layer.js"></script>
|
||||
<script src="//open.mobile.qq.com/sdk/qqapi.js?_bid=152"></script>
|
||||
<script>
|
||||
document.body.addEventListener('touchmove', function (event) {
|
||||
event.preventDefault();
|
||||
},{ passive: false });
|
||||
|
||||
function callpay()
|
||||
{
|
||||
mqq.tenpay.pay({
|
||||
tokenId: '<?php echo $tokenId; ?>',
|
||||
appInfo: "<?php echo $appInfo; ?>"
|
||||
}, function(result, resultCode){
|
||||
if(result.resultCode == 0){ //支付成功
|
||||
loadmsg();
|
||||
}
|
||||
});
|
||||
}
|
||||
function loadmsg() {
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
dataType: "json",
|
||||
url: "/getshop.php",
|
||||
data: {type: "qqpay", trade_no: "<?php echo $order['trade_no']?>"},
|
||||
success: function (data) {
|
||||
if (data.code == 1) {
|
||||
layer.msg('支付成功,正在跳转中...', {icon: 16,shade: 0.1,time: 15000});
|
||||
setTimeout(window.location.href=data.backurl, 1000);
|
||||
}else{
|
||||
setTimeout("loadmsg()", 2000);
|
||||
}
|
||||
},
|
||||
error: function () {
|
||||
setTimeout("loadmsg()", 2000);
|
||||
}
|
||||
});
|
||||
}
|
||||
window.onload = callpay();
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
112
doc/api/pages/qqpay_qrcode.php
Normal file
112
doc/api/pages/qqpay_qrcode.php
Normal file
@@ -0,0 +1,112 @@
|
||||
<?php
|
||||
// QQ钱包扫码支付页面
|
||||
|
||||
if(!defined('IN_PLUGIN'))exit();
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<meta http-equiv="Content-Language" content="zh-cn">
|
||||
<meta name="renderer" content="webkit">
|
||||
<title>QQ钱包扫码支付</title>
|
||||
<link href="/assets/css/mqq_pay.css?v=1" rel="stylesheet" media="screen">
|
||||
</head>
|
||||
<body>
|
||||
<div class="body">
|
||||
<h1 class="mod-title">
|
||||
<span class="ico-wechat"></span><span class="text">QQ钱包扫码支付</span>
|
||||
</h1>
|
||||
<div class="mod-ct">
|
||||
<div class="order">
|
||||
</div>
|
||||
<div class="amount">¥<?php echo $order['realmoney']?></div>
|
||||
<div class="qr-image" id="qrcode">
|
||||
</div>
|
||||
|
||||
<div class="detail" id="orderDetail">
|
||||
<dl class="detail-ct" style="display: none;">
|
||||
<dt>商家</dt>
|
||||
<dd id="storeName"><?php echo $sitename?></dd>
|
||||
<dt>购买物品</dt>
|
||||
<dd id="productName"><?php echo $order['name']?></dd>
|
||||
<dt>商户订单号</dt>
|
||||
<dd id="billId"><?php echo $order['trade_no']?></dd>
|
||||
<dt>创建时间</dt>
|
||||
<dd id="createTime"><?php echo $order['addtime']?></dd>
|
||||
</dl>
|
||||
<a href="javascript:void(0)" class="arrow"><i class="ico-arrow"></i></a>
|
||||
</div>
|
||||
<div class="tip">
|
||||
<span class="dec dec-left"></span>
|
||||
<span class="dec dec-right"></span>
|
||||
<div class="ico-scan"></div>
|
||||
<div class="tip-text">
|
||||
<p>请使用手机QQ扫一扫</p>
|
||||
<p>扫描二维码完成支付</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tip-text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="foot">
|
||||
<div class="inner">
|
||||
<p>手机用户可保存上方二维码到手机中</p>
|
||||
<p>在手机QQ扫一扫中选择“相册”即可</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="<?php echo $cdnpublic?>jquery/1.12.4/jquery.min.js"></script>
|
||||
<script src="<?php echo $cdnpublic?>layer/3.1.1/layer.js"></script>
|
||||
<script src="<?php echo $cdnpublic?>jquery.qrcode/1.0/jquery.qrcode.min.js"></script>
|
||||
<script>
|
||||
var code_url = '<?php echo $code_url?>';
|
||||
var code_type = code_url.indexOf('data:image/')>-1?1:0;
|
||||
if(code_type == 0){
|
||||
$('#qrcode').qrcode({
|
||||
text: code_url,
|
||||
width: 230,
|
||||
height: 230,
|
||||
foreground: "#000000",
|
||||
background: "#ffffff",
|
||||
typeNumber: -1
|
||||
});
|
||||
}else{
|
||||
$('#qrcode').html('<img src="'+code_url+'"/>');
|
||||
}
|
||||
// 订单详情
|
||||
$('#orderDetail .arrow').click(function (event) {
|
||||
if ($('#orderDetail').hasClass('detail-open')) {
|
||||
$('#orderDetail .detail-ct').slideUp(500, function () {
|
||||
$('#orderDetail').removeClass('detail-open');
|
||||
});
|
||||
} else {
|
||||
$('#orderDetail .detail-ct').slideDown(500, function () {
|
||||
$('#orderDetail').addClass('detail-open');
|
||||
});
|
||||
}
|
||||
});
|
||||
function loadmsg() {
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
dataType: "json",
|
||||
url: "/getshop.php",
|
||||
data: {type: "qqpay", trade_no: "<?php echo $order['trade_no']?>"},
|
||||
success: function (data) {
|
||||
if (data.code == 1) {
|
||||
layer.msg('支付成功,正在跳转中...', {icon: 16,shade: 0.1,time: 15000});
|
||||
setTimeout(window.location.href=data.backurl, 1000);
|
||||
}else{
|
||||
setTimeout("loadmsg()", 2000);
|
||||
}
|
||||
},
|
||||
error: function () {
|
||||
setTimeout("loadmsg()", 2000);
|
||||
}
|
||||
});
|
||||
}
|
||||
window.onload = loadmsg();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
111
doc/api/pages/qqpay_wap.php
Normal file
111
doc/api/pages/qqpay_wap.php
Normal file
@@ -0,0 +1,111 @@
|
||||
<?php
|
||||
// QQ钱包手机扫码页面
|
||||
|
||||
if (!defined('IN_PLUGIN'))
|
||||
exit();
|
||||
?>
|
||||
<html lang="zh-cn">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
|
||||
<meta name="renderer" content="webkit" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<title>QQ钱包支付手机版</title>
|
||||
<link href="<?php echo $cdnpublic ?>twitter-bootstrap/3.4.1/css/bootstrap.min.css" rel="stylesheet" />
|
||||
<link href="/assets/pay/css/mobile-style.css" rel="stylesheet" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="main">
|
||||
<div class="bg-qq"></div>
|
||||
<div class="payment-logo">
|
||||
<img src="/assets/pay/icon/qqpay.svg" alt="logo">
|
||||
<span class="logo-tile">QQ支付</span>
|
||||
</div>
|
||||
<div class="payment-content">
|
||||
<div class="content-info">
|
||||
<h1>¥<?php echo $order['realmoney'] ?></h1>
|
||||
<ul class="nk-activity">
|
||||
<li class="nk-activity-item">
|
||||
<span>商品名称:<?php echo $order['name'] ?></span>
|
||||
</li>
|
||||
<li class="nk-activity-item">
|
||||
<span>商户订单号:<?php echo $order['trade_no'] ?></span>
|
||||
</li>
|
||||
<li class="nk-activity-item">
|
||||
<span>创建时间:<?php echo $order['addtime'] ?></span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="content-footer">
|
||||
<a href="javascript:;" id="openUrl" class="btn btn-warning btn-block btn-lg">跳转到QQ支付</a>
|
||||
<a href="javascript:checkresult()" onclick="" class="btn btn-info btn-block btn-lg">检测支付状态</a>
|
||||
<a href="?qrcode=1" class="btn btn-default btn-block btn-lg">切换扫码支付</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="<?php echo $cdnpublic ?>jquery/1.12.4/jquery.min.js"></script>
|
||||
<script src="<?php echo $cdnpublic ?>layer/3.1.1/layer.js"></script>
|
||||
<script>
|
||||
var code_url = '<?php echo $code_url ?>';
|
||||
var url_scheme = 'mqqapi://forward/url?src_type=web&style=default&=1&version=1&url_prefix=' + window.btoa(code_url);
|
||||
function loadmsg() {
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
dataType: "json",
|
||||
url: "/getshop.php",
|
||||
data: { type: "qqpay", trade_no: "<?php echo $order['trade_no'] ?>" },
|
||||
success: function (data) {
|
||||
if (data.code == 1) {
|
||||
layer.msg('支付成功,正在跳转中...', { icon: 16, shade: 0.1, time: 15000 });
|
||||
setTimeout(window.location.href = data.backurl, 1000);
|
||||
} else {
|
||||
setTimeout("loadmsg()", 2000);
|
||||
}
|
||||
},
|
||||
error: function () {
|
||||
setTimeout("loadmsg()", 2000);
|
||||
}
|
||||
});
|
||||
}
|
||||
function checkresult() {
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
dataType: "json",
|
||||
url: "/getshop.php",
|
||||
data: { type: "qqpay", trade_no: "<?php echo $order['trade_no'] ?>" },
|
||||
success: function (data) {
|
||||
if (data.code == 1) {
|
||||
layer.msg('支付成功,正在跳转中...', { icon: 16, shade: 0.1, time: 15000 });
|
||||
setTimeout(window.location.href = data.backurl, 1000);
|
||||
} else {
|
||||
layer.msg('您还未完成付款,请继续付款', { shade: 0, time: 1500 });
|
||||
}
|
||||
},
|
||||
error: function () {
|
||||
layer.msg('服务器错误');
|
||||
}
|
||||
});
|
||||
}
|
||||
window.onload = function () {
|
||||
window.onpopstate = function (e) {
|
||||
if (e.state == 'forward' || confirm('是否取消支付并返回?')) {
|
||||
window.history.back();
|
||||
} else {
|
||||
e.preventDefault();
|
||||
window.history.pushState('forward', null, '');
|
||||
}
|
||||
};
|
||||
window.history.pushState('forward', null, '');
|
||||
|
||||
document.getElementById("openUrl").href = url_scheme;
|
||||
if (navigator.userAgent.indexOf('EdgA/') == -1 && $(window).height() > $(window).width()) {
|
||||
window.location.href = url_scheme;
|
||||
}
|
||||
setTimeout("loadmsg()", 3000);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
54
doc/api/pages/return.php
Normal file
54
doc/api/pages/return.php
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
// 支付返回页面
|
||||
|
||||
if(!defined('IN_PLUGIN'))exit();
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
|
||||
<title>支付结果</title>
|
||||
<link href="/assets/pay/css/weui.css" rel="stylesheet" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="container js_container">
|
||||
<div class="page msg">
|
||||
<div class="weui_msg">
|
||||
<div class="weui_icon_area"><i class="weui_icon_info weui_icon_msg"></i></div>
|
||||
<div class="weui_text_area">
|
||||
<h2 class="weui_msg_title">正在检测付款结果...</h2>
|
||||
<p class="weui_msg_desc">稍后页面将自动跳转</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="<?php echo $cdnpublic?>jquery/1.12.4/jquery.min.js"></script>
|
||||
<script src="<?php echo $cdnpublic?>layer/3.1.1/layer.js"></script>
|
||||
<script>
|
||||
document.body.addEventListener('touchmove', function (event) {
|
||||
event.preventDefault();
|
||||
},{ passive: false });
|
||||
function loadmsg() {
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
dataType: "json",
|
||||
url: "/getshop.php",
|
||||
data: {type: "wxpay", trade_no: "<?php echo $order['trade_no']?>"},
|
||||
success: function (data) {
|
||||
if (data.code == 1) {
|
||||
layer.msg('支付成功,正在跳转中...', {icon: 16,shade: 0.1,time: 15000});
|
||||
setTimeout(window.location.href=data.backurl, 1000);
|
||||
}else{
|
||||
setTimeout("loadmsg()", 2000);
|
||||
}
|
||||
},
|
||||
error: function () {
|
||||
setTimeout("loadmsg()", 2000);
|
||||
}
|
||||
});
|
||||
}
|
||||
window.onload = loadmsg();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
75
doc/api/pages/verify_invisible.php
Normal file
75
doc/api/pages/verify_invisible.php
Normal file
@@ -0,0 +1,75 @@
|
||||
<?php
|
||||
if (!defined('IN_CRONLITE')) exit();
|
||||
|
||||
$html = '<form id="dopay" action="'.$siteurl.'submit.php" method="post">';
|
||||
foreach ($query_arr as $k=>$v) {
|
||||
$html.= '<input type="hidden" name="'.$k.'" value="'.$v.'"/>';
|
||||
}
|
||||
$html .= '<input type="submit" value="Loading"></form>';
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
||||
<title>正在进行支付安全验证,请稍候...</title>
|
||||
<style type="text/css">
|
||||
body{margin:0;padding:0}
|
||||
#waiting{position:absolute;left:50%;top:50%;height:35px;margin:-35px 0 0 -160px;padding:20px;font:16px/30px "Helvetica Neue",Helvetica,Arial,sans-serif;background:#f9fafc url(/assets/img/loading.gif) no-repeat 20px 20px;text-indent:40px;border:1px solid #c5d0dc}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<p id="waiting">正在进行支付安全验证,请稍候...</p>
|
||||
<?php echo $html?>
|
||||
<script src="<?php echo $cdnpublic?>jquery/1.12.4/jquery.min.js"></script>
|
||||
<script src="https://static.geetest.com/v4/gt4.js"></script>
|
||||
<script>
|
||||
window.appendChildOrg = Element.prototype.appendChild;
|
||||
Element.prototype.appendChild = function() {
|
||||
if(arguments[0].tagName == 'SCRIPT'){
|
||||
arguments[0].setAttribute('referrerpolicy', 'no-referrer');
|
||||
}
|
||||
return window.appendChildOrg.apply(this, arguments);
|
||||
};
|
||||
initGeetest4({
|
||||
captchaId: "99b142aaece96330d0f3ffb565ffb3ef",
|
||||
product: 'bind',
|
||||
protocol: 'https://',
|
||||
riskType: 'ai',
|
||||
},function (captcha) {
|
||||
captcha.onReady(function(){
|
||||
captcha.showCaptcha();
|
||||
}).onSuccess(function(){
|
||||
var result = captcha.getValidate();
|
||||
result.pid = '<?php echo $query_arr['pid']?>';
|
||||
result.trade_no = '<?php echo $query_arr['out_trade_no']?>';
|
||||
$.ajax({
|
||||
url: 'getshop.php?act=captcha_verify',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
data: result,
|
||||
cache: false,
|
||||
success: function (data) {
|
||||
if(data.code == 0){
|
||||
var elem = document.getElementById("dopay");
|
||||
var input = document.createElement("input");
|
||||
input.type="hidden";
|
||||
input.name="__defend";
|
||||
input.value=data.key;
|
||||
elem.appendChild(input);
|
||||
elem.submit();
|
||||
}else{
|
||||
alert(data.msg);
|
||||
}
|
||||
},
|
||||
error: function () {
|
||||
alert('服务器错误');
|
||||
}
|
||||
});
|
||||
}).onError(function(){
|
||||
alert('验证码加载失败,请刷新页面重试');
|
||||
})
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
39
doc/api/pages/verify_jump.php
Normal file
39
doc/api/pages/verify_jump.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
if (!defined('IN_CRONLITE')) exit();
|
||||
$x = new \lib\hieroglyphy();
|
||||
$key_enc = $x->hieroglyphyString($key);
|
||||
|
||||
$html = '<form id="dopay" action="'.$siteurl.'submit.php" method="post">';
|
||||
foreach ($query_arr as $k=>$v) {
|
||||
$html.= '<input type="hidden" name="'.$k.'" value="'.$v.'"/>';
|
||||
}
|
||||
$html .= '<input type="submit" value="Loading"></form>';
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
||||
<title>正在进行支付安全验证,请稍候...</title>
|
||||
<style type="text/css">
|
||||
body{margin:0;padding:0}
|
||||
#waiting{position:absolute;left:50%;top:50%;height:35px;margin:-35px 0 0 -160px;padding:20px;font:16px/30px "Helvetica Neue",Helvetica,Arial,sans-serif;background:#f9fafc url(/assets/img/loading.gif) no-repeat 20px 20px;text-indent:40px;border:1px solid #c5d0dc}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<p id="waiting">正在进行支付安全验证,请稍候...</p>
|
||||
<?php echo $html?>
|
||||
<script>
|
||||
var key = <?php echo $key_enc;?>;
|
||||
window.onload=function(){
|
||||
var elem = document.getElementById("dopay");
|
||||
var input=document.createElement("input");
|
||||
input.type="hidden";
|
||||
input.name="__defend";
|
||||
input.value=key;
|
||||
elem.appendChild(input);
|
||||
elem.submit();
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
90
doc/api/pages/verify_slide.php
Normal file
90
doc/api/pages/verify_slide.php
Normal file
@@ -0,0 +1,90 @@
|
||||
<?php
|
||||
if (!defined('IN_CRONLITE')) exit();
|
||||
|
||||
$html = '<form id="dopay" action="'.$siteurl.'submit.php" method="post">';
|
||||
foreach ($query_arr as $k=>$v) {
|
||||
$html.= '<input type="hidden" name="'.$k.'" value="'.$v.'"/>';
|
||||
}
|
||||
$html .= '<input type="submit" value="Loading" style="display:none"></form>';
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
||||
<title>支付环境安全验证</title>
|
||||
<style type="text/css">
|
||||
body{font-family:"微软雅黑";height:auto!important;height:555px;min-height:555px;margin:0}
|
||||
.container{margin:0 auto;margin-top:100px;background:#fff;text-align:center}
|
||||
.header>p{margin:0;margin-top:24px;font-size:18px;line-height:1.7;color:#5d5d5d}
|
||||
strong{color:#3190e6}
|
||||
@media screen and (max-width:767px){.container{margin-top:10px}
|
||||
.header>p{margin:0;padding:20px;font-size:20px;line-height:1.7;color:#5d5d5d}
|
||||
}
|
||||
@media screen and (max-width:320px){.container{margin-top:0}
|
||||
.header>p{margin:0;padding:20px;font-size:18px;line-height:1.7;color:#5d5d5d}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<div class="header">
|
||||
<p>
|
||||
很抱歉,当前支付人数过多,请完成<strong>“滑动验证”</strong>后继续支付
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<?php echo $html?>
|
||||
<script src="<?php echo $cdnpublic?>jquery/1.12.4/jquery.min.js"></script>
|
||||
<script src="https://static.geetest.com/v4/gt4.js"></script>
|
||||
<script>
|
||||
window.appendChildOrg = Element.prototype.appendChild;
|
||||
Element.prototype.appendChild = function() {
|
||||
if(arguments[0].tagName == 'SCRIPT'){
|
||||
arguments[0].setAttribute('referrerpolicy', 'no-referrer');
|
||||
}
|
||||
return window.appendChildOrg.apply(this, arguments);
|
||||
};
|
||||
initGeetest4({
|
||||
captchaId: "54088bb07d2df3c46b79f80300b0abbe",
|
||||
product: 'bind',
|
||||
protocol: 'https://',
|
||||
riskType: 'slide',
|
||||
hideSuccess: true
|
||||
},function (captcha) {
|
||||
captcha.onReady(function(){
|
||||
captcha.showCaptcha();
|
||||
}).onSuccess(function(){
|
||||
var result = captcha.getValidate();
|
||||
result.pid = '<?php echo $query_arr['pid']?>';
|
||||
result.trade_no = '<?php echo $query_arr['out_trade_no']?>';
|
||||
$.ajax({
|
||||
url: 'getshop.php?act=captcha_verify',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
data: result,
|
||||
cache: false,
|
||||
success: function (data) {
|
||||
if(data.code == 0){
|
||||
var elem = document.getElementById("dopay");
|
||||
var input = document.createElement("input");
|
||||
input.type="hidden";
|
||||
input.name="__defend";
|
||||
input.value=data.key;
|
||||
elem.appendChild(input);
|
||||
elem.submit();
|
||||
}else{
|
||||
alert(data.msg);
|
||||
}
|
||||
},
|
||||
error: function () {
|
||||
alert('服务器错误');
|
||||
}
|
||||
});
|
||||
}).onError(function(){
|
||||
alert('验证码加载失败,请刷新页面重试');
|
||||
})
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
72
doc/api/pages/wxopen.php
Normal file
72
doc/api/pages/wxopen.php
Normal file
@@ -0,0 +1,72 @@
|
||||
<?php
|
||||
if(!defined('IN_PLUGIN'))exit();
|
||||
$useragent = strtolower($_SERVER['HTTP_USER_AGENT']);
|
||||
if(strpos($useragent, 'iphone')!==false || strpos($useragent, 'ipod')!==false){
|
||||
$background_img = '/assets/img/ios.png';
|
||||
}else{
|
||||
$background_img = '/assets/img/android.png';
|
||||
}
|
||||
?><!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>支付提示</title>
|
||||
<meta name="apple-mobile-web-app-capable" content="yes"/>
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
|
||||
<meta name="format-detection" content="telephone=no"/>
|
||||
<meta name="format-detection" content="email=no"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0"/>
|
||||
<style>
|
||||
*,:after,:before{-webkit-tap-highlight-color:transparent}
|
||||
blockquote,body,dd,div,dl,dt,fieldset,form,h1,h2,h3,h4,h5,h6,input,legend,li,ol,p,td,textarea,th,ul{margin:0;padding:0}
|
||||
table{border-collapse:collapse;border-spacing:0}
|
||||
fieldset,img{border:0}
|
||||
li{list-style:none}
|
||||
caption,th{text-align:left}
|
||||
q:after,q:before{content:""}
|
||||
input:password{ime-mode:disabled}
|
||||
:focus{outline:0}
|
||||
body,html{-webkit-touch-callout:none;touch-callout:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;tap-highlight-color:transparent;height:100%;margin:0;padding:0;text-align:center;font-size:15px;font-weight:300;font-family:"Helvetica Neue",Helvetica,Arial,"Lucida Grande",sans-serif}
|
||||
a{text-decoration:none}
|
||||
body{background:#F4F4F8}
|
||||
.weixin-tip{-webkit-box-sizing:border-box;box-sizing:border-box;position:absolute;top:15px;right:20px;width:265px;padding:55px 0 0;text-align:left;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFoAAACICAMAAABQgAwUAAAAMFBMVEUAAADY2NjY2NjY2NjY2NjY2NjY2NjY2NjX19fY2NjY2NjY2NjY2NjY2NjY2NjY2Njr/TvvAAAAD3RSTlMAxy89c9CdTRyG7lvcD7FzqbJAAAACFklEQVR42uWYy4rkMBAErZdlPdzx/3+7LAw0tH0Y2orDsnnyKQlSVaWytoc6xrEpigFoinUAIBnWABAE5woW9o6GPbGwI1jYGSzsgoV9goU9wMLe0bA7FnYCC7uBhV2wsE+wsAdY2AENGyzsBBZ2Q8MuWNgH94pLbgELO6Bhg4VdwcJuaNgTCzuChZ3Bwg5o2GBhV7CwdzTsjoUdwcLOYGEXLOwTLOwBFvaOht2xsBNY2I1f6lhaenvhrfpkAblab+k9b/OD0iuX2F9/x8D+7ZL2pmpbuj+6o3Vg//oWmPU9p65VkXL6+oIJ8S738nwj62Pb1lvHACH+fBs7sG59U3yrVD3rce3GVcp8qGkPAGTprQUYy6xfaE8i82b6S7/pfZnzdYQIHeOXdfYKpHoFcmrvWlM8RW+CDO8JMWoNM/+FeyB4UfMpL48g5qG1Iqc29YI3mqq2knXvEJu2onJoQy9ok4mkQZf/GjqitUvQyqN6SU8NOvOhHq25xNCWj6LFQdLiyKuaZWpxBC2OrFVHxdryElbQsVtBx6KN0qAd4a71yo610uxa2b0s5xg052I5p26d4MCqusZFwzrAnqQhSogSMnkNcr+GUS3kEKWS62NJFlNCToWLZpWMe14RReGqdjz2PfNECbkGbrQ/Nj5q5y7j8/HRTW5UhvHfA7Mdzitji8rfWsgX3gVZ91eO22odKed6LLf9A/sRnc74RV7lAAAAAElFTkSuQmCC) no-repeat right top;background-size:45px 68px}
|
||||
.weixin-tip-img{padding:110px 0 0}
|
||||
.weixin-tip-img::after{display:block;margin:15px auto;content:' ';background-size:cover;width:150px;height:150px;background-image:url('<?php echo $background_img?>')}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="J-weixin-tip weixin-tip">
|
||||
<div class="weixin-tip-content">
|
||||
请在菜单中选择在浏览器中打开,<br/>
|
||||
以完成支付
|
||||
</div>
|
||||
</div>
|
||||
<div class="J-weixin-tip-img weixin-tip-img"></div>
|
||||
<script src="<?php echo $cdnpublic?>jquery/1.12.4/jquery.min.js"></script>
|
||||
<script src="<?php echo $cdnpublic?>layer/3.1.1/layer.js"></script>
|
||||
<script>
|
||||
function loadmsg() {
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
dataType: "json",
|
||||
url: "/getshop.php",
|
||||
data: {type: "alipay", trade_no: "<?php echo $order['trade_no']?>"},
|
||||
success: function (data) {
|
||||
if (data.code == 1) {
|
||||
layer.msg('支付成功,正在跳转中...', {icon: 16,shade: 0.1,time: 15000});
|
||||
setTimeout(window.location.href=data.backurl, 1000);
|
||||
}else{
|
||||
setTimeout("loadmsg()", 2000);
|
||||
}
|
||||
},
|
||||
error: function () {
|
||||
setTimeout("loadmsg()", 2000);
|
||||
}
|
||||
});
|
||||
}
|
||||
window.onload = function(){
|
||||
setTimeout("loadmsg()", 5000);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
109
doc/api/pages/wxpay_h5.php
Normal file
109
doc/api/pages/wxpay_h5.php
Normal file
@@ -0,0 +1,109 @@
|
||||
<?php
|
||||
// 微信H5支付页面
|
||||
|
||||
if (!defined('IN_PLUGIN'))
|
||||
exit();
|
||||
?>
|
||||
<html lang="zh-cn">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
|
||||
<meta name="renderer" content="webkit" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<title>微信支付手机版</title>
|
||||
<link href="<?php echo $cdnpublic ?>twitter-bootstrap/3.4.1/css/bootstrap.min.css" rel="stylesheet" />
|
||||
<link href="/assets/pay/css/mobile-style.css" rel="stylesheet" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="main">
|
||||
<div class="bg-weixin"></div>
|
||||
<div class="payment-logo">
|
||||
<img src="/assets/pay/icon/wxpay-white.svg" alt="logo">
|
||||
<span class="logo-tile">微信支付</span>
|
||||
</div>
|
||||
<div class="payment-content">
|
||||
<div class="content-info">
|
||||
<h1>¥<?php echo $order['realmoney'] ?></h1>
|
||||
<ul class="nk-activity">
|
||||
<li class="nk-activity-item">
|
||||
<span>商品名称:<?php echo $order['name'] ?></span>
|
||||
</li>
|
||||
<li class="nk-activity-item">
|
||||
<span>商户订单号:<?php echo $order['trade_no'] ?></span>
|
||||
</li>
|
||||
<li class="nk-activity-item">
|
||||
<span>创建时间:<?php echo $order['addtime'] ?></span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="content-footer">
|
||||
<a href="javascript:;" id="openUrl" class="btn btn-success btn-block btn-lg">跳转到微信支付</a>
|
||||
<a href="javascript:checkresult()" onclick="" class="btn btn-info btn-block btn-lg">检测支付状态</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="<?php echo $cdnpublic ?>jquery/1.12.4/jquery.min.js"></script>
|
||||
<script src="<?php echo $cdnpublic ?>layer/3.1.1/layer.js"></script>
|
||||
<script>
|
||||
var url_scheme = '<?php echo $code_url ?>';
|
||||
function loadmsg() {
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
dataType: "json",
|
||||
url: "/getshop.php",
|
||||
data: { type: "wxpay", trade_no: "<?php echo $order['trade_no'] ?>" },
|
||||
success: function (data) {
|
||||
if (data.code == 1) {
|
||||
layer.msg('支付成功,正在跳转中...', { icon: 16, shade: 0.01, time: 15000 });
|
||||
setTimeout(window.location.href = data.backurl, 1000);
|
||||
} else {
|
||||
setTimeout("loadmsg()", 2000);
|
||||
}
|
||||
},
|
||||
error: function () {
|
||||
setTimeout("loadmsg()", 2000);
|
||||
}
|
||||
});
|
||||
}
|
||||
function checkresult() {
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
dataType: "json",
|
||||
url: "/getshop.php",
|
||||
data: { type: "wxpay", trade_no: "<?php echo $order['trade_no'] ?>" },
|
||||
success: function (data) {
|
||||
if (data.code == 1) {
|
||||
layer.msg('支付成功,正在跳转中...', { icon: 16, shade: 0.01, time: 15000 });
|
||||
setTimeout(window.location.href = data.backurl, 1000);
|
||||
} else {
|
||||
layer.msg('您还未完成付款,请继续付款', { shade: 0, time: 1500 });
|
||||
}
|
||||
},
|
||||
error: function () {
|
||||
layer.msg('服务器错误');
|
||||
}
|
||||
});
|
||||
}
|
||||
window.onload = function () {
|
||||
window.onpopstate = function (e) {
|
||||
if (e.state == 'forward' || confirm('是否取消支付并返回?')) {
|
||||
window.history.back();
|
||||
} else {
|
||||
e.preventDefault();
|
||||
window.history.pushState('forward', null, '');
|
||||
}
|
||||
};
|
||||
window.history.pushState('forward', null, '');
|
||||
|
||||
document.getElementById("openUrl").href = url_scheme;
|
||||
if (!url_scheme.startsWith('http://') && !url_scheme.startsWith('https://') && navigator.userAgent.indexOf('EdgA/') == -1) {
|
||||
window.location.href = url_scheme;
|
||||
}
|
||||
setTimeout("loadmsg()", 3000);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
102
doc/api/pages/wxpay_jspay.php
Normal file
102
doc/api/pages/wxpay_jspay.php
Normal file
@@ -0,0 +1,102 @@
|
||||
<?php
|
||||
// 微信公众号支付页面
|
||||
|
||||
if(!defined('IN_PLUGIN'))exit();
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
|
||||
<title>微信支付手机版</title>
|
||||
<style>
|
||||
body{
|
||||
margin: 0px !important;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body style="background-color:#f6f6f6">
|
||||
<div style="display: flex;justify-content: center; padding-top: 20px;border-radius: 15px;height: 100px;text-align: center;align-items: center;">
|
||||
<span style="font-size: 15px;font-weight:800;color:#020202;"><?php echo $order['name']?><br>
|
||||
<div style="display: flex;justify-content: center;">
|
||||
<strong style="font-size: 22px;color: #000000;padding-top: 6px;margin-right: 3px;">¥</strong>
|
||||
<strong style="font-size: 40px;color: #000000;"><?php echo $order['realmoney']?></strong>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="background: #fff;padding: 16px;border-top: 1px solid #d8d8d8;border-bottom: 1px solid #d8d8d8;">
|
||||
<div style="display: flex;">
|
||||
<span style="font-weight: 400;color: #a1a1a1;width: 40px;">商家</span>
|
||||
<span style="flex:1;text-align: right;color: black;font-weight: 600;font-size: 14px;">微信支付平台商户</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="margin-top: 1px;border-radius: 1px;">
|
||||
<div style="display: flex; justify-content: center; padding-top: 20px;">
|
||||
<a class="immediate_pay" style="width:100%;max-width:600px;border-radius: 10px;margin: 0 4px;background: #05c160;padding: 12px 0px;text-align:center;color: #fff;" onclick="callpay()"><font size="4">立即支付</font></a>
|
||||
</div>
|
||||
|
||||
<div style="position: fixed;width: 100%;text-align: center;color: #a1a1a1;bottom: 17px;font-size: 12px;">
|
||||
支付安全由中国人民财产保险股份有限公司承保
|
||||
</div>
|
||||
<script src="<?php echo $cdnpublic?>jquery/1.12.4/jquery.min.js"></script>
|
||||
<script src="<?php echo $cdnpublic?>layer/3.1.1/layer.js"></script>
|
||||
<script>
|
||||
document.body.addEventListener('touchmove', function (event) {
|
||||
event.preventDefault();
|
||||
},{ passive: false });
|
||||
//调用微信JS api 支付
|
||||
function jsApiCall()
|
||||
{
|
||||
WeixinJSBridge.invoke(
|
||||
'getBrandWCPayRequest',
|
||||
<?php echo $jsApiParameters; ?>,
|
||||
function(res){
|
||||
if(res.err_msg == "get_brand_wcpay_request:ok" ) {
|
||||
loadmsg();
|
||||
}
|
||||
//WeixinJSBridge.log(res.err_msg);
|
||||
//alert(res.err_code+res.err_desc+res.err_msg);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
function callpay()
|
||||
{
|
||||
if (typeof WeixinJSBridge == "undefined"){
|
||||
if( document.addEventListener ){
|
||||
document.addEventListener('WeixinJSBridgeReady', jsApiCall, false);
|
||||
}else if (document.attachEvent){
|
||||
document.attachEvent('WeixinJSBridgeReady', jsApiCall);
|
||||
document.attachEvent('onWeixinJSBridgeReady', jsApiCall);
|
||||
}
|
||||
}else{
|
||||
jsApiCall();
|
||||
}
|
||||
}
|
||||
function loadmsg() {
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
dataType: "json",
|
||||
url: "/getshop.php",
|
||||
data: {type: "wxpay", trade_no: "<?php echo TRADE_NO?>"},
|
||||
success: function (data) {
|
||||
if (data.code == 1) {
|
||||
layer.msg('支付成功,正在跳转中...', {icon: 16,shade: 0.01,time: 15000});
|
||||
window.location.href=<?php echo $redirect_url?>;
|
||||
}else{
|
||||
setTimeout("loadmsg()", 2000);
|
||||
}
|
||||
},
|
||||
error: function () {
|
||||
setTimeout("loadmsg()", 2000);
|
||||
}
|
||||
});
|
||||
}
|
||||
window.onload = callpay();
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
137
doc/api/pages/wxpay_qrcode.php
Normal file
137
doc/api/pages/wxpay_qrcode.php
Normal file
@@ -0,0 +1,137 @@
|
||||
<?php
|
||||
// 微信扫码支付页面
|
||||
|
||||
if(!defined('IN_PLUGIN'))exit();
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<meta http-equiv="Content-Language" content="zh-cn">
|
||||
<meta name="renderer" content="webkit">
|
||||
<title>微信扫码支付</title>
|
||||
<link href="/assets/css/wechat_pay.css?v=2" rel="stylesheet" media="screen">
|
||||
</head>
|
||||
<body>
|
||||
<div class="body">
|
||||
<h1 class="mod-title">
|
||||
<span class="ico-wechat"></span><span class="text">微信扫码支付</span>
|
||||
</h1>
|
||||
<div class="mod-ct">
|
||||
<div class="order">
|
||||
</div>
|
||||
<div class="mobile-tip" style="display: none;">提示:二维码会风控,请复制下方链接支付</div>
|
||||
<div class="amount">¥<?php echo $order['realmoney']?></div>
|
||||
<div class="qr-image" id="qrcode">
|
||||
</div>
|
||||
<div class="mobile-btn" style="display: none;">
|
||||
<div class="mobile-tip">操作流程:复制链接→打开微信搜索自己微信名→打开聊天对话框→粘贴链接→发送→点击发送出来的蓝色链接→进入付款页面→完成付款</div>
|
||||
<a class="btn-copy-link" id="copy-btn" data-clipboard-text="<?php echo $code_url?>">点我复制链接</a>
|
||||
</div>
|
||||
<div class="detail" id="orderDetail">
|
||||
<dl class="detail-ct" style="display: none;">
|
||||
<dt>商家</dt>
|
||||
<dd id="storeName"><?php echo $sitename?></dd>
|
||||
<dt>购买物品</dt>
|
||||
<dd id="productName"><?php echo $order['name']?></dd>
|
||||
<dt>商户订单号</dt>
|
||||
<dd id="billId"><?php echo $order['trade_no']?></dd>
|
||||
<dt>创建时间</dt>
|
||||
<dd id="createTime"><?php echo $order['addtime']?></dd>
|
||||
</dl>
|
||||
<a href="javascript:void(0)" class="arrow"><i class="ico-arrow"></i></a>
|
||||
</div>
|
||||
<div class="tip">
|
||||
<span class="dec dec-left"></span>
|
||||
<span class="dec dec-right"></span>
|
||||
<div class="ico-scan"></div>
|
||||
<div class="tip-text">
|
||||
<p>请使用微信扫一扫</p>
|
||||
<p>扫描二维码完成支付</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tip-text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="foot">
|
||||
<div class="inner">
|
||||
<p>手机用户可保存上方二维码到手机中</p>
|
||||
<p>在微信扫一扫中选择“相册”即可</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="<?php echo $cdnpublic?>jquery/1.12.4/jquery.min.js"></script>
|
||||
<script src="<?php echo $cdnpublic?>layer/3.1.1/layer.js"></script>
|
||||
<script src="<?php echo $cdnpublic?>jquery.qrcode/1.0/jquery.qrcode.min.js"></script>
|
||||
<script src="<?php echo $cdnpublic?>clipboard.js/1.7.1/clipboard.min.js"></script>
|
||||
<script>
|
||||
var clipboard = new Clipboard('#copy-btn');
|
||||
clipboard.on('success', function(e) {
|
||||
layer.msg('复制成功,请到微信里面粘贴');
|
||||
});
|
||||
clipboard.on('error', function(e) {
|
||||
layer.msg('复制失败');
|
||||
});
|
||||
var code_url = '<?php echo $code_url?>';
|
||||
var code_type = code_url.indexOf('data:image/')>-1?1:0;
|
||||
if(code_type == 0){
|
||||
$('#qrcode').qrcode({
|
||||
text: code_url,
|
||||
width: 230,
|
||||
height: 230,
|
||||
foreground: "#000000",
|
||||
background: "#ffffff",
|
||||
typeNumber: -1
|
||||
});
|
||||
}else{
|
||||
$('#qrcode').html('<img src="'+code_url+'"/>');
|
||||
}
|
||||
// 订单详情
|
||||
$('#orderDetail .arrow').click(function (event) {
|
||||
if ($('#orderDetail').hasClass('detail-open')) {
|
||||
$('#orderDetail .detail-ct').slideUp(500, function () {
|
||||
$('#orderDetail').removeClass('detail-open');
|
||||
});
|
||||
} else {
|
||||
$('#orderDetail .detail-ct').slideDown(500, function () {
|
||||
$('#orderDetail').addClass('detail-open');
|
||||
});
|
||||
}
|
||||
});
|
||||
function loadmsg() {
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
dataType: "json",
|
||||
url: "/getshop.php",
|
||||
data: {type: "wxpay", trade_no: "<?php echo $order['trade_no']?>"},
|
||||
success: function (data) {
|
||||
if (data.code == 1) {
|
||||
layer.msg('支付成功,正在跳转中...', {icon: 16,shade: 0.1,time: 15000});
|
||||
window.location.href=data.backurl;
|
||||
}else{
|
||||
setTimeout("loadmsg()", 2000);
|
||||
}
|
||||
},
|
||||
error: function () {
|
||||
setTimeout("loadmsg()", 2000);
|
||||
}
|
||||
});
|
||||
}
|
||||
var isMobile = function (){
|
||||
var ua = navigator.userAgent;
|
||||
var ipad = ua.match(/(iPad).*OS\s([\d_]+)/),
|
||||
isIphone =!ipad && ua.match(/(iPhone\sOS)\s([\d_]+)/),
|
||||
isAndroid = ua.match(/(Android)\s+([\d.]+)/);
|
||||
return isIphone || isAndroid;
|
||||
}
|
||||
window.onload = function(){
|
||||
if(isMobile()){
|
||||
$('.mobile-btn').show();
|
||||
$('.mobile-tip').show();
|
||||
}
|
||||
setTimeout("loadmsg()", 2000);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
145
doc/api/pages/wxpay_wap.php
Normal file
145
doc/api/pages/wxpay_wap.php
Normal file
@@ -0,0 +1,145 @@
|
||||
<?php
|
||||
// 微信手机扫码支付页面
|
||||
|
||||
if (!defined('IN_PLUGIN'))
|
||||
exit();
|
||||
?>
|
||||
<html lang="zh-cn">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
|
||||
<meta name="renderer" content="webkit" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<title>微信支付手机版</title>
|
||||
<link href="<?php echo $cdnpublic ?>twitter-bootstrap/3.4.1/css/bootstrap.min.css" rel="stylesheet" />
|
||||
<link href="/assets/pay/css/mobile-style.css?v=7" rel="stylesheet" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="main">
|
||||
<div class="bg-weixin"></div>
|
||||
<div class="payment-logo payment-logo-wxwap">
|
||||
<img src="/assets/pay/icon/wxpay-white.svg" alt="logo">
|
||||
<span class="logo-tile">微信支付</span>
|
||||
</div>
|
||||
<div class="payment-content">
|
||||
<h1 style="margin-top: 8px;margin-bottom: 16px;">¥<?php echo $order['realmoney']; ?></h1>
|
||||
<div class="scan-the-code">
|
||||
<ul class="nav nav-group" role="tablist">
|
||||
<li class="active">
|
||||
<a href="JavaScript:;"><i class="icon-qrcode"></i>扫码支付</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="JavaScript:downloadCanvas();"><i class="icon-download"></i>保存二维码</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="list-group">
|
||||
<div class="list-group-item text-center">
|
||||
<h5 class="qr-title">请使用微信APP扫描二维码支付</h5>
|
||||
<div class="qr-image" id="qrcode"></div>
|
||||
<div class="operate">
|
||||
<a href="weixin://" class="btn btn-default">
|
||||
<span class="glyphicon glyphicon-new-window" aria-hidden="true"></span>
|
||||
<span>打开微信APP</span>
|
||||
</a>
|
||||
<a href="javascript:checkresult()" class="btn btn-default">
|
||||
<span class="glyphicon glyphicon-repeat" aria-hidden="true"></span>
|
||||
<span>检测支付状态</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="list-group-item">
|
||||
<span>二维码链接:<a href="<?php echo $code_url ?>"><?php echo $code_url ?></a></span>
|
||||
<span><button id="copy-btn" data-clipboard-text="<?php echo $code_url ?>" class="btn btn-info btn-sm">复制</button></span>
|
||||
</div>
|
||||
<div class="list-group-item">
|
||||
<small>提示:你可将以上二维码链接发到自己微信的聊天框(在微信顶部搜索框可以搜到自己的微信),点击即可进入支付!</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="<?php echo $cdnpublic ?>jquery/1.12.4/jquery.min.js"></script>
|
||||
<script src="<?php echo $cdnpublic ?>layer/3.1.1/layer.js"></script>
|
||||
<script src="<?php echo $cdnpublic ?>jquery.qrcode/1.0/jquery.qrcode.min.js"></script>
|
||||
<script src="<?php echo $cdnpublic ?>clipboard.js/1.7.1/clipboard.min.js"></script>
|
||||
<script>
|
||||
var clipboard = new Clipboard('#copy-btn');
|
||||
clipboard.on('success', function (e) {
|
||||
layer.msg('复制成功,请到微信里面粘贴');
|
||||
});
|
||||
clipboard.on('error', function (e) {
|
||||
layer.msg('复制失败,请长按链接后手动复制');
|
||||
});
|
||||
$('#qrcode').qrcode({
|
||||
text: "<?php echo $code_url ?>",
|
||||
width: 230,
|
||||
height: 230,
|
||||
foreground: "#000000",
|
||||
background: "#ffffff",
|
||||
typeNumber: -1
|
||||
});
|
||||
function downloadCanvas() {
|
||||
var canvas = document.getElementsByTagName('canvas')[0];
|
||||
var url = canvas.toDataURL('image/png');
|
||||
var a = document.createElement('a');
|
||||
var event = new MouseEvent('click');
|
||||
a.download = '微信支付二维码.png';
|
||||
a.href = url;
|
||||
a.dispatchEvent(event);
|
||||
};
|
||||
function loadmsg() {
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
dataType: "json",
|
||||
url: "/getshop.php",
|
||||
data: {type: "wxpay", trade_no: "<?php echo $order['trade_no'] ?>"},
|
||||
success: function (data) {
|
||||
if (data.code == 1) {
|
||||
layer.msg('支付成功,正在跳转中...', {icon: 16,shade: 0.1,time: 15000});
|
||||
setTimeout(window.location.href=data.backurl, 1000);
|
||||
}else{
|
||||
setTimeout("loadmsg()", 2000);
|
||||
}
|
||||
},
|
||||
error: function () {
|
||||
setTimeout("loadmsg()", 2000);
|
||||
}
|
||||
});
|
||||
}
|
||||
function checkresult() {
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
dataType: "json",
|
||||
url: "/getshop.php",
|
||||
data: { type: "wxpay", trade_no: "<?php echo $order['trade_no'] ?>" },
|
||||
success: function (data) {
|
||||
if (data.code == 1) {
|
||||
layer.msg('支付成功,正在跳转中...', { icon: 16, shade: 0.1, time: 15000 });
|
||||
setTimeout(window.location.href = data.backurl, 1000);
|
||||
} else {
|
||||
layer.msg('您还未完成付款,请继续付款', { shade: 0, time: 1500 });
|
||||
}
|
||||
},
|
||||
error: function () {
|
||||
layer.msg('服务器错误');
|
||||
}
|
||||
});
|
||||
}
|
||||
window.onload = function () {
|
||||
window.onpopstate = function (e) {
|
||||
if (e.state == 'forward' || confirm('是否取消支付并返回?')) {
|
||||
window.history.back();
|
||||
} else {
|
||||
e.preventDefault();
|
||||
window.history.pushState('forward', null, '');
|
||||
}
|
||||
};
|
||||
window.history.pushState('forward', null, '');
|
||||
setTimeout("loadmsg()", 3000);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user