收藏
回答

获取不到商家小票订单信息?

<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')
   }



   /*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 个回答

  • 微信支付技术助手8
    微信支付技术助手8
    2020-11-16

    调试时需确认以下事项:

    1)已打开特约商户的商家小票及点金计划开关

    2)商家小票页面需调用父页面“onIframeReady事件”的jsapi,具体请查看商家小票开发指引

    3)从加载商家小票到调用JSAPI之间的用时不可超过3s

    4)调试时,扫描二维码的微信号和支付该笔测试订单的微信号需为同一个

    5)商家小票页面可正常访问

    6)检查商家小票请求的Response Headers中X-Frame-Options是否允许payapp.weixin.qq.com访问


    2020-11-16
    有用
    回复
登录 后发表内容
问题标签