<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=desvice-width, initial-scale=1.0">
<script type="text/javascript" charset="UTF-8"
src="https://wx.gtimg.com/pay_h5/goldplan/js/jgoldplan-1.0.0.js"></script>
<title>点金计划</title>
</head>
<body>
<div id="btnBack">点击返回</div>
</body>
<script type="text/javascript">
window.onload = function () {
var btnBack = document.getElementById("btnBack");
btnBack.onclick = function () {
let mchData = { action: 'jumpOut', jumpOutUrl: 'https://www.qq.com' }
let postData = JSON.stringify(mchData)
parent.postMessage(postData, 'https://payapp.weixin.qq.com')
}
let mchData2 ={action:'onIframeReady',displayStyle:'SHOW_CUSTOM_PAGE'};
let postData2= JSON.stringify(mchData2);
parent.postMessage(postData2,'https://payapp.weixin.qq.com')
}
</script>
</html>
调试时需确认以下事项:
1)已打开特约商户的商家小票及点金计划开关
2)商家小票页面需调用父页面“onIframeReady事件”的jsapi,具体请查看商家小票开发指引
3)从加载商家小票到调用JSAPI之间的用时不可超过3s
4)调试时,扫描二维码的微信号和支付该笔测试订单的微信号需为同一个
5)商家小票页面可正常访问
6)检查商家小票请求的Response Headers中X-Frame-Options是否允许payapp.weixin.qq.com访问