收藏
回答

无法拉起微信支付分确认

微信公众号上使用支付分支付订单,但是无法拉起支付分确认页面,是什么原因?

回答关注问题邀请回答
收藏

5 个回答

  • 支付社区运营
    支付社区运营
    2024-12-09

    请提供一下详细的错误信息内容

    2024-12-09
    有用
    回复
  • Memory (私信不回复)
    Memory (私信不回复)
    2024-12-06

    你这是让人猜谜语?

    2024-12-06
    有用
    回复
  • 北望沣渭
    北望沣渭
    2024-12-06

    https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter6_1_12.shtml

    简介

    接口名称: openBusinessView

    接口兼容:

    此接口引用 JSAPI版本1.5.0,引用地址:https://res.wx.qq.com/open/js/jweixin-1.5.0.js

    要求用户微信版本>=7.0.5

    2024-12-06
    有用
    回复
  • 北望沣渭
    北望沣渭
    2024-12-06

    https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter6_1_12.shtml

    简介

    接口名称: openBusinessView

    接口兼容:

    此接口引用 JSAPI版本1.5.0,引用地址:https://res.wx.qq.com/open/js/jweixin-1.5.0.js

    要求用户微信版本>=7.0.5

    示例代码

    let wechatInfo = navigator.userAgent.match(/MicroMessenger\/([\d\.]+)/i);
    let wechatVersion = wechatInfo[1];
    ​
    if (compareVersion(wechatVersion, '7.0.5') >= 0) {
       goToWXScore();
    } else {
       // 提示用户升级微信客户端版本
       window.href = 'https://support.weixin.qq.com/cgi-bin/readtemplate?t=page/common_page__upgrade&
       text=text005&btn_text=btn_text_0'
    }
    ​
    /**
     * 跳转微信支付分
     */
    function goToWXScore() {
        wx.checkJsApi({
            jsApiList: ['openBusinessView'], // 需要检测的JS接口列表
            success: function (res) {
            // 以键值对的形式返回,可用的api值true,不可用为false
            // 如:{"checkResult":{"openBusinessView":true},"errMsg":"checkJsApi:ok"}
            if (res.checkResult.openBusinessView) {
                wx.invoke(
                    'openBusinessView', {
                        businessType: 'wxpayScoreUse',
                        queryString
    : 'mch_id=1230000109&package=xxxxx&timestamp=1530097563&nonce_str=zyx53Nkey8o4bHpxTQvd8m7e92nG5mG2&sign_type=HMAC-SHA256&sign=029B52F67573D7E3BE74904BF9AEA'
                    },
                    function (res) {
                    // 从支付分返回时会执行这个回调函数
                        if (parseint(res.err_code) === 0) {
                        // 返回成功 
                        } else {
                        // 返回失败
                        }
                    });
                }
            }
        });
     }
    ​
     /**
      * 版本号比较
      * @param {string
    } v1 
      * @param {string
    } v2 
      */
    function compareVersion(v1, v2) {
        v1 = v1.split('.')
        v2 = v2.split('.')
        const len = Math.max(v1.length, v2.length)
      
        while (v1.length < len) {
          v1.push('0')
        }
        while (v2.length < len) {
          v2.push('0')
        }
      
        for (let i = 0; i < len; i++) {
          const num1 = parseint(v1[i])
          const num2 = parseint(v2[i])
      
          if (num1 > num2) {
            return 1
          } else if (num1 < num2) {
            return -1
          }
        }
      
        return 0
     }
    


    2024-12-06
    有用
    回复
  • 北望沣渭
    北望沣渭
    2024-12-06

    https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter6_1_12.shtml

    简介

    接口名称: openBusinessView

    接口兼容:

    此接口引用 JSAPI版本1.5.0,引用地址:https://res.wx.qq.com/open/js/jweixin-1.5.0.js

    要求用户微信版本>=7.0.5

    示例代码

    let wechatInfo = navigator.userAgent.match(/MicroMessenger\/([\d\.]+)/i);
    let wechatVersion = wechatInfo[1];
    ​
    if (compareVersion(wechatVersion, '7.0.5') >= 0) {
       goToWXScore();
    } else {
       // 提示用户升级微信客户端版本
       window.href = 'https://support.weixin.qq.com/cgi-bin/readtemplate?t=page/common_page__upgrade&
       text=text005&btn_text=btn_text_0'
    }
    ​
    /**
     * 跳转微信支付分
     */
    function goToWXScore() {
        wx.checkJsApi({
            jsApiList: ['openBusinessView'], // 需要检测的JS接口列表
            success: function (res) {
            // 以键值对的形式返回,可用的api值true,不可用为false
            // 如:{"checkResult":{"openBusinessView":true},"errMsg":"checkJsApi:ok"}
            if (res.checkResult.openBusinessView) {
                wx.invoke(
                    'openBusinessView', {
                        businessType: 'wxpayScoreUse',
                        queryString
    : 'mch_id=1230000109&package=xxxxx&
    			timestamp=1530097563&nonce_str=zyx53Nkey8o4bHpxTQvd8m7e92nG5mG2&sign_type=HMAC-SHA256&
    			sign=029B52F67573D7E3BE74904BF9AEA'
                    },
                    function (res) {
                    // 从支付分返回时会执行这个回调函数
                        if (parseint(res.err_code) === 0) {
                        // 返回成功 
                        } else {
                        // 返回失败
                        }
                    });
                }
            }
        });
     }
    ​
     /**
      * 版本号比较
      * @param {string
    } v1 
      * @param {string
    } v2 
      */
    function compareVersion(v1, v2) {
        v1 = v1.split('.')
        v2 = v2.split('.')
        const len = Math.max(v1.length, v2.length)
      
        while (v1.length < len) {
          v1.push('0')
        }
        while (v2.length < len) {
          v2.push('0')
        }
      
        for (let i = 0; i < len; i++) {
          const num1 = parseint(v1[i])
          const num2 = parseint(v2[i])
      
          if (num1 > num2) {
            return 1
          } else if (num1 < num2) {
            return -1
          }
        }
      
        return 0
     }
    


    2024-12-06
    有用
    回复
登录 后发表内容