小程序
小游戏
企业微信
微信支付
扫描小程序码分享
一直无法获取订单信息,求解决~~~
4 个回答
加粗
标红
插入代码
插入链接
插入图片
上传视频
回调地址必须是https
你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<script type="text/javascript" charset="UTF-8" src="https://wx.gtimg.com/pay_h5/goldplan/js/jgoldplan-1.0.0.js"></script>
<title>点金计划</title>
<base href="<%=basePath%>">
<title>My JSP 'MyJsp.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<body>
点金计划. <br>
</body>
<script type="text/javascript">
window.onload = function () {
let mchData2 ={action:'onIframeReady',displayStyle:'SHOW_CUSTOM_PAGE'};
let postData2= JSON.stringify(mchData2);
parent.postMessage(postData2,'https://payapp.weixin.qq.com')
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')
}
/*var btnBack = document.getElementById("btnBack");
let mchData = { action: 'jumpOut', jumpOutUrl: 'https://www.qq.com' }
let postData = JSON.stringify(mchData)
function myfun(){
let mchData ={action:'onIframeReady',displayStyle:'SHOW_CUSTOM_PAGE'};
let postData = JSON. stringify(mchData);
window.parent.postMessage(postData,'https://payapp.weixin.qq.com')
window.onload = myfun;
*/
</script>
</html>
调试时需确认以下事项:
1)已打开特约商户的商家小票及点金计划开关
2)商家小票页面需调用父页面“onIframeReady事件”的jsapi,具体请查看商家小票开发指引
3)从加载商家小票到调用JSAPI之间的用时不可超过3s
4)调试时,扫描二维码的微信号和支付该笔测试订单的微信号需为同一个
5)商家小票页面可正常访问
6)检查商家小票请求的Response Headers中X-Frame-Options是否允许payapp.weixin.qq.com访问
一直显示不出来 一般是因为代码报错导致的
关注后,可在微信内接收相应的重要提醒。
请使用微信扫描二维码关注 “微信开放社区” 公众号
回调地址必须是https
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<script type="text/javascript" charset="UTF-8" src="https://wx.gtimg.com/pay_h5/goldplan/js/jgoldplan-1.0.0.js"></script>
<title>点金计划</title>
<base href="<%=basePath%>">
<title>My JSP 'MyJsp.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<body>
点金计划. <br>
</body>
<script type="text/javascript">
window.onload = function () {
let mchData2 ={action:'onIframeReady',displayStyle:'SHOW_CUSTOM_PAGE'};
let postData2= JSON.stringify(mchData2);
parent.postMessage(postData2,'https://payapp.weixin.qq.com')
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')
}
}
/*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')
}
function myfun(){
let mchData ={action:'onIframeReady',displayStyle:'SHOW_CUSTOM_PAGE'};
let postData = JSON. stringify(mchData);
window.parent.postMessage(postData,'https://payapp.weixin.qq.com')
}
window.onload = myfun;
*/
</script>
</html>
调试时需确认以下事项:
1)已打开特约商户的商家小票及点金计划开关
2)商家小票页面需调用父页面“onIframeReady事件”的jsapi,具体请查看商家小票开发指引
3)从加载商家小票到调用JSAPI之间的用时不可超过3s
4)调试时,扫描二维码的微信号和支付该笔测试订单的微信号需为同一个
5)商家小票页面可正常访问
6)检查商家小票请求的Response Headers中X-Frame-Options是否允许payapp.weixin.qq.com访问
方法一:
nginx add_header 后有两个:
X-Frame-Options: SAMEORIGIN
X-Frame-Options: ALLOW-FROM https://payapp.weixin.qq.com
去掉 X-Frame-Options: SAMEORIGIN 就可以了。
方法二:
直接设置微信支付的域名 https://payapp.weixin.qq.com
一直显示不出来 一般是因为代码报错导致的