视频一区二区三区自拍_千金肉奴隷1985未删减版在线观看_国产成人黄色视频在线播放_少女免费播放片高清在线观看_国产精品v欧美精品v

JSAPI調(diào)起支付分訂單詳情頁

更新時間:2024.09.19

商戶使用微信支付提供的JS調(diào)起微信支付分小程序,引導(dǎo)用戶查看訂單(公眾號端)

# 接口說明

支持商戶: 【普通商戶】

接口名稱: openBusinessView

提示

# 字段說明

# 接口參數(shù)

  • businessType 必填 string(16)
    固定配置:wxpayScoreDetail。
  • queryString 必填 string(2048)
    使用URL的query string方式傳遞參數(shù),格式為key=value&key2=value2,其中value,value2需要進(jìn)行UrlEncode處理。
    • 屬性

請求示例

1let wechatInfo = navigator.userAgent.match(/MicroMessenger\/([\d\.]+)/i);
2let wechatVersion = wechatInfo[1];
3?
4if (compareVersion(wechatVersion, '7.0.5') >= 0) {
5 goToWXScore();
6} else {
7 // 提示用戶升級微信客戶端版本
8 window.href = 'https://support.weixin.qq.com/cgi-bin/readtemplate?t=page/common_page__upgrade&
9 text=text005&btn_text=btn_text_0'
10}
11?
12/**
13 * 跳轉(zhuǎn)微信支付分
14 */
15function goToWXScore() {
16 wx.checkJsApi({
17 jsApiList: ['openBusinessView'], // 需要檢測的JS接口列表
18 success: function (res) {
19 // 以鍵值對的形式返回,可用的api值true,不可用為false
20 // 如:{"checkResult":{"openBusinessView":true},"errMsg":"checkJsApi:ok"}
21 if (res.checkResult.openBusinessView) {
22 wx.invoke(
23 'openBusinessView', {
24 businessType: 'wxpayScoreDetail',
25 queryString
26:'mch_id=1230000109&service_id=88888888000011&out_order_no=1234323JKHDFE1243252&timestamp=1530097563&nonce_str=zyx53Nkey8o4bHpxTQvd8m7e92nG5mG2&sign_type=HMAC-SHA256&sign=029B52F67573D7E3BE74904BF9AEA'
27 },
28
29 function (res) {
30 // 從支付分返回時會執(zhí)行這個回調(diào)函數(shù)
31 if (parseint(res.err_code) === 0) {
32 // 返回成功
33 } else {
34 // 返回失敗
35 }
36 });
37 }
38 }
39 });
40 }
41?
42 /**
43 * 版本號比較
44 * @param {string
45} v1
46 * @param {string
47} v2
48 */
49function compareVersion(v1, v2) {
50 v1 = v1.split('.')
51 v2 = v2.split('.')
52 const len = Math.max(v1.length, v2.length)
53
54 while (v1.length < len) {
55 v1.push('0')
56 }
57 while (v2.length < len) {
58 v2.push('0')
59 }
60
61 for (let i = 0; i < len; i++) {
62 const num1 = parseint(v1[i])
63 const num2 = parseint(v2[i])
64
65 if (num1 > num2) {
66 return 1
67 } else if (num1 < num2) {
68 return -1
69 }
70 }
71
72 return 0
73 }

# 返回參數(shù)

更多技術(shù)問題
技術(shù)咨詢
反饋
咨詢
目錄