JSAPI调起支付分-订单详情

更新时间:2025.04.01

商户通过调用订单详情接口打开微信支付分小程序,引导用户查看订单详情(Web端)


1. 接口说明

适用对象:机构模式

接口名称:openBusinessView

2. 接口兼容

3. 接口参数

Object

参数名

变量

类型[长度限制]

必填

描述

跳转类型

businessType

string[1, 16]

固定配置:wxpayScoreDetail
示例值:wxpayScoreDetail

业务参数

queryString

string[1, 2048]

使用URL的query string方式传递参数,格式为key=value&key2=value2,其中value,value2需要进行UrlEncode处理,详细说明见下文

业务参数

要打开的小程序版本

envVersion

string[1,128]

仅在当前小程序为开发版或体验版时此参数有效。如果当前小程序是正式版,则打开的小程序必定是正式版。
取值:
release:正式版;
trial:体验版;
develop:开发版
示例值:release

4. queryString示例

机构模式
1mch_id=1230000109&service_id=88888888000011&out_order_no=1234323JKHDFE1243252&
2timestamp=1530097563&nonce_str=zyx53Nkey8o4bHpxTQvd8m7e92nG5mG2&sign_type=HMAC-SHA256&sign=029B52F67573D7E3BE74904BF9AEA

5. 返回参数

无返回数据(HTTP状态码为204)

6. 返回示例

1204 No Content
2
3无返回数据

7. 代码示例

1wx.checkJsApi({
2    jsApiList: ['openBusinessView'], // 需要检测的JS接口列表
3    success: function(res) {
4         // 以键值对的形式返回,可用的api值true,不可用为false
5        // 如:{"checkResult":{"openBusinessView":true},"errMsg":"checkJsApi:ok"}
6        if (res.checkResult.openBusinessView) {
7            wx.invoke('openBusinessView', {
8                businessType: 'wxpayScoreDetail'
9                queryString: 'mch_id=1230000109&service_id=88888888000011&out_order_no=1234323JKHDFE1243252×tamp=1530097563&nonce_str=zyx53Nkey8o4bHpxTQvd8m7e92nG5mG2&sign_type=HMAC-SHA256&sign=029B52F67573D7E3BE74904BF9AEA'
10            }, function (res) {
11                // 从微信侧小程序返回时会执行这个回调函数
12                if (parseint(res.err_code) === 0) {
13                    // 返回成功 
14                } else {
15                    // 返回失败
16                }
17            })
18        } else {
19            // 提示用户升级微信客户端版本
20            window.href = 'https://support.weixin.qq.com/cgi-bin/readtemplate?t=page/common_page__upgrade&text=text005&btn_text=btn_text_0'
21        }
22    }
23});

 

 

About  WeChat  Pay

Powered By Tencent & Tenpay Copyright©

2005-2025 Tenpay All Rights Reserved.

Contact Us
Wechat Pay Global

WeChat Pay Global

Contact Us

Customer Service Tel

+86 571 95017

9:00-18:00 Monday-Friday GMT+8

Business Development

wxpayglobal@tencent.com

Developer Support

wepayTS@tencent.com

Wechat Pay Global

About Tenpay
Powered By Tencent & Tenpay Copyright© 2005-2025 Tenpay All Rights Reserved.