小程序
小游戏
企业微信
微信支付
扫描小程序码分享
微信公众号上使用支付分支付订单,但是无法拉起支付分确认页面,是什么原因?
5 个回答
加粗
标红
插入代码
插入链接
插入图片
上传视频
请提供一下详细的错误信息内容
你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。
你这是让人猜谜语?
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×tamp=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 }
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 }
关注后,可在微信内接收相应的重要提醒。
请使用微信扫描二维码关注 “微信开放社区” 公众号
请提供一下详细的错误信息内容
你这是让人猜谜语?
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
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×tamp=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 }
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 }