点金计划 商家小票 一直无法显示,求助怎么解决?
后台设置:
响应Header
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Connection: keep-alive
Content-Encoding: gzip
Content-Language: zh-CN
Content-Type: text/html;charset=utf-8
Date: Thu, 15 Oct 2020 01:57:15 GMT
Expires: 0
Pragma: no-cache
Server: nginx/1.16.1
Transfer-Encoding: chunked
Vary: Accept-Encoding
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Frame-Options: ALLOW-FROM payapp.weixin.qq.com
X-XSS-Protection: 1; mode=block
页面代码:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>商家小票</title>
<style>
body {
color: #666666;
font-size: 32pt;
line-height: 45pt;
}
.title {
color: #333333;
font-size: 110pt;
line-height: 154pt;
}
.title2 {
color: #333333;
font-size: 36pt;
line-height: 50pt;
}
.error {
color:#F15451;
}
.center {
text-align: center;
}
.item{
display: flex;
justify-content: space-between;
}
</style>
<script type="text/javascript" charset="UTF-8" src="https://wx.gtimg.com/pay_h5/goldplan/js/jgoldplan-1.0.0.js"></script>
</head>
<body>
<div th:if="${error != null}" >
<span th:text="${error}" class="error"></span>
</div>
<div th:if="${order != null}">
<div class="center">取餐号</div>
<div th:text="${order.queueNo}" class="center title"></div>
<div class="item">
<label>桌号</label>
<div th:text="${order.tableNumber}"></div>
</div>
<div class="item">
<label>价格</label>
<div th:text="${1.0 * order.settlePrice/100}"></div>
</div>
</div>
<script type="text/javascript">
let data = JSON.stringify({
action:'onIframeReady',
displayStyle:'SHOW_CUSTOM_PAGE'
}) ;
parent.postMessage(data,'https://payapp.weixin.qq.com') ;
</script>
</body>
</html>
已解决!
原因是 nginx add_header 后有两个。
X-Frame-Options: SAMEORIGIN
X-Frame-Options: ALLOW-FROM https://payapp.weixin.qq.com
去掉 X-Frame-Options: SAMEORIGIN 就可以了。
商家小票时出现“无法获取订单信息”页面
请按照以下几点检查:
1,已打开特约商户的商家小票及点金计划开关
2,商家小票页面需调用父页面“onIframeReady事件”的jsapi,具体请查看商家小票开发指引
3,从加载商家小票到调用JSAPI之间的用时不可超过3s
4,调试时,扫描二维码的微信号和支付该笔测试订单的微信号需为同一个
5,确保访问的商家小票在调试手机的微信上能正常打开
6,检查商家小票请求的Response Headers中X-Frame-Options是否允许payapp.weixin.qq.com访问
7,如检查以上所有点任然无法解决,麻烦添加wepayTS8(备注)。并提供信息,单独拉群给您看一下具体问题。