@dcloudio/uni-app-x 0.7.38 → 0.7.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. package/package.json +1 -1
  2. package/types/UniPage.d.ts +4 -0
  3. package/types/native/CanvasRenderingContext2D.d.ts +1 -1
  4. package/types/native/IUniElement.d.ts +105 -44
  5. package/types/native/global.d.ts +14 -8
  6. package/types/page.d.ts +45 -3
  7. package/types/uni/env/index.d.ts +81 -81
  8. package/types/uni/uni-map-tencent-map.d.ts +7 -7
  9. package/types/uni/uts-plugin-api/global.d.ts +0 -2
  10. package/types/uni/uts-plugin-api/index.d.ts +0 -2
  11. package/types/uni/uts-plugin-api/lib/uni-addPhoneContact/utssdk/interface.d.ts +1 -1
  12. package/types/uni/uts-plugin-api/lib/uni-arrayBufferToBase64/utssdk/interface.d.ts +73 -73
  13. package/types/uni/uts-plugin-api/lib/uni-authentication/utssdk/interface.d.ts +331 -331
  14. package/types/uni/uts-plugin-api/lib/uni-base64ToArrayBuffer/utssdk/interface.d.ts +73 -73
  15. package/types/uni/uts-plugin-api/lib/uni-canvas/utssdk/interface.d.ts +628 -628
  16. package/types/uni/uts-plugin-api/lib/uni-chooseLocation/utssdk/interface.d.ts +414 -153
  17. package/types/uni/uts-plugin-api/lib/uni-clipboard/utssdk/interface.d.ts +2 -2
  18. package/types/uni/uts-plugin-api/lib/uni-createInnerAudioContext/utssdk/interface.d.ts +1218 -1987
  19. package/types/uni/uts-plugin-api/lib/uni-createIntersectionObserver/utssdk/interface.d.ts +1 -1
  20. package/types/uni/uts-plugin-api/lib/uni-createSelectorQuery/utssdk/interface.d.ts +6 -6
  21. package/types/uni/uts-plugin-api/lib/uni-dialogPage/utssdk/interface.d.ts +156 -81
  22. package/types/uni/uts-plugin-api/lib/uni-event/utssdk/interface.d.ts +315 -315
  23. package/types/uni/uts-plugin-api/lib/uni-file/utssdk/interface.d.ts +5 -5
  24. package/types/uni/uts-plugin-api/lib/uni-fileSystemManager/utssdk/interface.d.ts +2530 -2126
  25. package/types/uni/uts-plugin-api/lib/uni-getAppAuthorizeSetting/utssdk/interface.d.ts +490 -490
  26. package/types/uni/uts-plugin-api/lib/uni-getAppBaseInfo/utssdk/interface.d.ts +2138 -2005
  27. package/types/uni/uts-plugin-api/lib/uni-getBackgroundAudioManager/utssdk/global.d.ts +4 -0
  28. package/types/uni/uts-plugin-api/lib/uni-getBackgroundAudioManager/utssdk/index.d.ts +2 -0
  29. package/types/uni/uts-plugin-api/lib/uni-getBackgroundAudioManager/utssdk/interface.d.ts +663 -113
  30. package/types/uni/uts-plugin-api/lib/uni-getDeviceInfo/utssdk/interface.d.ts +20 -20
  31. package/types/uni/uts-plugin-api/lib/uni-getElementById/utssdk/interface.d.ts +3 -3
  32. package/types/uni/uts-plugin-api/lib/uni-getEnterOptionsSync/utssdk/interface.d.ts +217 -217
  33. package/types/uni/uts-plugin-api/lib/uni-getLaunchOptionsSync/utssdk/interface.d.ts +2 -2
  34. package/types/uni/uts-plugin-api/lib/uni-getLocation/utssdk/interface.d.ts +809 -809
  35. package/types/uni/uts-plugin-api/lib/uni-getNetworkType/utssdk/interface.d.ts +274 -274
  36. package/types/uni/uts-plugin-api/lib/uni-getPerformance/utssdk/interface.d.ts +1 -1
  37. package/types/uni/uts-plugin-api/lib/uni-getRecorderManager/utssdk/interface.d.ts +969 -969
  38. package/types/uni/uts-plugin-api/lib/uni-getSystemInfo/utssdk/interface.d.ts +106 -106
  39. package/types/uni/uts-plugin-api/lib/uni-getSystemSetting/utssdk/interface.d.ts +23 -23
  40. package/types/uni/uts-plugin-api/lib/uni-interceptor/utssdk/interface.d.ts +2 -2
  41. package/types/uni/uts-plugin-api/lib/uni-keyboard/utssdk/interface.d.ts +1 -1
  42. package/types/uni/uts-plugin-api/lib/uni-loadFontFace/utssdk/interface.d.ts +41 -41
  43. package/types/uni/uts-plugin-api/lib/uni-makePhoneCall/utssdk/interface.d.ts +88 -88
  44. package/types/uni/uts-plugin-api/lib/uni-media/utssdk/interface.d.ts +1680 -1528
  45. package/types/uni/uts-plugin-api/lib/uni-navigationBar/utssdk/interface.d.ts +16 -16
  46. package/types/uni/uts-plugin-api/lib/uni-network/utssdk/interface.d.ts +3620 -3618
  47. package/types/uni/uts-plugin-api/lib/uni-oauth/utssdk/interface.d.ts +12 -12
  48. package/types/uni/uts-plugin-api/lib/uni-openDocument/utssdk/interface.d.ts +1 -1
  49. package/types/uni/uts-plugin-api/lib/uni-pageScrollTo/utssdk/interface.d.ts +3 -3
  50. package/types/uni/uts-plugin-api/lib/uni-payment/utssdk/interface.d.ts +621 -621
  51. package/types/uni/uts-plugin-api/lib/uni-privacy/utssdk/interface.d.ts +22 -22
  52. package/types/uni/uts-plugin-api/lib/uni-prompt/utssdk/interface.d.ts +2602 -2391
  53. package/types/uni/uts-plugin-api/lib/uni-pullDownRefresh/utssdk/interface.d.ts +2 -2
  54. package/types/uni/uts-plugin-api/lib/uni-route/utssdk/interface.d.ts +26 -26
  55. package/types/uni/uts-plugin-api/lib/uni-rpx2px/utssdk/interface.d.ts +77 -77
  56. package/types/uni/uts-plugin-api/lib/uni-scanCode/utssdk/interface.d.ts +1 -1
  57. package/types/uni/uts-plugin-api/lib/uni-storage/utssdk/interface.d.ts +857 -857
  58. package/types/uni/uts-plugin-api/lib/uni-tabBar/utssdk/interface.d.ts +17 -17
  59. package/types/uni/uts-plugin-api/lib/uni-theme/utssdk/global.d.ts +8 -0
  60. package/types/uni/uts-plugin-api/lib/uni-theme/utssdk/index.d.ts +4 -0
  61. package/types/uni/uts-plugin-api/lib/uni-theme/utssdk/interface.d.ts +1057 -516
  62. package/types/uni/uts-plugin-api/lib/uni-virtualPayment/utssdk/interface.d.ts +1660 -1660
  63. package/types/uni/uts-plugin-api/lib/uni-websocket/utssdk/interface.d.ts +1746 -1746
  64. package/types/uni/uts-plugin-biz/global.d.ts +1 -0
  65. package/types/uni/uts-plugin-biz/index.d.ts +1 -0
  66. package/types/uni/uts-plugin-biz/lib/uni-ad/utssdk/interface.d.ts +84 -0
  67. package/types/uni/{uts-plugin-api → uts-plugin-biz}/lib/uni-crash/utssdk/interface.d.ts +46 -46
  68. package/types/uni/uts-plugin-biz/lib/uni-map-tencent/utssdk/interface.d.ts +72 -20
  69. package/types/uni/uts-plugin-biz/lib/uni-push/utssdk/interface.d.ts +126 -0
  70. package/types/uni/uts-plugin-biz/lib/uni-verify/utssdk/global.d.ts +2 -0
  71. package/types/uni/uts-plugin-biz/lib/uni-verify/utssdk/index.d.ts +1 -0
  72. package/types/uni/uts-plugin-biz/lib/uni-verify/utssdk/interface.d.ts +63 -12
  73. package/types/uni/uts-plugin-component/lib/uni-video/utssdk/interface.d.ts +308 -308
  74. package/types/uni/uts-plugin-extend/global.d.ts +1 -0
  75. package/types/uni/uts-plugin-extend/lib/uni-__f__/utssdk/global.d.ts +7 -0
  76. package/types/uni/uts-plugin-extend/lib/uni-__f__/utssdk/index.d.ts +0 -0
  77. package/types/uni/uts-plugin-extend/lib/uni-__f__/utssdk/interface.d.ts +3 -0
  78. package/types/uni/uts-plugin-extend/lib/uni-accelerometer/utssdk/interface.d.ts +4 -4
  79. package/types/uni/uts-plugin-extend/lib/uni-canvas/utssdk/interface.d.ts +5 -5
  80. package/types/uni/uts-plugin-extend/lib/uni-compass/utssdk/interface.d.ts +1 -1
  81. package/types/uni/uts-plugin-extend/lib/uni-createMediaQueryObserver/utssdk/interface.d.ts +77 -77
  82. package/types/uni/uts-plugin-extend/lib/uni-getBackgroundAudioManager/utssdk/interface.d.ts +11 -11
  83. package/types/uni/uts-plugin-extend/lib/uni-locale/utssdk/interface.d.ts +3 -3
  84. package/types/uni/uts-plugin-extend/lib/uni-localeChange/utssdk/interface.d.ts +6 -6
  85. package/types/uni/uts-plugin-extend/lib/uni-memory/utssdk/interface.d.ts +2 -2
  86. package/types/uni/uts-plugin-extend/lib/uni-openLocation/utssdk/interface.d.ts +1 -1
  87. package/types/uni-cloud/interface.d.ts +13 -13
  88. package/types/uni/uts-plugin-api/lib/uni-actionSheet/utssdk/global.d.ts +0 -24
  89. package/types/uni/uts-plugin-api/lib/uni-actionSheet/utssdk/index.d.ts +0 -11
  90. package/types/uni/uts-plugin-api/lib/uni-actionSheet/utssdk/interface.d.ts +0 -217
  91. package/types/uni/uts-plugin-extend/lib/uni-chooseLocation/utssdk/global.d.ts +0 -21
  92. package/types/uni/uts-plugin-extend/lib/uni-chooseLocation/utssdk/index.d.ts +0 -9
  93. package/types/uni/uts-plugin-extend/lib/uni-chooseLocation/utssdk/interface.d.ts +0 -151
  94. package/types/uni/uts-plugin-extend/lib/uni-createInnerAudioContext/utssdk/global.d.ts +0 -11
  95. package/types/uni/uts-plugin-extend/lib/uni-createInnerAudioContext/utssdk/index.d.ts +0 -4
  96. package/types/uni/uts-plugin-extend/lib/uni-createInnerAudioContext/utssdk/interface.d.ts +0 -224
  97. package/types/uni/uts-plugin-extend/lib/uni-createMapContext/utssdk/global.d.ts +0 -53
  98. package/types/uni/uts-plugin-extend/lib/uni-createMapContext/utssdk/index.d.ts +0 -25
  99. package/types/uni/uts-plugin-extend/lib/uni-createMapContext/utssdk/interface.d.ts +0 -487
  100. package/types/uni/uts-plugin-extend/lib/uni-theme/utssdk/global.d.ts +0 -9
  101. package/types/uni/uts-plugin-extend/lib/uni-theme/utssdk/index.d.ts +0 -1
  102. package/types/uni/uts-plugin-extend/lib/uni-theme/utssdk/interface.d.ts +0 -165
  103. /package/types/uni/{uts-plugin-api → uts-plugin-biz}/lib/uni-crash/utssdk/global.d.ts +0 -0
  104. /package/types/uni/{uts-plugin-api → uts-plugin-biz}/lib/uni-crash/utssdk/index.d.ts +0 -0
@@ -1,1660 +1,1660 @@
1
- import { RequestVirtualPaymentFailImpl as RequestVirtualPaymentFailImplement } from './unierror.uts'
2
-
3
- export type RequestVirtualPaymentFailImpl = RequestVirtualPaymentFailImplement
4
- export interface Uni {
5
- /**
6
- * @description 请求支付
7
- * @param {RequestVirtualPaymentOptions} options
8
- * @example
9
- * ```typescript
10
- * uni.requestVirtualPayment({
11
- * provider: "alipay",
12
- * orderInfo: "",
13
- * success: function (res) {
14
- * console.log("支付成功"+JSON.stringify(res))
15
- * }
16
- * });
17
- * ```
18
- * @tutorial-uni-app-x https://doc.dcloud.net.cn/uni-app-x/api/virtual-payment.html#requestvirtualpayment
19
- * @tutorial https://doc.dcloud.net.cn/uni-app-x/api/virtual-payment.html#requestvirtualpayment
20
- * @uniPlatform {
21
- * "app": {
22
- * "android": {
23
- * "osVer": "5.0",
24
- * "uniVer": "x",
25
- * "unixVer": "x"
26
- * },
27
- * "ios": {
28
- * "osVer": "15.0",
29
- * "uniVer": "√",
30
- * "unixVer": "4.25"
31
- * }
32
- * },
33
- * "mp": {
34
- * "weixin": {
35
- * "hostVer": "√",
36
- * "uniVer": "√",
37
- * "unixVer": "4.35"
38
- * },
39
- * "alipay": {
40
- * "hostVer": "√",
41
- * "uniVer": "x",
42
- * "unixVer": "x"
43
- * },
44
- * "baidu": {
45
- * "hostVer": "√",
46
- * "uniVer": "x",
47
- * "unixVer": "x"
48
- * },
49
- * "toutiao": {
50
- * "hostVer": "√",
51
- * "uniVer": "x",
52
- * "unixVer": "x"
53
- * },
54
- * "lark": {
55
- * "hostVer": "√",
56
- * "uniVer": "x",
57
- * "unixVer": "x"
58
- * },
59
- * "qq": {
60
- * "hostVer": "√",
61
- * "uniVer": "x",
62
- * "unixVer": "x"
63
- * },
64
- * "kuaishou": {
65
- * "hostVer": "√",
66
- * "uniVer": "x",
67
- * "unixVer": "x"
68
- * },
69
- * "jd": {
70
- * "hostVer": "√",
71
- * "uniVer": "x",
72
- * "unixVer": "x"
73
- * }
74
- * },
75
- * "web": {
76
- * "uniVer": "x",
77
- * "unixVer": "x"
78
- * }
79
- * }
80
- */
81
- requestVirtualPayment(options : RequestVirtualPaymentOptions) : void;
82
-
83
- /**
84
- * @description 获取各平台虚拟支付的管理类,用于操作各平台专有的API。
85
- * @tutorial-uni-app-x https://doc.dcloud.net.cn/uni-app-x/api/virtual-payment.html#getvirtualpaymentmanager
86
- * @tutorial https://doc.dcloud.net.cn/uni-app-x/api/virtual-payment.html#getvirtualpaymentmanager
87
- * @uniPlatform {
88
- * "app": {
89
- * "android": {
90
- * "osVer": "5.0",
91
- * "uniVer": "x",
92
- * "unixVer": "x"
93
- * },
94
- * "ios": {
95
- * "osVer": "15.0",
96
- * "uniVer": "√",
97
- * "unixVer": "4.25"
98
- * },
99
- * "harmony": {
100
- * "osVer": "x",
101
- * "uniVer": "x",
102
- * "unixVer": "x"
103
- * }
104
- * },
105
- * "web": {
106
- * "uniVer": "x",
107
- * "unixVer": "x"
108
- * }
109
- * }
110
- * @return {VirtualPaymentManager} virtual-payment的管理类
111
- */
112
- getVirtualPaymentManager() : GetVirtualPaymentManager;
113
- }
114
-
115
- export type GetVirtualPaymentManager = () => VirtualPaymentManager;
116
-
117
- export interface VirtualPaymentManager {
118
- /**
119
- * @description 恢复苹果服务器已支付的交易列表
120
- * @param {AppleIAPRestoreOptions} options
121
- * @example
122
- * ```typescript
123
- * restoreTransactions({
124
- * success: function (res) {
125
- * console.log("恢复成功"+JSON.stringify(res))
126
- * }
127
- * });
128
- * ```
129
- * @tutorial-uni-app-x https://doc.dcloud.net.cn/uni-app-x/api/virtual-payment.html#restoretransactions
130
- * @tutorial https://doc.dcloud.net.cn/uni-app-x/api/virtual-payment.html#restoretransactions
131
- * @uniPlatform {
132
- * "app": {
133
- * "android": {
134
- * "osVer": "5.0",
135
- * "uniVer": "x",
136
- * "unixVer": "x"
137
- * },
138
- * "ios": {
139
- * "osVer": "15.0",
140
- * "uniVer": "√",
141
- * "unixVer": "4.25"
142
- * }
143
- * },
144
- * "web": {
145
- * "uniVer": "x",
146
- * "unixVer": "x"
147
- * }
148
- * }
149
- */
150
- restoreTransactions(options : AppleIAPRestoreOptions) : void;
151
-
152
- /**
153
- * @description 获取苹果服务器已支付且未关闭的交易列表
154
- * @param {AppleIAPUnfinishedTransactionOptions} options
155
- * @example
156
- * ```typescript
157
- * getUnfinishedTransactions({
158
- * success: function (res) {
159
- * console.log("获取成功"+JSON.stringify(res))
160
- * }
161
- * });
162
- * ```
163
- * @tutorial-uni-app-x https://doc.dcloud.net.cn/uni-app-x/api/virtual-payment.html#getunfinishedtransactions
164
- * @tutorial https://doc.dcloud.net.cn/uni-app-x/api/virtual-payment.html#getunfinishedtransactions
165
- * @uniPlatform {
166
- * "app": {
167
- * "android": {
168
- * "osVer": "5.0",
169
- * "uniVer": "x",
170
- * "unixVer": "x"
171
- * },
172
- * "ios": {
173
- * "osVer": "15.0",
174
- * "uniVer": "√",
175
- * "unixVer": "4.25"
176
- * }
177
- * },
178
- * "web": {
179
- * "uniVer": "x",
180
- * "unixVer": "x"
181
- * }
182
- * }
183
- */
184
- getUnfinishedTransactions(options : AppleIAPUnfinishedTransactionOptions) : void;
185
- /**
186
- * @description 关闭苹果服务器订单
187
- * @param {AppleIAPFinishTransactionOptions} options
188
- * @example
189
- * ```typescript
190
- * finishTransaction({
191
- * success: function (res) {
192
- * console.log("关单成功"+JSON.stringify(res))
193
- * }
194
- * });
195
- * ```
196
- * @tutorial-uni-app-x https://doc.dcloud.net.cn/uni-app-x/api/virtual-payment.html#finishtransaction
197
- * @tutorial https://doc.dcloud.net.cn/uni-app-x/api/virtual-payment.html#finishtransaction
198
- * @uniPlatform {
199
- * "app": {
200
- * "android": {
201
- * "osVer": "5.0",
202
- * "uniVer": "x",
203
- * "unixVer": "x"
204
- * },
205
- * "ios": {
206
- * "osVer": "15.0",
207
- * "uniVer": "√",
208
- * "unixVer": "4.25"
209
- * }
210
- * },
211
- * "web": {
212
- * "uniVer": "x",
213
- * "unixVer": "x"
214
- * }
215
- * }
216
- */
217
- finishTransaction(options : AppleIAPFinishTransactionOptions) : void;
218
- };
219
-
220
-
221
- /**
222
- * 错误码
223
- */
224
- export type RequestVirtualPaymentErrorCode =
225
- /**
226
- * 正在处理中,支付结果未知
227
- * @uniPlatform {
228
- * "app": {
229
- * "android": {
230
- * "osVer": "5.0",
231
- * "uniVer": "x",
232
- * "unixVer": "x"
233
- * },
234
- * "ios": {
235
- * "osVer": "15.0",
236
- * "uniVer": "√",
237
- * "unixVer": "4.25"
238
- * }
239
- * },
240
- * "web": {
241
- * "uniVer": "x",
242
- * "unixVer": "x"
243
- * }
244
- * }
245
- */
246
- 700600 |
247
- /**
248
- * 用户中途取消。
249
- * @uniPlatform {
250
- * "app": {
251
- * "android": {
252
- * "osVer": "5.0",
253
- * "uniVer": "x",
254
- * "unixVer": "x"
255
- * },
256
- * "ios": {
257
- * "osVer": "15.0",
258
- * "uniVer": "√",
259
- * "unixVer": "4.25"
260
- * }
261
- * },
262
- * "web": {
263
- * "uniVer": "x",
264
- * "unixVer": "x"
265
- * }
266
- * }
267
- */
268
- 700601 |
269
- /**
270
- * 网络连接出错。
271
- * @uniPlatform {
272
- * "app": {
273
- * "android": {
274
- * "osVer": "5.0",
275
- * "uniVer": "x",
276
- * "unixVer": "x"
277
- * },
278
- * "ios": {
279
- * "osVer": "15.0",
280
- * "uniVer": "√",
281
- * "unixVer": "4.25"
282
- * }
283
- * },
284
- * "web": {
285
- * "uniVer": "x",
286
- * "unixVer": "x"
287
- * }
288
- * }
289
- */
290
- 700602 |
291
- /**
292
- * 不允许App内购买项目, 请授权应用内购买权限。
293
- * @uniPlatform {
294
- * "app": {
295
- * "android": {
296
- * "osVer": "5.0",
297
- * "uniVer": "x",
298
- * "unixVer": "x"
299
- * },
300
- * "ios": {
301
- * "osVer": "15.0",
302
- * "uniVer": "√",
303
- * "unixVer": "4.25"
304
- * }
305
- * },
306
- * "web": {
307
- * "uniVer": "x",
308
- * "unixVer": "x"
309
- * }
310
- * }
311
- */
312
- 700604 |
313
- /**
314
- * 产品无效。
315
- * @uniPlatform {
316
- * "app": {
317
- * "android": {
318
- * "osVer": "5.0",
319
- * "uniVer": "x",
320
- * "unixVer": "x"
321
- * },
322
- * "ios": {
323
- * "osVer": "15.0",
324
- * "uniVer": "√",
325
- * "unixVer": "4.25"
326
- * }
327
- * },
328
- * "web": {
329
- * "uniVer": "x",
330
- * "unixVer": "x"
331
- * }
332
- * }
333
- */
334
- 700605 |
335
- /**
336
- * 促销信息错误。
337
- * @uniPlatform {
338
- * "app": {
339
- * "android": {
340
- * "osVer": "5.0",
341
- * "uniVer": "x",
342
- * "unixVer": "x"
343
- * },
344
- * "ios": {
345
- * "osVer": "15.0",
346
- * "uniVer": "√",
347
- * "unixVer": "4.25"
348
- * }
349
- * },
350
- * "web": {
351
- * "uniVer": "x",
352
- * "unixVer": "x"
353
- * }
354
- * }
355
- */
356
- 700606 |
357
- /**
358
- * 缺少支付参数。
359
- * @uniPlatform {
360
- * "app": {
361
- * "android": {
362
- * "osVer": "5.0",
363
- * "uniVer": "x",
364
- * "unixVer": "x"
365
- * },
366
- * "ios": {
367
- * "osVer": "15.0",
368
- * "uniVer": "√",
369
- * "unixVer": "4.25"
370
- * }
371
- * },
372
- * "web": {
373
- * "uniVer": "x",
374
- * "unixVer": "x"
375
- * }
376
- * }
377
- */
378
- 700607 |
379
- /**
380
- * 只支持iOS15以上的版本。
381
- * @uniPlatform {
382
- * "app": {
383
- * "android": {
384
- * "osVer": "5.0",
385
- * "uniVer": "x",
386
- * "unixVer": "x"
387
- * },
388
- * "ios": {
389
- * "osVer": "15.0",
390
- * "uniVer": "√",
391
- * "unixVer": "4.25"
392
- * }
393
- * },
394
- * "web": {
395
- * "uniVer": "x",
396
- * "unixVer": "x"
397
- * }
398
- * }
399
- */
400
- 700800 |
401
- /**
402
- * 其他未知错误。
403
- * @uniPlatform {
404
- * "app": {
405
- * "android": {
406
- * "osVer": "5.0",
407
- * "uniVer": "x",
408
- * "unixVer": "x"
409
- * },
410
- * "ios": {
411
- * "osVer": "15.0",
412
- * "uniVer": "√",
413
- * "unixVer": "4.25"
414
- * }
415
- * },
416
- * "web": {
417
- * "uniVer": "x",
418
- * "unixVer": "x"
419
- * }
420
- * }
421
- */
422
- 700000;
423
-
424
-
425
- export type RequestVirtualPayment = (options : RequestVirtualPaymentOptions) => void;
426
-
427
- export type AppleIAPPromotionalOffer = {
428
- /**
429
- * 促销id
430
- * @uniPlatform {
431
- * "app": {
432
- * "android": {
433
- * "osVer": "5.0",
434
- * "uniVer": "x",
435
- * "unixVer": "x"
436
- * },
437
- * "ios": {
438
- * "osVer": "15.0",
439
- * "uniVer": "√",
440
- * "unixVer": "4.25"
441
- * }
442
- * },
443
- * "web": {
444
- * "uniVer": "x",
445
- * "unixVer": "x"
446
- * }
447
- * }
448
- */
449
- offerIdentifier : string,
450
- /**
451
- * 密钥
452
- * @uniPlatform {
453
- * "app": {
454
- * "android": {
455
- * "osVer": "5.0",
456
- * "uniVer": "x",
457
- * "unixVer": "x"
458
- * },
459
- * "ios": {
460
- * "osVer": "15.0",
461
- * "uniVer": "√",
462
- * "unixVer": "4.25"
463
- * }
464
- * },
465
- * "web": {
466
- * "uniVer": "x",
467
- * "unixVer": "x"
468
- * }
469
- * }
470
- */
471
- keyIdentifier : string,
472
- /**
473
- * 唯一id (必须小写 24小时有效)
474
- * @uniPlatform {
475
- * "app": {
476
- * "android": {
477
- * "osVer": "5.0",
478
- * "uniVer": "x",
479
- * "unixVer": "x"
480
- * },
481
- * "ios": {
482
- * "osVer": "15.0",
483
- * "uniVer": "√",
484
- * "unixVer": "4.25"
485
- * }
486
- * },
487
- * "web": {
488
- * "uniVer": "x",
489
- * "unixVer": "x"
490
- * }
491
- * }
492
- */
493
- nonce : string,
494
- /**
495
- * 签名
496
- * @uniPlatform {
497
- * "app": {
498
- * "android": {
499
- * "osVer": "5.0",
500
- * "uniVer": "x",
501
- * "unixVer": "x"
502
- * },
503
- * "ios": {
504
- * "osVer": "15.0",
505
- * "uniVer": "√",
506
- * "unixVer": "4.25"
507
- * }
508
- * },
509
- * "web": {
510
- * "uniVer": "x",
511
- * "unixVer": "x"
512
- * }
513
- * }
514
- */
515
- signature : string,
516
- /**
517
- * 创建证书的时间戳(毫秒 24小时有效)
518
- * @uniPlatform {
519
- * "app": {
520
- * "android": {
521
- * "osVer": "5.0",
522
- * "uniVer": "x",
523
- * "unixVer": "x"
524
- * },
525
- * "ios": {
526
- * "osVer": "15.0",
527
- * "uniVer": "√",
528
- * "unixVer": "4.25"
529
- * }
530
- * },
531
- * "web": {
532
- * "uniVer": "x",
533
- * "unixVer": "x"
534
- * }
535
- * }
536
- */
537
- timestamp : number
538
- }
539
-
540
- export type AppleIAPTransactionOptions = {
541
- /**
542
- * 产品id,和苹果开发者中心配置的一样
543
- * @uniPlatform {
544
- * "app": {
545
- * "android": {
546
- * "osVer": "5.0",
547
- * "uniVer": "x",
548
- * "unixVer": "x"
549
- * },
550
- * "ios": {
551
- * "osVer": "15.0",
552
- * "uniVer": "√",
553
- * "unixVer": "4.25"
554
- * }
555
- * },
556
- * "web": {
557
- * "uniVer": "x",
558
- * "unixVer": "x"
559
- * }
560
- * }
561
- */
562
- productId : string,
563
- /**
564
- * 透传参数,一般用于标记订单和用户的关系,可以用来验证和关联用户账户和购买记录
565
- * @uniPlatform {
566
- * "app": {
567
- * "android": {
568
- * "osVer": "5.0",
569
- * "uniVer": "x",
570
- * "unixVer": "x"
571
- * },
572
- * "ios": {
573
- * "osVer": "15.0",
574
- * "uniVer": "√",
575
- * "unixVer": "4.25"
576
- * }
577
- * },
578
- * "web": {
579
- * "uniVer": "x",
580
- * "unixVer": "x"
581
- * }
582
- * }
583
- */
584
- appAccountToken ?: string | null,
585
- /**
586
- * 购买数量
587
- * @uniPlatform {
588
- * "app": {
589
- * "android": {
590
- * "osVer": "5.0",
591
- * "uniVer": "x",
592
- * "unixVer": "x"
593
- * },
594
- * "ios": {
595
- * "osVer": "15.0",
596
- * "uniVer": "√",
597
- * "unixVer": "4.25"
598
- * }
599
- * },
600
- * "web": {
601
- * "uniVer": "x",
602
- * "unixVer": "x"
603
- * }
604
- * }
605
- */
606
- quantity : number,
607
- /**
608
- * 交易日期,示例 2022-01-01 08:00:00
609
- * @uniPlatform {
610
- * "app": {
611
- * "android": {
612
- * "osVer": "5.0",
613
- * "uniVer": "x",
614
- * "unixVer": "x"
615
- * },
616
- * "ios": {
617
- * "osVer": "15.0",
618
- * "uniVer": "√",
619
- * "unixVer": "4.25"
620
- * }
621
- * },
622
- * "web": {
623
- * "uniVer": "x",
624
- * "unixVer": "x"
625
- * }
626
- * }
627
- */
628
- transactionDate : Date,
629
- /**
630
- * 交易唯一标识
631
- * @uniPlatform {
632
- * "app": {
633
- * "android": {
634
- * "osVer": "5.0",
635
- * "uniVer": "x",
636
- * "unixVer": "x"
637
- * },
638
- * "ios": {
639
- * "osVer": "15.0",
640
- * "uniVer": "√",
641
- * "unixVer": "4.25"
642
- * }
643
- * },
644
- * "web": {
645
- * "uniVer": "x",
646
- * "unixVer": "x"
647
- * }
648
- * }
649
- */
650
- transactionIdentifier : string,
651
- /**
652
- * 原始交易日期,示例 2022-01-01 08:00:00
653
- * @uniPlatform {
654
- * "app": {
655
- * "android": {
656
- * "osVer": "5.0",
657
- * "uniVer": "x",
658
- * "unixVer": "x"
659
- * },
660
- * "ios": {
661
- * "osVer": "15.0",
662
- * "uniVer": "√",
663
- * "unixVer": "4.25"
664
- * }
665
- * },
666
- * "web": {
667
- * "uniVer": "x",
668
- * "unixVer": "x"
669
- * }
670
- * }
671
- */
672
- originalTransactionDate : Date,
673
- /**
674
- * 原始交易唯一标识
675
- * @uniPlatform {
676
- * "app": {
677
- * "android": {
678
- * "osVer": "5.0",
679
- * "uniVer": "x",
680
- * "unixVer": "x"
681
- * },
682
- * "ios": {
683
- * "osVer": "15.0",
684
- * "uniVer": "√",
685
- * "unixVer": "4.25"
686
- * }
687
- * },
688
- * "web": {
689
- * "uniVer": "x",
690
- * "unixVer": "x"
691
- * }
692
- * }
693
- */
694
- originalTransactionIdentifier : string,
695
- /**
696
- * 支付票据
697
- * @uniPlatform {
698
- * "app": {
699
- * "android": {
700
- * "osVer": "5.0",
701
- * "uniVer": "x",
702
- * "unixVer": "x"
703
- * },
704
- * "ios": {
705
- * "osVer": "15.0",
706
- * "uniVer": "√",
707
- * "unixVer": "4.25"
708
- * }
709
- * },
710
- * "web": {
711
- * "uniVer": "x",
712
- * "unixVer": "x"
713
- * }
714
- * }
715
- */
716
- jsonRepresentation : string,
717
- }
718
- export type GoolgeIapSuccessOptions = {
719
-
720
- }
721
- export type HuaweiIapSuccessOptions = {
722
-
723
- }
724
- export type WeixinIapSuccessOptions = {
725
-
726
- }
727
-
728
- export type RequestVirtualPaymentSuccess = {
729
- /**
730
- * 支付成功返回结果
731
- * @uniPlatform {
732
- * "app": {
733
- * "android": {
734
- * "osVer": "5.0",
735
- * "uniVer": "x",
736
- * "unixVer": "x"
737
- * },
738
- * "ios": {
739
- * "osVer": "15.0",
740
- * "uniVer": "√",
741
- * "unixVer": "4.25"
742
- * }
743
- * },
744
- * "web": {
745
- * "uniVer": "x",
746
- * "unixVer": "x"
747
- * }
748
- * }
749
- */
750
- apple ?: AppleIAPTransactionOptions | null,
751
- // google ?: GoolgeIapSuccessOptions | null,
752
- // huawei ?: HuaweiIapSuccessOptions | null,
753
- // weixin ?: WeixinIapSuccessOptions | null,
754
- };
755
- export type RequestVirtualPaymentSuccessCallback = (result : RequestVirtualPaymentSuccess) => void;
756
- export type RequestVirtualPaymentFail = IRequestVirtualPaymentFail;
757
- export type RequestVirtualPaymentFailCallback = (result : RequestVirtualPaymentFail) => void;
758
- export interface IRequestVirtualPaymentFail extends IUniError {
759
- /**
760
- * 错误码
761
- * @uniPlatform {
762
- * "app": {
763
- * "android": {
764
- * "osVer": "5.0",
765
- * "uniVer": "x",
766
- * "unixVer": "x"
767
- * },
768
- * "ios": {
769
- * "osVer": "15.0",
770
- * "uniVer": "√",
771
- * "unixVer": "4.25"
772
- * }
773
- * },
774
- * "web": {
775
- * "uniVer": "x",
776
- * "unixVer": "x"
777
- * }
778
- * }
779
- */
780
- errCode : RequestVirtualPaymentErrorCode
781
- };
782
- export type RequestVirtualPaymentComplete = any
783
- export type RequestVirtualPaymentCompleteCallback = (result : RequestVirtualPaymentComplete) => void;
784
-
785
- export type AppleIAPOptions = {
786
- /**
787
- * 产品id,在苹果开发者中心配置
788
- * @uniPlatform {
789
- * "app": {
790
- * "android": {
791
- * "osVer": "5.0",
792
- * "uniVer": "x",
793
- * "unixVer": "x"
794
- * },
795
- * "ios": {
796
- * "osVer": "15.0",
797
- * "uniVer": "√",
798
- * "unixVer": "4.25"
799
- * }
800
- * },
801
- * "web": {
802
- * "uniVer": "x",
803
- * "unixVer": "x"
804
- * }
805
- * }
806
- */
807
- productId : string,
808
- /**
809
- * 透传参数,一般用于标记订单和用户的关系,可以用来验证和关联用户账户和购买记录
810
- * @uniPlatform {
811
- * "app": {
812
- * "android": {
813
- * "osVer": "5.0",
814
- * "uniVer": "x",
815
- * "unixVer": "x"
816
- * },
817
- * "ios": {
818
- * "osVer": "15.0",
819
- * "uniVer": "√",
820
- * "unixVer": "4.25"
821
- * }
822
- * },
823
- * "web": {
824
- * "uniVer": "x",
825
- * "unixVer": "x"
826
- * }
827
- * }
828
- */
829
- appAccountToken ?: string | null,
830
- /**
831
- * 购买数量,默认是1,最小值是1,最大值是10
832
- * @uniPlatform {
833
- * "app": {
834
- * "android": {
835
- * "osVer": "5.0",
836
- * "uniVer": "x",
837
- * "unixVer": "x"
838
- * },
839
- * "ios": {
840
- * "osVer": "15.0",
841
- * "uniVer": "√",
842
- * "unixVer": "4.25"
843
- * }
844
- * },
845
- * "web": {
846
- * "uniVer": "x",
847
- * "unixVer": "x"
848
- * }
849
- * }
850
- */
851
- quantity : number,
852
- /**
853
- * 促销优惠参数说明
854
- * @uniPlatform {
855
- * "app": {
856
- * "android": {
857
- * "osVer": "5.0",
858
- * "uniVer": "x",
859
- * "unixVer": "x"
860
- * },
861
- * "ios": {
862
- * "osVer": "15.0",
863
- * "uniVer": "√",
864
- * "unixVer": "4.25"
865
- * }
866
- * },
867
- * "web": {
868
- * "uniVer": "x",
869
- * "unixVer": "x"
870
- * }
871
- * }
872
- */
873
- promotionalOffer ?: AppleIAPPromotionalOffer | null
874
- };
875
- export type GoogleIapOptions = {
876
-
877
- };
878
- export type HuaweiIapOptions = {
879
-
880
- };
881
- export type WeixinIapOptions = {
882
-
883
- };
884
- export type RequestVirtualPaymentOptions = {
885
- /**
886
- * 苹果IAP的参数
887
- * @uniPlatform {
888
- * "app": {
889
- * "android": {
890
- * "osVer": "5.0",
891
- * "uniVer": "x",
892
- * "unixVer": "x"
893
- * },
894
- * "ios": {
895
- * "osVer": "15.0",
896
- * "uniVer": "√",
897
- * "unixVer": "4.25"
898
- * }
899
- * },
900
- * "web": {
901
- * "uniVer": "x",
902
- * "unixVer": "x"
903
- * }
904
- * }
905
- */
906
- apple ?: AppleIAPOptions | null,
907
- // /**
908
- // * Google IAP的参数
909
- // */
910
- // google ?: GoogleIapOptions | null,
911
- // /**
912
- // * 华为 IAP的参数
913
- // */
914
- // huawei ?: HuaweiIapOptions | null,
915
- // /**
916
- // * 微信虚拟支付的参数
917
- // */
918
- // weixin ?: WeixinIapOptions | null,
919
- /**
920
- * 接口调用成功的回调函数
921
- * @uniPlatform {
922
- * "app": {
923
- * "android": {
924
- * "osVer": "5.0",
925
- * "uniVer": "x",
926
- * "unixVer": "x"
927
- * },
928
- * "ios": {
929
- * "osVer": "15.0",
930
- * "uniVer": "√",
931
- * "unixVer": "4.25"
932
- * }
933
- * },
934
- * "mp": {
935
- * "weixin": {
936
- * "hostVer": "√",
937
- * "uniVer": "√",
938
- * "unixVer": "4.35"
939
- * },
940
- * "alipay": {
941
- * "hostVer": "√",
942
- * "uniVer": "x",
943
- * "unixVer": "x"
944
- * },
945
- * "baidu": {
946
- * "hostVer": "√",
947
- * "uniVer": "x",
948
- * "unixVer": "x"
949
- * },
950
- * "toutiao": {
951
- * "hostVer": "√",
952
- * "uniVer": "x",
953
- * "unixVer": "x"
954
- * },
955
- * "lark": {
956
- * "hostVer": "√",
957
- * "uniVer": "x",
958
- * "unixVer": "x"
959
- * },
960
- * "qq": {
961
- * "hostVer": "√",
962
- * "uniVer": "x",
963
- * "unixVer": "x"
964
- * },
965
- * "kuaishou": {
966
- * "hostVer": "√",
967
- * "uniVer": "x",
968
- * "unixVer": "x"
969
- * },
970
- * "jd": {
971
- * "hostVer": "√",
972
- * "uniVer": "x",
973
- * "unixVer": "x"
974
- * }
975
- * },
976
- * "web": {
977
- * "uniVer": "x",
978
- * "unixVer": "x"
979
- * }
980
- * }
981
- */
982
- success ?: RequestVirtualPaymentSuccessCallback | null,
983
- /**
984
- * 接口调用失败的回调函数
985
- * @uniPlatform {
986
- * "app": {
987
- * "android": {
988
- * "osVer": "5.0",
989
- * "uniVer": "x",
990
- * "unixVer": "x"
991
- * },
992
- * "ios": {
993
- * "osVer": "15.0",
994
- * "uniVer": "√",
995
- * "unixVer": "4.25"
996
- * }
997
- * },
998
- * "mp": {
999
- * "weixin": {
1000
- * "hostVer": "√",
1001
- * "uniVer": "√",
1002
- * "unixVer": "4.35"
1003
- * },
1004
- * "alipay": {
1005
- * "hostVer": "√",
1006
- * "uniVer": "x",
1007
- * "unixVer": "x"
1008
- * },
1009
- * "baidu": {
1010
- * "hostVer": "√",
1011
- * "uniVer": "x",
1012
- * "unixVer": "x"
1013
- * },
1014
- * "toutiao": {
1015
- * "hostVer": "√",
1016
- * "uniVer": "x",
1017
- * "unixVer": "x"
1018
- * },
1019
- * "lark": {
1020
- * "hostVer": "√",
1021
- * "uniVer": "x",
1022
- * "unixVer": "x"
1023
- * },
1024
- * "qq": {
1025
- * "hostVer": "√",
1026
- * "uniVer": "x",
1027
- * "unixVer": "x"
1028
- * },
1029
- * "kuaishou": {
1030
- * "hostVer": "√",
1031
- * "uniVer": "x",
1032
- * "unixVer": "x"
1033
- * },
1034
- * "jd": {
1035
- * "hostVer": "√",
1036
- * "uniVer": "x",
1037
- * "unixVer": "x"
1038
- * }
1039
- * },
1040
- * "web": {
1041
- * "uniVer": "x",
1042
- * "unixVer": "x"
1043
- * }
1044
- * }
1045
- */
1046
- fail ?: RequestVirtualPaymentFailCallback | null,
1047
- /**
1048
- * 接口调用结束的回调函数(调用成功、失败都会执行)
1049
- * @uniPlatform {
1050
- * "app": {
1051
- * "android": {
1052
- * "osVer": "5.0",
1053
- * "uniVer": "x",
1054
- * "unixVer": "x"
1055
- * },
1056
- * "ios": {
1057
- * "osVer": "15.0",
1058
- * "uniVer": "√",
1059
- * "unixVer": "4.25"
1060
- * }
1061
- * },
1062
- * "mp": {
1063
- * "weixin": {
1064
- * "hostVer": "√",
1065
- * "uniVer": "√",
1066
- * "unixVer": "4.35"
1067
- * },
1068
- * "alipay": {
1069
- * "hostVer": "√",
1070
- * "uniVer": "x",
1071
- * "unixVer": "x"
1072
- * },
1073
- * "baidu": {
1074
- * "hostVer": "√",
1075
- * "uniVer": "x",
1076
- * "unixVer": "x"
1077
- * },
1078
- * "toutiao": {
1079
- * "hostVer": "√",
1080
- * "uniVer": "x",
1081
- * "unixVer": "x"
1082
- * },
1083
- * "lark": {
1084
- * "hostVer": "√",
1085
- * "uniVer": "x",
1086
- * "unixVer": "x"
1087
- * },
1088
- * "qq": {
1089
- * "hostVer": "√",
1090
- * "uniVer": "x",
1091
- * "unixVer": "x"
1092
- * },
1093
- * "kuaishou": {
1094
- * "hostVer": "√",
1095
- * "uniVer": "x",
1096
- * "unixVer": "x"
1097
- * },
1098
- * "jd": {
1099
- * "hostVer": "√",
1100
- * "uniVer": "x",
1101
- * "unixVer": "x"
1102
- * }
1103
- * },
1104
- * "web": {
1105
- * "uniVer": "x",
1106
- * "unixVer": "x"
1107
- * }
1108
- * }
1109
- */
1110
- complete ?: RequestVirtualPaymentCompleteCallback | null
1111
- };
1112
-
1113
-
1114
- //restoreTransactions
1115
- export type RestoreTransactions = (options : AppleIAPRestoreOptions) => void;
1116
- export type AppleIAPRestoreSuccess = {
1117
- /**
1118
- * 返回的交易列表
1119
- * @uniPlatform {
1120
- * "app": {
1121
- * "android": {
1122
- * "osVer": "5.0",
1123
- * "uniVer": "x",
1124
- * "unixVer": "x"
1125
- * },
1126
- * "ios": {
1127
- * "osVer": "15.0",
1128
- * "uniVer": "√",
1129
- * "unixVer": "4.25"
1130
- * }
1131
- * },
1132
- * "web": {
1133
- * "uniVer": "x",
1134
- * "unixVer": "x"
1135
- * }
1136
- * }
1137
- */
1138
- transactions ?: AppleIAPTransactionOptions[] | null
1139
- };
1140
- export type AppleIAPRestoreSuccessCallback = (result : AppleIAPRestoreSuccess) => void;
1141
- export type AppleIAPRestoreFail = IAppleIAPRestoreFail;
1142
- export type AppleIAPRestoreFailCallback = (result : AppleIAPRestoreFail) => void;
1143
- export interface IAppleIAPRestoreFail extends IUniError {
1144
- /**
1145
- * 错误码
1146
- * @uniPlatform {
1147
- * "app": {
1148
- * "android": {
1149
- * "osVer": "5.0",
1150
- * "uniVer": "x",
1151
- * "unixVer": "x"
1152
- * },
1153
- * "ios": {
1154
- * "osVer": "15.0",
1155
- * "uniVer": "√",
1156
- * "unixVer": "4.25"
1157
- * }
1158
- * },
1159
- * "web": {
1160
- * "uniVer": "x",
1161
- * "unixVer": "x"
1162
- * }
1163
- * }
1164
- */
1165
- errCode : AppleIAPRestoreErrorCode
1166
- };
1167
- export type AppleIAPRestoreComplete = any
1168
- export type AppleIAPRestoreCompleteCallback = (result : AppleIAPRestoreComplete) => void;
1169
- /**
1170
- * 错误码
1171
- */
1172
- export type AppleIAPRestoreErrorCode =
1173
- /**
1174
- * apple restore 请求失败。
1175
- * @uniPlatform {
1176
- * "app": {
1177
- * "android": {
1178
- * "osVer": "5.0",
1179
- * "uniVer": "x",
1180
- * "unixVer": "x"
1181
- * },
1182
- * "ios": {
1183
- * "osVer": "15.0",
1184
- * "uniVer": "√",
1185
- * "unixVer": "4.25"
1186
- * }
1187
- * },
1188
- * "web": {
1189
- * "uniVer": "x",
1190
- * "unixVer": "x"
1191
- * }
1192
- * }
1193
- */
1194
- 700600 |
1195
- /**
1196
- * 用户中途取消。
1197
- * @uniPlatform {
1198
- * "app": {
1199
- * "android": {
1200
- * "osVer": "5.0",
1201
- * "uniVer": "x",
1202
- * "unixVer": "x"
1203
- * },
1204
- * "ios": {
1205
- * "osVer": "15.0",
1206
- * "uniVer": "√",
1207
- * "unixVer": "4.25"
1208
- * }
1209
- * },
1210
- * "web": {
1211
- * "uniVer": "x",
1212
- * "unixVer": "x"
1213
- * }
1214
- * }
1215
- */
1216
- 700601 |
1217
- /**
1218
- * 网络连接出错。
1219
- * @uniPlatform {
1220
- * "app": {
1221
- * "android": {
1222
- * "osVer": "5.0",
1223
- * "uniVer": "x",
1224
- * "unixVer": "x"
1225
- * },
1226
- * "ios": {
1227
- * "osVer": "15.0",
1228
- * "uniVer": "√",
1229
- * "unixVer": "4.25"
1230
- * }
1231
- * },
1232
- * "web": {
1233
- * "uniVer": "x",
1234
- * "unixVer": "x"
1235
- * }
1236
- * }
1237
- */
1238
- 700602 |
1239
- /**
1240
- * 只支持iOS15以上的版本。
1241
- * @uniPlatform {
1242
- * "app": {
1243
- * "android": {
1244
- * "osVer": "5.0",
1245
- * "uniVer": "x",
1246
- * "unixVer": "x"
1247
- * },
1248
- * "ios": {
1249
- * "osVer": "15.0",
1250
- * "uniVer": "√",
1251
- * "unixVer": "4.25"
1252
- * }
1253
- * },
1254
- * "web": {
1255
- * "uniVer": "x",
1256
- * "unixVer": "x"
1257
- * }
1258
- * }
1259
- */
1260
- 700800;
1261
-
1262
-
1263
- export type AppleIAPRestoreOptions = {
1264
- /**
1265
- * 接口调用成功的回调函数
1266
- * @uniPlatform {
1267
- * "app": {
1268
- * "android": {
1269
- * "osVer": "5.0",
1270
- * "uniVer": "x",
1271
- * "unixVer": "x"
1272
- * },
1273
- * "ios": {
1274
- * "osVer": "15.0",
1275
- * "uniVer": "√",
1276
- * "unixVer": "4.25"
1277
- * }
1278
- * },
1279
- * "web": {
1280
- * "uniVer": "x",
1281
- * "unixVer": "x"
1282
- * }
1283
- * }
1284
- */
1285
- success ?: AppleIAPRestoreSuccessCallback | null,
1286
- /**
1287
- * 接口调用失败的回调函数
1288
- * @uniPlatform {
1289
- * "app": {
1290
- * "android": {
1291
- * "osVer": "5.0",
1292
- * "uniVer": "x",
1293
- * "unixVer": "x"
1294
- * },
1295
- * "ios": {
1296
- * "osVer": "15.0",
1297
- * "uniVer": "√",
1298
- * "unixVer": "4.25"
1299
- * }
1300
- * },
1301
- * "web": {
1302
- * "uniVer": "x",
1303
- * "unixVer": "x"
1304
- * }
1305
- * }
1306
- */
1307
- fail ?: AppleIAPRestoreFailCallback | null,
1308
- /**
1309
- * 接口调用结束的回调函数(调用成功、失败都会执行)
1310
- * @uniPlatform {
1311
- * "app": {
1312
- * "android": {
1313
- * "osVer": "5.0",
1314
- * "uniVer": "x",
1315
- * "unixVer": "x"
1316
- * },
1317
- * "ios": {
1318
- * "osVer": "15.0",
1319
- * "uniVer": "√",
1320
- * "unixVer": "4.25"
1321
- * }
1322
- * },
1323
- * "web": {
1324
- * "uniVer": "x",
1325
- * "unixVer": "x"
1326
- * }
1327
- * }
1328
- */
1329
- complete ?: AppleIAPRestoreCompleteCallback | null
1330
- };
1331
-
1332
-
1333
-
1334
- //getUnfinishedTransactions
1335
- export type GetUnfinishedTransactions = (options : AppleIAPUnfinishedTransactionOptions) => void;
1336
- export type AppleIAPUnfinishedTransactionSuccess = {
1337
- /**
1338
- * 返回的交易列表
1339
- * @uniPlatform {
1340
- * "app": {
1341
- * "android": {
1342
- * "osVer": "5.0",
1343
- * "uniVer": "x",
1344
- * "unixVer": "x"
1345
- * },
1346
- * "ios": {
1347
- * "osVer": "15.0",
1348
- * "uniVer": "√",
1349
- * "unixVer": "4.25"
1350
- * }
1351
- * },
1352
- * "web": {
1353
- * "uniVer": "x",
1354
- * "unixVer": "x"
1355
- * }
1356
- * }
1357
- */
1358
- transactions ?: AppleIAPTransactionOptions[] | null
1359
- };
1360
- export type AppleIAPUnfinishedTransactionSuccessCallback = (result : AppleIAPUnfinishedTransactionSuccess) => void;
1361
- export type AppleIAPUnfinishedTransactionFail = IAppleIAPUnfinishedTransactionFail;
1362
- export type AppleIAPUnfinishedTransactionFailCallback = (result : AppleIAPUnfinishedTransactionFail) => void;
1363
- export interface IAppleIAPUnfinishedTransactionFail extends IUniError {
1364
- /**
1365
- * 错误码
1366
- * @uniPlatform {
1367
- * "app": {
1368
- * "android": {
1369
- * "osVer": "5.0",
1370
- * "uniVer": "x",
1371
- * "unixVer": "x"
1372
- * },
1373
- * "ios": {
1374
- * "osVer": "15.0",
1375
- * "uniVer": "√",
1376
- * "unixVer": "4.25"
1377
- * }
1378
- * },
1379
- * "web": {
1380
- * "uniVer": "x",
1381
- * "unixVer": "x"
1382
- * }
1383
- * }
1384
- */
1385
- errCode : AppleIAPUnfinishedTransactionErrorCode
1386
- };
1387
- export type AppleIAPUnfinishedTransactionComplete = any
1388
- export type AppleIAPUnfinishedTransactionCompleteCallback = (result : AppleIAPUnfinishedTransactionComplete) => void;
1389
- /**
1390
- * 错误码
1391
- * - 700800 只支持iOS15以上的版本。
1392
- */
1393
- export type AppleIAPUnfinishedTransactionErrorCode = 700800;
1394
-
1395
- export type AppleIAPUnfinishedTransactionOptions = {
1396
- /**
1397
- * 接口调用成功的回调函数
1398
- * @uniPlatform {
1399
- * "app": {
1400
- * "android": {
1401
- * "osVer": "5.0",
1402
- * "uniVer": "x",
1403
- * "unixVer": "x"
1404
- * },
1405
- * "ios": {
1406
- * "osVer": "15.0",
1407
- * "uniVer": "√",
1408
- * "unixVer": "4.25"
1409
- * }
1410
- * },
1411
- * "web": {
1412
- * "uniVer": "x",
1413
- * "unixVer": "x"
1414
- * }
1415
- * }
1416
- */
1417
- success ?: AppleIAPUnfinishedTransactionSuccessCallback | null,
1418
- /**
1419
- * 接口调用失败的回调函数
1420
- * @uniPlatform {
1421
- * "app": {
1422
- * "android": {
1423
- * "osVer": "5.0",
1424
- * "uniVer": "x",
1425
- * "unixVer": "x"
1426
- * },
1427
- * "ios": {
1428
- * "osVer": "15.0",
1429
- * "uniVer": "√",
1430
- * "unixVer": "4.25"
1431
- * }
1432
- * },
1433
- * "web": {
1434
- * "uniVer": "x",
1435
- * "unixVer": "x"
1436
- * }
1437
- * }
1438
- */
1439
- fail ?: AppleIAPUnfinishedTransactionFailCallback | null,
1440
- /**
1441
- * 接口调用结束的回调函数(调用成功、失败都会执行)
1442
- * @uniPlatform {
1443
- * "app": {
1444
- * "android": {
1445
- * "osVer": "5.0",
1446
- * "uniVer": "x",
1447
- * "unixVer": "x"
1448
- * },
1449
- * "ios": {
1450
- * "osVer": "15.0",
1451
- * "uniVer": "√",
1452
- * "unixVer": "4.25"
1453
- * }
1454
- * },
1455
- * "web": {
1456
- * "uniVer": "x",
1457
- * "unixVer": "x"
1458
- * }
1459
- * }
1460
- */
1461
- complete ?: AppleIAPUnfinishedTransactionCompleteCallback | null
1462
- };
1463
-
1464
-
1465
-
1466
- //finishTransaction 相关定义
1467
- export type FinishTransaction = (options : AppleIAPFinishTransactionOptions) => void;
1468
- export type AppleIAPFinishTransactionSuccess = {
1469
- /**
1470
- * 关单状态
1471
- * @uniPlatform {
1472
- * "app": {
1473
- * "android": {
1474
- * "osVer": "5.0",
1475
- * "uniVer": "x",
1476
- * "unixVer": "x"
1477
- * },
1478
- * "ios": {
1479
- * "osVer": "15.0",
1480
- * "uniVer": "√",
1481
- * "unixVer": "4.25"
1482
- * }
1483
- * },
1484
- * "web": {
1485
- * "uniVer": "x",
1486
- * "unixVer": "x"
1487
- * }
1488
- * }
1489
- */
1490
- state ?: boolean | null
1491
- };
1492
- export type AppleIAPFinishTransactionSuccessCallback = (result : AppleIAPFinishTransactionSuccess) => void;
1493
- export type AppleIAPFinishTransactionFail = IAppleIAPFinishTransactionFail;
1494
- export type AppleIAPFinishTransactionFailCallback = (result : AppleIAPFinishTransactionFail) => void;
1495
- export interface IAppleIAPFinishTransactionFail extends IUniError {
1496
- /**
1497
- * 错误码
1498
- * @uniPlatform {
1499
- * "app": {
1500
- * "android": {
1501
- * "osVer": "5.0",
1502
- * "uniVer": "x",
1503
- * "unixVer": "x"
1504
- * },
1505
- * "ios": {
1506
- * "osVer": "15.0",
1507
- * "uniVer": "√",
1508
- * "unixVer": "4.25"
1509
- * }
1510
- * },
1511
- * "web": {
1512
- * "uniVer": "x",
1513
- * "unixVer": "x"
1514
- * }
1515
- * }
1516
- */
1517
- errCode : AppleIAPFinishTransactionFailErrorCode
1518
- };
1519
- export type AppleIAPFinishTransactionComplete = any
1520
- export type AppleIAPFinishTransactionCompleteCallback = (result : AppleIAPFinishTransactionComplete) => void;
1521
- /**
1522
- * 错误码
1523
- */
1524
- export type AppleIAPFinishTransactionFailErrorCode =
1525
- /**
1526
- * 没有该交易。
1527
- * @uniPlatform {
1528
- * "app": {
1529
- * "android": {
1530
- * "osVer": "5.0",
1531
- * "uniVer": "x",
1532
- * "unixVer": "x"
1533
- * },
1534
- * "ios": {
1535
- * "osVer": "15.0",
1536
- * "uniVer": "√",
1537
- * "unixVer": "4.25"
1538
- * }
1539
- * },
1540
- * "web": {
1541
- * "uniVer": "x",
1542
- * "unixVer": "x"
1543
- * }
1544
- * }
1545
- */
1546
- 700600 |
1547
- /**
1548
- * 只支持iOS15以上的版本。
1549
- * @uniPlatform {
1550
- * "app": {
1551
- * "android": {
1552
- * "osVer": "5.0",
1553
- * "uniVer": "x",
1554
- * "unixVer": "x"
1555
- * },
1556
- * "ios": {
1557
- * "osVer": "15.0",
1558
- * "uniVer": "√",
1559
- * "unixVer": "4.25"
1560
- * }
1561
- * },
1562
- * "web": {
1563
- * "uniVer": "x",
1564
- * "unixVer": "x"
1565
- * }
1566
- * }
1567
- */
1568
- 700800;
1569
-
1570
-
1571
- export type AppleIAPFinishTransactionOptions = {
1572
- /**
1573
- * 交易对象
1574
- * @uniPlatform {
1575
- * "app": {
1576
- * "android": {
1577
- * "osVer": "5.0",
1578
- * "uniVer": "x",
1579
- * "unixVer": "x"
1580
- * },
1581
- * "ios": {
1582
- * "osVer": "15.0",
1583
- * "uniVer": "√",
1584
- * "unixVer": "4.25"
1585
- * }
1586
- * },
1587
- * "web": {
1588
- * "uniVer": "x",
1589
- * "unixVer": "x"
1590
- * }
1591
- * }
1592
- */
1593
- transaction : AppleIAPTransactionOptions
1594
- /**
1595
- * 接口调用成功的回调函数
1596
- * @uniPlatform {
1597
- * "app": {
1598
- * "android": {
1599
- * "osVer": "5.0",
1600
- * "uniVer": "x",
1601
- * "unixVer": "x"
1602
- * },
1603
- * "ios": {
1604
- * "osVer": "15.0",
1605
- * "uniVer": "√",
1606
- * "unixVer": "4.25"
1607
- * }
1608
- * },
1609
- * "web": {
1610
- * "uniVer": "x",
1611
- * "unixVer": "x"
1612
- * }
1613
- * }
1614
- */
1615
- success ?: AppleIAPFinishTransactionSuccessCallback | null,
1616
- /**
1617
- * 接口调用失败的回调函数
1618
- * @uniPlatform {
1619
- * "app": {
1620
- * "android": {
1621
- * "osVer": "5.0",
1622
- * "uniVer": "x",
1623
- * "unixVer": "x"
1624
- * },
1625
- * "ios": {
1626
- * "osVer": "15.0",
1627
- * "uniVer": "√",
1628
- * "unixVer": "4.25"
1629
- * }
1630
- * },
1631
- * "web": {
1632
- * "uniVer": "x",
1633
- * "unixVer": "x"
1634
- * }
1635
- * }
1636
- */
1637
- fail ?: AppleIAPFinishTransactionFailCallback | null,
1638
- /**
1639
- * 接口调用结束的回调函数(调用成功、失败都会执行)
1640
- * @uniPlatform {
1641
- * "app": {
1642
- * "android": {
1643
- * "osVer": "5.0",
1644
- * "uniVer": "x",
1645
- * "unixVer": "x"
1646
- * },
1647
- * "ios": {
1648
- * "osVer": "15.0",
1649
- * "uniVer": "√",
1650
- * "unixVer": "4.25"
1651
- * }
1652
- * },
1653
- * "web": {
1654
- * "uniVer": "x",
1655
- * "unixVer": "x"
1656
- * }
1657
- * }
1658
- */
1659
- complete ?: AppleIAPFinishTransactionCompleteCallback | null
1660
- };
1
+ import { RequestVirtualPaymentFailImpl as RequestVirtualPaymentFailImplement } from './unierror.uts'
2
+
3
+ export type RequestVirtualPaymentFailImpl = RequestVirtualPaymentFailImplement
4
+ export interface Uni {
5
+ /**
6
+ * @description 请求支付
7
+ * @param {RequestVirtualPaymentOptions} options
8
+ * @example
9
+ * ```typescript
10
+ * uni.requestVirtualPayment({
11
+ * provider: "alipay",
12
+ * orderInfo: "",
13
+ * success: function (res) {
14
+ * console.log("支付成功"+JSON.stringify(res))
15
+ * }
16
+ * });
17
+ * ```
18
+ * @tutorial-uni-app-x https://doc.dcloud.net.cn/uni-app-x/api/virtual-payment.html#requestvirtualpayment
19
+ * @tutorial https://doc.dcloud.net.cn/uni-app-x/api/virtual-payment.html#requestvirtualpayment
20
+ * @uniPlatform {
21
+ * "app": {
22
+ * "android": {
23
+ * "osVer": "5.0",
24
+ * "uniVer": "x",
25
+ * "unixVer": "x"
26
+ * },
27
+ * "ios": {
28
+ * "osVer": "15.0",
29
+ * "uniVer": "√",
30
+ * "unixVer": "4.25"
31
+ * }
32
+ * },
33
+ * "mp": {
34
+ * "weixin": {
35
+ * "hostVer": "√",
36
+ * "uniVer": "√",
37
+ * "unixVer": "4.41"
38
+ * },
39
+ * "alipay": {
40
+ * "hostVer": "√",
41
+ * "uniVer": "x",
42
+ * "unixVer": "x"
43
+ * },
44
+ * "baidu": {
45
+ * "hostVer": "√",
46
+ * "uniVer": "x",
47
+ * "unixVer": "x"
48
+ * },
49
+ * "toutiao": {
50
+ * "hostVer": "√",
51
+ * "uniVer": "x",
52
+ * "unixVer": "x"
53
+ * },
54
+ * "lark": {
55
+ * "hostVer": "√",
56
+ * "uniVer": "x",
57
+ * "unixVer": "x"
58
+ * },
59
+ * "qq": {
60
+ * "hostVer": "√",
61
+ * "uniVer": "x",
62
+ * "unixVer": "x"
63
+ * },
64
+ * "kuaishou": {
65
+ * "hostVer": "√",
66
+ * "uniVer": "x",
67
+ * "unixVer": "x"
68
+ * },
69
+ * "jd": {
70
+ * "hostVer": "√",
71
+ * "uniVer": "x",
72
+ * "unixVer": "x"
73
+ * }
74
+ * },
75
+ * "web": {
76
+ * "uniVer": "x",
77
+ * "unixVer": "x"
78
+ * }
79
+ * }
80
+ */
81
+ requestVirtualPayment(options: RequestVirtualPaymentOptions): void;
82
+
83
+ /**
84
+ * @description 获取各平台虚拟支付的管理类,用于操作各平台专有的API。
85
+ * @tutorial-uni-app-x https://doc.dcloud.net.cn/uni-app-x/api/virtual-payment.html#getvirtualpaymentmanager
86
+ * @tutorial https://doc.dcloud.net.cn/uni-app-x/api/virtual-payment.html#getvirtualpaymentmanager
87
+ * @uniPlatform {
88
+ * "app": {
89
+ * "android": {
90
+ * "osVer": "5.0",
91
+ * "uniVer": "x",
92
+ * "unixVer": "x"
93
+ * },
94
+ * "ios": {
95
+ * "osVer": "15.0",
96
+ * "uniVer": "√",
97
+ * "unixVer": "4.25"
98
+ * },
99
+ * "harmony": {
100
+ * "osVer": "x",
101
+ * "uniVer": "x",
102
+ * "unixVer": "x"
103
+ * }
104
+ * },
105
+ * "web": {
106
+ * "uniVer": "x",
107
+ * "unixVer": "x"
108
+ * }
109
+ * }
110
+ * @return {VirtualPaymentManager} virtual-payment的管理类
111
+ */
112
+ getVirtualPaymentManager(): GetVirtualPaymentManager;
113
+ }
114
+
115
+ export type GetVirtualPaymentManager = () => VirtualPaymentManager;
116
+
117
+ export interface VirtualPaymentManager {
118
+ /**
119
+ * @description 恢复苹果服务器已支付的交易列表
120
+ * @param {AppleIAPRestoreOptions} options
121
+ * @example
122
+ * ```typescript
123
+ * restoreTransactions({
124
+ * success: function (res) {
125
+ * console.log("恢复成功"+JSON.stringify(res))
126
+ * }
127
+ * });
128
+ * ```
129
+ * @tutorial-uni-app-x https://doc.dcloud.net.cn/uni-app-x/api/virtual-payment.html#restoretransactions
130
+ * @tutorial https://doc.dcloud.net.cn/uni-app-x/api/virtual-payment.html#restoretransactions
131
+ * @uniPlatform {
132
+ * "app": {
133
+ * "android": {
134
+ * "osVer": "5.0",
135
+ * "uniVer": "x",
136
+ * "unixVer": "x"
137
+ * },
138
+ * "ios": {
139
+ * "osVer": "15.0",
140
+ * "uniVer": "√",
141
+ * "unixVer": "4.25"
142
+ * }
143
+ * },
144
+ * "web": {
145
+ * "uniVer": "x",
146
+ * "unixVer": "x"
147
+ * }
148
+ * }
149
+ */
150
+ restoreTransactions(options: AppleIAPRestoreOptions): void;
151
+
152
+ /**
153
+ * @description 获取苹果服务器已支付且未关闭的交易列表
154
+ * @param {AppleIAPUnfinishedTransactionOptions} options
155
+ * @example
156
+ * ```typescript
157
+ * getUnfinishedTransactions({
158
+ * success: function (res) {
159
+ * console.log("获取成功"+JSON.stringify(res))
160
+ * }
161
+ * });
162
+ * ```
163
+ * @tutorial-uni-app-x https://doc.dcloud.net.cn/uni-app-x/api/virtual-payment.html#getunfinishedtransactions
164
+ * @tutorial https://doc.dcloud.net.cn/uni-app-x/api/virtual-payment.html#getunfinishedtransactions
165
+ * @uniPlatform {
166
+ * "app": {
167
+ * "android": {
168
+ * "osVer": "5.0",
169
+ * "uniVer": "x",
170
+ * "unixVer": "x"
171
+ * },
172
+ * "ios": {
173
+ * "osVer": "15.0",
174
+ * "uniVer": "√",
175
+ * "unixVer": "4.25"
176
+ * }
177
+ * },
178
+ * "web": {
179
+ * "uniVer": "x",
180
+ * "unixVer": "x"
181
+ * }
182
+ * }
183
+ */
184
+ getUnfinishedTransactions(options: AppleIAPUnfinishedTransactionOptions): void;
185
+ /**
186
+ * @description 关闭苹果服务器订单
187
+ * @param {AppleIAPFinishTransactionOptions} options
188
+ * @example
189
+ * ```typescript
190
+ * finishTransaction({
191
+ * success: function (res) {
192
+ * console.log("关单成功"+JSON.stringify(res))
193
+ * }
194
+ * });
195
+ * ```
196
+ * @tutorial-uni-app-x https://doc.dcloud.net.cn/uni-app-x/api/virtual-payment.html#finishtransaction
197
+ * @tutorial https://doc.dcloud.net.cn/uni-app-x/api/virtual-payment.html#finishtransaction
198
+ * @uniPlatform {
199
+ * "app": {
200
+ * "android": {
201
+ * "osVer": "5.0",
202
+ * "uniVer": "x",
203
+ * "unixVer": "x"
204
+ * },
205
+ * "ios": {
206
+ * "osVer": "15.0",
207
+ * "uniVer": "√",
208
+ * "unixVer": "4.25"
209
+ * }
210
+ * },
211
+ * "web": {
212
+ * "uniVer": "x",
213
+ * "unixVer": "x"
214
+ * }
215
+ * }
216
+ */
217
+ finishTransaction(options: AppleIAPFinishTransactionOptions): void;
218
+ };
219
+
220
+
221
+ /**
222
+ * 错误码
223
+ */
224
+ export type RequestVirtualPaymentErrorCode =
225
+ /**
226
+ * 正在处理中,支付结果未知
227
+ * @uniPlatform {
228
+ * "app": {
229
+ * "android": {
230
+ * "osVer": "5.0",
231
+ * "uniVer": "x",
232
+ * "unixVer": "x"
233
+ * },
234
+ * "ios": {
235
+ * "osVer": "15.0",
236
+ * "uniVer": "√",
237
+ * "unixVer": "4.25"
238
+ * }
239
+ * },
240
+ * "web": {
241
+ * "uniVer": "x",
242
+ * "unixVer": "x"
243
+ * }
244
+ * }
245
+ */
246
+ 700600 |
247
+ /**
248
+ * 用户中途取消。
249
+ * @uniPlatform {
250
+ * "app": {
251
+ * "android": {
252
+ * "osVer": "5.0",
253
+ * "uniVer": "x",
254
+ * "unixVer": "x"
255
+ * },
256
+ * "ios": {
257
+ * "osVer": "15.0",
258
+ * "uniVer": "√",
259
+ * "unixVer": "4.25"
260
+ * }
261
+ * },
262
+ * "web": {
263
+ * "uniVer": "x",
264
+ * "unixVer": "x"
265
+ * }
266
+ * }
267
+ */
268
+ 700601 |
269
+ /**
270
+ * 网络连接出错。
271
+ * @uniPlatform {
272
+ * "app": {
273
+ * "android": {
274
+ * "osVer": "5.0",
275
+ * "uniVer": "x",
276
+ * "unixVer": "x"
277
+ * },
278
+ * "ios": {
279
+ * "osVer": "15.0",
280
+ * "uniVer": "√",
281
+ * "unixVer": "4.25"
282
+ * }
283
+ * },
284
+ * "web": {
285
+ * "uniVer": "x",
286
+ * "unixVer": "x"
287
+ * }
288
+ * }
289
+ */
290
+ 700602 |
291
+ /**
292
+ * 不允许App内购买项目, 请授权应用内购买权限。
293
+ * @uniPlatform {
294
+ * "app": {
295
+ * "android": {
296
+ * "osVer": "5.0",
297
+ * "uniVer": "x",
298
+ * "unixVer": "x"
299
+ * },
300
+ * "ios": {
301
+ * "osVer": "15.0",
302
+ * "uniVer": "√",
303
+ * "unixVer": "4.25"
304
+ * }
305
+ * },
306
+ * "web": {
307
+ * "uniVer": "x",
308
+ * "unixVer": "x"
309
+ * }
310
+ * }
311
+ */
312
+ 700604 |
313
+ /**
314
+ * 产品无效。
315
+ * @uniPlatform {
316
+ * "app": {
317
+ * "android": {
318
+ * "osVer": "5.0",
319
+ * "uniVer": "x",
320
+ * "unixVer": "x"
321
+ * },
322
+ * "ios": {
323
+ * "osVer": "15.0",
324
+ * "uniVer": "√",
325
+ * "unixVer": "4.25"
326
+ * }
327
+ * },
328
+ * "web": {
329
+ * "uniVer": "x",
330
+ * "unixVer": "x"
331
+ * }
332
+ * }
333
+ */
334
+ 700605 |
335
+ /**
336
+ * 促销信息错误。
337
+ * @uniPlatform {
338
+ * "app": {
339
+ * "android": {
340
+ * "osVer": "5.0",
341
+ * "uniVer": "x",
342
+ * "unixVer": "x"
343
+ * },
344
+ * "ios": {
345
+ * "osVer": "15.0",
346
+ * "uniVer": "√",
347
+ * "unixVer": "4.25"
348
+ * }
349
+ * },
350
+ * "web": {
351
+ * "uniVer": "x",
352
+ * "unixVer": "x"
353
+ * }
354
+ * }
355
+ */
356
+ 700606 |
357
+ /**
358
+ * 缺少支付参数。
359
+ * @uniPlatform {
360
+ * "app": {
361
+ * "android": {
362
+ * "osVer": "5.0",
363
+ * "uniVer": "x",
364
+ * "unixVer": "x"
365
+ * },
366
+ * "ios": {
367
+ * "osVer": "15.0",
368
+ * "uniVer": "√",
369
+ * "unixVer": "4.25"
370
+ * }
371
+ * },
372
+ * "web": {
373
+ * "uniVer": "x",
374
+ * "unixVer": "x"
375
+ * }
376
+ * }
377
+ */
378
+ 700607 |
379
+ /**
380
+ * 只支持iOS15以上的版本。
381
+ * @uniPlatform {
382
+ * "app": {
383
+ * "android": {
384
+ * "osVer": "5.0",
385
+ * "uniVer": "x",
386
+ * "unixVer": "x"
387
+ * },
388
+ * "ios": {
389
+ * "osVer": "15.0",
390
+ * "uniVer": "√",
391
+ * "unixVer": "4.25"
392
+ * }
393
+ * },
394
+ * "web": {
395
+ * "uniVer": "x",
396
+ * "unixVer": "x"
397
+ * }
398
+ * }
399
+ */
400
+ 700800 |
401
+ /**
402
+ * 其他未知错误。
403
+ * @uniPlatform {
404
+ * "app": {
405
+ * "android": {
406
+ * "osVer": "5.0",
407
+ * "uniVer": "x",
408
+ * "unixVer": "x"
409
+ * },
410
+ * "ios": {
411
+ * "osVer": "15.0",
412
+ * "uniVer": "√",
413
+ * "unixVer": "4.25"
414
+ * }
415
+ * },
416
+ * "web": {
417
+ * "uniVer": "x",
418
+ * "unixVer": "x"
419
+ * }
420
+ * }
421
+ */
422
+ 700000;
423
+
424
+
425
+ export type RequestVirtualPayment = (options: RequestVirtualPaymentOptions) => void;
426
+
427
+ export type AppleIAPPromotionalOffer = {
428
+ /**
429
+ * 促销id
430
+ * @uniPlatform {
431
+ * "app": {
432
+ * "android": {
433
+ * "osVer": "5.0",
434
+ * "uniVer": "x",
435
+ * "unixVer": "x"
436
+ * },
437
+ * "ios": {
438
+ * "osVer": "15.0",
439
+ * "uniVer": "√",
440
+ * "unixVer": "4.25"
441
+ * }
442
+ * },
443
+ * "web": {
444
+ * "uniVer": "x",
445
+ * "unixVer": "x"
446
+ * }
447
+ * }
448
+ */
449
+ offerIdentifier: string,
450
+ /**
451
+ * 密钥
452
+ * @uniPlatform {
453
+ * "app": {
454
+ * "android": {
455
+ * "osVer": "5.0",
456
+ * "uniVer": "x",
457
+ * "unixVer": "x"
458
+ * },
459
+ * "ios": {
460
+ * "osVer": "15.0",
461
+ * "uniVer": "√",
462
+ * "unixVer": "4.25"
463
+ * }
464
+ * },
465
+ * "web": {
466
+ * "uniVer": "x",
467
+ * "unixVer": "x"
468
+ * }
469
+ * }
470
+ */
471
+ keyIdentifier: string,
472
+ /**
473
+ * 唯一id (必须小写 24小时有效)
474
+ * @uniPlatform {
475
+ * "app": {
476
+ * "android": {
477
+ * "osVer": "5.0",
478
+ * "uniVer": "x",
479
+ * "unixVer": "x"
480
+ * },
481
+ * "ios": {
482
+ * "osVer": "15.0",
483
+ * "uniVer": "√",
484
+ * "unixVer": "4.25"
485
+ * }
486
+ * },
487
+ * "web": {
488
+ * "uniVer": "x",
489
+ * "unixVer": "x"
490
+ * }
491
+ * }
492
+ */
493
+ nonce: string,
494
+ /**
495
+ * 签名
496
+ * @uniPlatform {
497
+ * "app": {
498
+ * "android": {
499
+ * "osVer": "5.0",
500
+ * "uniVer": "x",
501
+ * "unixVer": "x"
502
+ * },
503
+ * "ios": {
504
+ * "osVer": "15.0",
505
+ * "uniVer": "√",
506
+ * "unixVer": "4.25"
507
+ * }
508
+ * },
509
+ * "web": {
510
+ * "uniVer": "x",
511
+ * "unixVer": "x"
512
+ * }
513
+ * }
514
+ */
515
+ signature: string,
516
+ /**
517
+ * 创建证书的时间戳(毫秒 24小时有效)
518
+ * @uniPlatform {
519
+ * "app": {
520
+ * "android": {
521
+ * "osVer": "5.0",
522
+ * "uniVer": "x",
523
+ * "unixVer": "x"
524
+ * },
525
+ * "ios": {
526
+ * "osVer": "15.0",
527
+ * "uniVer": "√",
528
+ * "unixVer": "4.25"
529
+ * }
530
+ * },
531
+ * "web": {
532
+ * "uniVer": "x",
533
+ * "unixVer": "x"
534
+ * }
535
+ * }
536
+ */
537
+ timestamp: number
538
+ }
539
+
540
+ export type AppleIAPTransactionOptions = {
541
+ /**
542
+ * 产品id,和苹果开发者中心配置的一样
543
+ * @uniPlatform {
544
+ * "app": {
545
+ * "android": {
546
+ * "osVer": "5.0",
547
+ * "uniVer": "x",
548
+ * "unixVer": "x"
549
+ * },
550
+ * "ios": {
551
+ * "osVer": "15.0",
552
+ * "uniVer": "√",
553
+ * "unixVer": "4.25"
554
+ * }
555
+ * },
556
+ * "web": {
557
+ * "uniVer": "x",
558
+ * "unixVer": "x"
559
+ * }
560
+ * }
561
+ */
562
+ productId: string,
563
+ /**
564
+ * 透传参数,一般用于标记订单和用户的关系,可以用来验证和关联用户账户和购买记录
565
+ * @uniPlatform {
566
+ * "app": {
567
+ * "android": {
568
+ * "osVer": "5.0",
569
+ * "uniVer": "x",
570
+ * "unixVer": "x"
571
+ * },
572
+ * "ios": {
573
+ * "osVer": "15.0",
574
+ * "uniVer": "√",
575
+ * "unixVer": "4.25"
576
+ * }
577
+ * },
578
+ * "web": {
579
+ * "uniVer": "x",
580
+ * "unixVer": "x"
581
+ * }
582
+ * }
583
+ */
584
+ appAccountToken?: string | null,
585
+ /**
586
+ * 购买数量
587
+ * @uniPlatform {
588
+ * "app": {
589
+ * "android": {
590
+ * "osVer": "5.0",
591
+ * "uniVer": "x",
592
+ * "unixVer": "x"
593
+ * },
594
+ * "ios": {
595
+ * "osVer": "15.0",
596
+ * "uniVer": "√",
597
+ * "unixVer": "4.25"
598
+ * }
599
+ * },
600
+ * "web": {
601
+ * "uniVer": "x",
602
+ * "unixVer": "x"
603
+ * }
604
+ * }
605
+ */
606
+ quantity: number,
607
+ /**
608
+ * 交易日期,示例 2022-01-01 08:00:00
609
+ * @uniPlatform {
610
+ * "app": {
611
+ * "android": {
612
+ * "osVer": "5.0",
613
+ * "uniVer": "x",
614
+ * "unixVer": "x"
615
+ * },
616
+ * "ios": {
617
+ * "osVer": "15.0",
618
+ * "uniVer": "√",
619
+ * "unixVer": "4.25"
620
+ * }
621
+ * },
622
+ * "web": {
623
+ * "uniVer": "x",
624
+ * "unixVer": "x"
625
+ * }
626
+ * }
627
+ */
628
+ transactionDate: Date,
629
+ /**
630
+ * 交易唯一标识
631
+ * @uniPlatform {
632
+ * "app": {
633
+ * "android": {
634
+ * "osVer": "5.0",
635
+ * "uniVer": "x",
636
+ * "unixVer": "x"
637
+ * },
638
+ * "ios": {
639
+ * "osVer": "15.0",
640
+ * "uniVer": "√",
641
+ * "unixVer": "4.25"
642
+ * }
643
+ * },
644
+ * "web": {
645
+ * "uniVer": "x",
646
+ * "unixVer": "x"
647
+ * }
648
+ * }
649
+ */
650
+ transactionIdentifier: string,
651
+ /**
652
+ * 原始交易日期,示例 2022-01-01 08:00:00
653
+ * @uniPlatform {
654
+ * "app": {
655
+ * "android": {
656
+ * "osVer": "5.0",
657
+ * "uniVer": "x",
658
+ * "unixVer": "x"
659
+ * },
660
+ * "ios": {
661
+ * "osVer": "15.0",
662
+ * "uniVer": "√",
663
+ * "unixVer": "4.25"
664
+ * }
665
+ * },
666
+ * "web": {
667
+ * "uniVer": "x",
668
+ * "unixVer": "x"
669
+ * }
670
+ * }
671
+ */
672
+ originalTransactionDate: Date,
673
+ /**
674
+ * 原始交易唯一标识
675
+ * @uniPlatform {
676
+ * "app": {
677
+ * "android": {
678
+ * "osVer": "5.0",
679
+ * "uniVer": "x",
680
+ * "unixVer": "x"
681
+ * },
682
+ * "ios": {
683
+ * "osVer": "15.0",
684
+ * "uniVer": "√",
685
+ * "unixVer": "4.25"
686
+ * }
687
+ * },
688
+ * "web": {
689
+ * "uniVer": "x",
690
+ * "unixVer": "x"
691
+ * }
692
+ * }
693
+ */
694
+ originalTransactionIdentifier: string,
695
+ /**
696
+ * 支付票据
697
+ * @uniPlatform {
698
+ * "app": {
699
+ * "android": {
700
+ * "osVer": "5.0",
701
+ * "uniVer": "x",
702
+ * "unixVer": "x"
703
+ * },
704
+ * "ios": {
705
+ * "osVer": "15.0",
706
+ * "uniVer": "√",
707
+ * "unixVer": "4.25"
708
+ * }
709
+ * },
710
+ * "web": {
711
+ * "uniVer": "x",
712
+ * "unixVer": "x"
713
+ * }
714
+ * }
715
+ */
716
+ jsonRepresentation: string,
717
+ }
718
+ export type GoolgeIapSuccessOptions = {
719
+
720
+ }
721
+ export type HuaweiIapSuccessOptions = {
722
+
723
+ }
724
+ export type WeixinIapSuccessOptions = {
725
+
726
+ }
727
+
728
+ export type RequestVirtualPaymentSuccess = {
729
+ /**
730
+ * 支付成功返回结果
731
+ * @uniPlatform {
732
+ * "app": {
733
+ * "android": {
734
+ * "osVer": "5.0",
735
+ * "uniVer": "x",
736
+ * "unixVer": "x"
737
+ * },
738
+ * "ios": {
739
+ * "osVer": "15.0",
740
+ * "uniVer": "√",
741
+ * "unixVer": "4.25"
742
+ * }
743
+ * },
744
+ * "web": {
745
+ * "uniVer": "x",
746
+ * "unixVer": "x"
747
+ * }
748
+ * }
749
+ */
750
+ apple?: AppleIAPTransactionOptions | null,
751
+ // google ?: GoolgeIapSuccessOptions | null,
752
+ // huawei ?: HuaweiIapSuccessOptions | null,
753
+ // weixin ?: WeixinIapSuccessOptions | null,
754
+ };
755
+ export type RequestVirtualPaymentSuccessCallback = (result: RequestVirtualPaymentSuccess) => void;
756
+ export type RequestVirtualPaymentFail = IRequestVirtualPaymentFail;
757
+ export type RequestVirtualPaymentFailCallback = (result: RequestVirtualPaymentFail) => void;
758
+ export interface IRequestVirtualPaymentFail extends IUniError {
759
+ /**
760
+ * 错误码
761
+ * @uniPlatform {
762
+ * "app": {
763
+ * "android": {
764
+ * "osVer": "5.0",
765
+ * "uniVer": "x",
766
+ * "unixVer": "x"
767
+ * },
768
+ * "ios": {
769
+ * "osVer": "15.0",
770
+ * "uniVer": "√",
771
+ * "unixVer": "4.25"
772
+ * }
773
+ * },
774
+ * "web": {
775
+ * "uniVer": "x",
776
+ * "unixVer": "x"
777
+ * }
778
+ * }
779
+ */
780
+ errCode: RequestVirtualPaymentErrorCode
781
+ };
782
+ export type RequestVirtualPaymentComplete = any
783
+ export type RequestVirtualPaymentCompleteCallback = (result: RequestVirtualPaymentComplete) => void;
784
+
785
+ export type AppleIAPOptions = {
786
+ /**
787
+ * 产品id,在苹果开发者中心配置
788
+ * @uniPlatform {
789
+ * "app": {
790
+ * "android": {
791
+ * "osVer": "5.0",
792
+ * "uniVer": "x",
793
+ * "unixVer": "x"
794
+ * },
795
+ * "ios": {
796
+ * "osVer": "15.0",
797
+ * "uniVer": "√",
798
+ * "unixVer": "4.25"
799
+ * }
800
+ * },
801
+ * "web": {
802
+ * "uniVer": "x",
803
+ * "unixVer": "x"
804
+ * }
805
+ * }
806
+ */
807
+ productId: string,
808
+ /**
809
+ * 透传参数,一般用于标记订单和用户的关系,可以用来验证和关联用户账户和购买记录
810
+ * @uniPlatform {
811
+ * "app": {
812
+ * "android": {
813
+ * "osVer": "5.0",
814
+ * "uniVer": "x",
815
+ * "unixVer": "x"
816
+ * },
817
+ * "ios": {
818
+ * "osVer": "15.0",
819
+ * "uniVer": "√",
820
+ * "unixVer": "4.25"
821
+ * }
822
+ * },
823
+ * "web": {
824
+ * "uniVer": "x",
825
+ * "unixVer": "x"
826
+ * }
827
+ * }
828
+ */
829
+ appAccountToken?: string | null,
830
+ /**
831
+ * 购买数量,默认是1,最小值是1,最大值是10
832
+ * @uniPlatform {
833
+ * "app": {
834
+ * "android": {
835
+ * "osVer": "5.0",
836
+ * "uniVer": "x",
837
+ * "unixVer": "x"
838
+ * },
839
+ * "ios": {
840
+ * "osVer": "15.0",
841
+ * "uniVer": "√",
842
+ * "unixVer": "4.25"
843
+ * }
844
+ * },
845
+ * "web": {
846
+ * "uniVer": "x",
847
+ * "unixVer": "x"
848
+ * }
849
+ * }
850
+ */
851
+ quantity: number,
852
+ /**
853
+ * 促销优惠参数说明
854
+ * @uniPlatform {
855
+ * "app": {
856
+ * "android": {
857
+ * "osVer": "5.0",
858
+ * "uniVer": "x",
859
+ * "unixVer": "x"
860
+ * },
861
+ * "ios": {
862
+ * "osVer": "15.0",
863
+ * "uniVer": "√",
864
+ * "unixVer": "4.25"
865
+ * }
866
+ * },
867
+ * "web": {
868
+ * "uniVer": "x",
869
+ * "unixVer": "x"
870
+ * }
871
+ * }
872
+ */
873
+ promotionalOffer?: AppleIAPPromotionalOffer | null
874
+ };
875
+ export type GoogleIapOptions = {
876
+
877
+ };
878
+ export type HuaweiIapOptions = {
879
+
880
+ };
881
+ export type WeixinIapOptions = {
882
+
883
+ };
884
+ export type RequestVirtualPaymentOptions = {
885
+ /**
886
+ * 苹果IAP的参数
887
+ * @uniPlatform {
888
+ * "app": {
889
+ * "android": {
890
+ * "osVer": "5.0",
891
+ * "uniVer": "x",
892
+ * "unixVer": "x"
893
+ * },
894
+ * "ios": {
895
+ * "osVer": "15.0",
896
+ * "uniVer": "√",
897
+ * "unixVer": "4.25"
898
+ * }
899
+ * },
900
+ * "web": {
901
+ * "uniVer": "x",
902
+ * "unixVer": "x"
903
+ * }
904
+ * }
905
+ */
906
+ apple?: AppleIAPOptions | null,
907
+ // /**
908
+ // * Google IAP的参数
909
+ // */
910
+ // google ?: GoogleIapOptions | null,
911
+ // /**
912
+ // * 华为 IAP的参数
913
+ // */
914
+ // huawei ?: HuaweiIapOptions | null,
915
+ // /**
916
+ // * 微信虚拟支付的参数
917
+ // */
918
+ // weixin ?: WeixinIapOptions | null,
919
+ /**
920
+ * 接口调用成功的回调函数
921
+ * @uniPlatform {
922
+ * "app": {
923
+ * "android": {
924
+ * "osVer": "5.0",
925
+ * "uniVer": "x",
926
+ * "unixVer": "x"
927
+ * },
928
+ * "ios": {
929
+ * "osVer": "15.0",
930
+ * "uniVer": "√",
931
+ * "unixVer": "4.25"
932
+ * }
933
+ * },
934
+ * "mp": {
935
+ * "weixin": {
936
+ * "hostVer": "√",
937
+ * "uniVer": "√",
938
+ * "unixVer": "4.41"
939
+ * },
940
+ * "alipay": {
941
+ * "hostVer": "√",
942
+ * "uniVer": "x",
943
+ * "unixVer": "x"
944
+ * },
945
+ * "baidu": {
946
+ * "hostVer": "√",
947
+ * "uniVer": "x",
948
+ * "unixVer": "x"
949
+ * },
950
+ * "toutiao": {
951
+ * "hostVer": "√",
952
+ * "uniVer": "x",
953
+ * "unixVer": "x"
954
+ * },
955
+ * "lark": {
956
+ * "hostVer": "√",
957
+ * "uniVer": "x",
958
+ * "unixVer": "x"
959
+ * },
960
+ * "qq": {
961
+ * "hostVer": "√",
962
+ * "uniVer": "x",
963
+ * "unixVer": "x"
964
+ * },
965
+ * "kuaishou": {
966
+ * "hostVer": "√",
967
+ * "uniVer": "x",
968
+ * "unixVer": "x"
969
+ * },
970
+ * "jd": {
971
+ * "hostVer": "√",
972
+ * "uniVer": "x",
973
+ * "unixVer": "x"
974
+ * }
975
+ * },
976
+ * "web": {
977
+ * "uniVer": "x",
978
+ * "unixVer": "x"
979
+ * }
980
+ * }
981
+ */
982
+ success?: RequestVirtualPaymentSuccessCallback | null,
983
+ /**
984
+ * 接口调用失败的回调函数
985
+ * @uniPlatform {
986
+ * "app": {
987
+ * "android": {
988
+ * "osVer": "5.0",
989
+ * "uniVer": "x",
990
+ * "unixVer": "x"
991
+ * },
992
+ * "ios": {
993
+ * "osVer": "15.0",
994
+ * "uniVer": "√",
995
+ * "unixVer": "4.25"
996
+ * }
997
+ * },
998
+ * "mp": {
999
+ * "weixin": {
1000
+ * "hostVer": "√",
1001
+ * "uniVer": "√",
1002
+ * "unixVer": "4.41"
1003
+ * },
1004
+ * "alipay": {
1005
+ * "hostVer": "√",
1006
+ * "uniVer": "x",
1007
+ * "unixVer": "x"
1008
+ * },
1009
+ * "baidu": {
1010
+ * "hostVer": "√",
1011
+ * "uniVer": "x",
1012
+ * "unixVer": "x"
1013
+ * },
1014
+ * "toutiao": {
1015
+ * "hostVer": "√",
1016
+ * "uniVer": "x",
1017
+ * "unixVer": "x"
1018
+ * },
1019
+ * "lark": {
1020
+ * "hostVer": "√",
1021
+ * "uniVer": "x",
1022
+ * "unixVer": "x"
1023
+ * },
1024
+ * "qq": {
1025
+ * "hostVer": "√",
1026
+ * "uniVer": "x",
1027
+ * "unixVer": "x"
1028
+ * },
1029
+ * "kuaishou": {
1030
+ * "hostVer": "√",
1031
+ * "uniVer": "x",
1032
+ * "unixVer": "x"
1033
+ * },
1034
+ * "jd": {
1035
+ * "hostVer": "√",
1036
+ * "uniVer": "x",
1037
+ * "unixVer": "x"
1038
+ * }
1039
+ * },
1040
+ * "web": {
1041
+ * "uniVer": "x",
1042
+ * "unixVer": "x"
1043
+ * }
1044
+ * }
1045
+ */
1046
+ fail?: RequestVirtualPaymentFailCallback | null,
1047
+ /**
1048
+ * 接口调用结束的回调函数(调用成功、失败都会执行)
1049
+ * @uniPlatform {
1050
+ * "app": {
1051
+ * "android": {
1052
+ * "osVer": "5.0",
1053
+ * "uniVer": "x",
1054
+ * "unixVer": "x"
1055
+ * },
1056
+ * "ios": {
1057
+ * "osVer": "15.0",
1058
+ * "uniVer": "√",
1059
+ * "unixVer": "4.25"
1060
+ * }
1061
+ * },
1062
+ * "mp": {
1063
+ * "weixin": {
1064
+ * "hostVer": "√",
1065
+ * "uniVer": "√",
1066
+ * "unixVer": "4.41"
1067
+ * },
1068
+ * "alipay": {
1069
+ * "hostVer": "√",
1070
+ * "uniVer": "x",
1071
+ * "unixVer": "x"
1072
+ * },
1073
+ * "baidu": {
1074
+ * "hostVer": "√",
1075
+ * "uniVer": "x",
1076
+ * "unixVer": "x"
1077
+ * },
1078
+ * "toutiao": {
1079
+ * "hostVer": "√",
1080
+ * "uniVer": "x",
1081
+ * "unixVer": "x"
1082
+ * },
1083
+ * "lark": {
1084
+ * "hostVer": "√",
1085
+ * "uniVer": "x",
1086
+ * "unixVer": "x"
1087
+ * },
1088
+ * "qq": {
1089
+ * "hostVer": "√",
1090
+ * "uniVer": "x",
1091
+ * "unixVer": "x"
1092
+ * },
1093
+ * "kuaishou": {
1094
+ * "hostVer": "√",
1095
+ * "uniVer": "x",
1096
+ * "unixVer": "x"
1097
+ * },
1098
+ * "jd": {
1099
+ * "hostVer": "√",
1100
+ * "uniVer": "x",
1101
+ * "unixVer": "x"
1102
+ * }
1103
+ * },
1104
+ * "web": {
1105
+ * "uniVer": "x",
1106
+ * "unixVer": "x"
1107
+ * }
1108
+ * }
1109
+ */
1110
+ complete?: RequestVirtualPaymentCompleteCallback | null
1111
+ };
1112
+
1113
+
1114
+ //restoreTransactions
1115
+ export type RestoreTransactions = (options: AppleIAPRestoreOptions) => void;
1116
+ export type AppleIAPRestoreSuccess = {
1117
+ /**
1118
+ * 返回的交易列表
1119
+ * @uniPlatform {
1120
+ * "app": {
1121
+ * "android": {
1122
+ * "osVer": "5.0",
1123
+ * "uniVer": "x",
1124
+ * "unixVer": "x"
1125
+ * },
1126
+ * "ios": {
1127
+ * "osVer": "15.0",
1128
+ * "uniVer": "√",
1129
+ * "unixVer": "4.25"
1130
+ * }
1131
+ * },
1132
+ * "web": {
1133
+ * "uniVer": "x",
1134
+ * "unixVer": "x"
1135
+ * }
1136
+ * }
1137
+ */
1138
+ transactions?: AppleIAPTransactionOptions[] | null
1139
+ };
1140
+ export type AppleIAPRestoreSuccessCallback = (result: AppleIAPRestoreSuccess) => void;
1141
+ export type AppleIAPRestoreFail = IAppleIAPRestoreFail;
1142
+ export type AppleIAPRestoreFailCallback = (result: AppleIAPRestoreFail) => void;
1143
+ export interface IAppleIAPRestoreFail extends IUniError {
1144
+ /**
1145
+ * 错误码
1146
+ * @uniPlatform {
1147
+ * "app": {
1148
+ * "android": {
1149
+ * "osVer": "5.0",
1150
+ * "uniVer": "x",
1151
+ * "unixVer": "x"
1152
+ * },
1153
+ * "ios": {
1154
+ * "osVer": "15.0",
1155
+ * "uniVer": "√",
1156
+ * "unixVer": "4.25"
1157
+ * }
1158
+ * },
1159
+ * "web": {
1160
+ * "uniVer": "x",
1161
+ * "unixVer": "x"
1162
+ * }
1163
+ * }
1164
+ */
1165
+ errCode: AppleIAPRestoreErrorCode
1166
+ };
1167
+ export type AppleIAPRestoreComplete = any
1168
+ export type AppleIAPRestoreCompleteCallback = (result: AppleIAPRestoreComplete) => void;
1169
+ /**
1170
+ * 错误码
1171
+ */
1172
+ export type AppleIAPRestoreErrorCode =
1173
+ /**
1174
+ * apple restore 请求失败。
1175
+ * @uniPlatform {
1176
+ * "app": {
1177
+ * "android": {
1178
+ * "osVer": "5.0",
1179
+ * "uniVer": "x",
1180
+ * "unixVer": "x"
1181
+ * },
1182
+ * "ios": {
1183
+ * "osVer": "15.0",
1184
+ * "uniVer": "√",
1185
+ * "unixVer": "4.25"
1186
+ * }
1187
+ * },
1188
+ * "web": {
1189
+ * "uniVer": "x",
1190
+ * "unixVer": "x"
1191
+ * }
1192
+ * }
1193
+ */
1194
+ 700600 |
1195
+ /**
1196
+ * 用户中途取消。
1197
+ * @uniPlatform {
1198
+ * "app": {
1199
+ * "android": {
1200
+ * "osVer": "5.0",
1201
+ * "uniVer": "x",
1202
+ * "unixVer": "x"
1203
+ * },
1204
+ * "ios": {
1205
+ * "osVer": "15.0",
1206
+ * "uniVer": "√",
1207
+ * "unixVer": "4.25"
1208
+ * }
1209
+ * },
1210
+ * "web": {
1211
+ * "uniVer": "x",
1212
+ * "unixVer": "x"
1213
+ * }
1214
+ * }
1215
+ */
1216
+ 700601 |
1217
+ /**
1218
+ * 网络连接出错。
1219
+ * @uniPlatform {
1220
+ * "app": {
1221
+ * "android": {
1222
+ * "osVer": "5.0",
1223
+ * "uniVer": "x",
1224
+ * "unixVer": "x"
1225
+ * },
1226
+ * "ios": {
1227
+ * "osVer": "15.0",
1228
+ * "uniVer": "√",
1229
+ * "unixVer": "4.25"
1230
+ * }
1231
+ * },
1232
+ * "web": {
1233
+ * "uniVer": "x",
1234
+ * "unixVer": "x"
1235
+ * }
1236
+ * }
1237
+ */
1238
+ 700602 |
1239
+ /**
1240
+ * 只支持iOS15以上的版本。
1241
+ * @uniPlatform {
1242
+ * "app": {
1243
+ * "android": {
1244
+ * "osVer": "5.0",
1245
+ * "uniVer": "x",
1246
+ * "unixVer": "x"
1247
+ * },
1248
+ * "ios": {
1249
+ * "osVer": "15.0",
1250
+ * "uniVer": "√",
1251
+ * "unixVer": "4.25"
1252
+ * }
1253
+ * },
1254
+ * "web": {
1255
+ * "uniVer": "x",
1256
+ * "unixVer": "x"
1257
+ * }
1258
+ * }
1259
+ */
1260
+ 700800;
1261
+
1262
+
1263
+ export type AppleIAPRestoreOptions = {
1264
+ /**
1265
+ * 接口调用成功的回调函数
1266
+ * @uniPlatform {
1267
+ * "app": {
1268
+ * "android": {
1269
+ * "osVer": "5.0",
1270
+ * "uniVer": "x",
1271
+ * "unixVer": "x"
1272
+ * },
1273
+ * "ios": {
1274
+ * "osVer": "15.0",
1275
+ * "uniVer": "√",
1276
+ * "unixVer": "4.25"
1277
+ * }
1278
+ * },
1279
+ * "web": {
1280
+ * "uniVer": "x",
1281
+ * "unixVer": "x"
1282
+ * }
1283
+ * }
1284
+ */
1285
+ success?: AppleIAPRestoreSuccessCallback | null,
1286
+ /**
1287
+ * 接口调用失败的回调函数
1288
+ * @uniPlatform {
1289
+ * "app": {
1290
+ * "android": {
1291
+ * "osVer": "5.0",
1292
+ * "uniVer": "x",
1293
+ * "unixVer": "x"
1294
+ * },
1295
+ * "ios": {
1296
+ * "osVer": "15.0",
1297
+ * "uniVer": "√",
1298
+ * "unixVer": "4.25"
1299
+ * }
1300
+ * },
1301
+ * "web": {
1302
+ * "uniVer": "x",
1303
+ * "unixVer": "x"
1304
+ * }
1305
+ * }
1306
+ */
1307
+ fail?: AppleIAPRestoreFailCallback | null,
1308
+ /**
1309
+ * 接口调用结束的回调函数(调用成功、失败都会执行)
1310
+ * @uniPlatform {
1311
+ * "app": {
1312
+ * "android": {
1313
+ * "osVer": "5.0",
1314
+ * "uniVer": "x",
1315
+ * "unixVer": "x"
1316
+ * },
1317
+ * "ios": {
1318
+ * "osVer": "15.0",
1319
+ * "uniVer": "√",
1320
+ * "unixVer": "4.25"
1321
+ * }
1322
+ * },
1323
+ * "web": {
1324
+ * "uniVer": "x",
1325
+ * "unixVer": "x"
1326
+ * }
1327
+ * }
1328
+ */
1329
+ complete?: AppleIAPRestoreCompleteCallback | null
1330
+ };
1331
+
1332
+
1333
+
1334
+ //getUnfinishedTransactions
1335
+ export type GetUnfinishedTransactions = (options: AppleIAPUnfinishedTransactionOptions) => void;
1336
+ export type AppleIAPUnfinishedTransactionSuccess = {
1337
+ /**
1338
+ * 返回的交易列表
1339
+ * @uniPlatform {
1340
+ * "app": {
1341
+ * "android": {
1342
+ * "osVer": "5.0",
1343
+ * "uniVer": "x",
1344
+ * "unixVer": "x"
1345
+ * },
1346
+ * "ios": {
1347
+ * "osVer": "15.0",
1348
+ * "uniVer": "√",
1349
+ * "unixVer": "4.25"
1350
+ * }
1351
+ * },
1352
+ * "web": {
1353
+ * "uniVer": "x",
1354
+ * "unixVer": "x"
1355
+ * }
1356
+ * }
1357
+ */
1358
+ transactions?: AppleIAPTransactionOptions[] | null
1359
+ };
1360
+ export type AppleIAPUnfinishedTransactionSuccessCallback = (result: AppleIAPUnfinishedTransactionSuccess) => void;
1361
+ export type AppleIAPUnfinishedTransactionFail = IAppleIAPUnfinishedTransactionFail;
1362
+ export type AppleIAPUnfinishedTransactionFailCallback = (result: AppleIAPUnfinishedTransactionFail) => void;
1363
+ export interface IAppleIAPUnfinishedTransactionFail extends IUniError {
1364
+ /**
1365
+ * 错误码
1366
+ * @uniPlatform {
1367
+ * "app": {
1368
+ * "android": {
1369
+ * "osVer": "5.0",
1370
+ * "uniVer": "x",
1371
+ * "unixVer": "x"
1372
+ * },
1373
+ * "ios": {
1374
+ * "osVer": "15.0",
1375
+ * "uniVer": "√",
1376
+ * "unixVer": "4.25"
1377
+ * }
1378
+ * },
1379
+ * "web": {
1380
+ * "uniVer": "x",
1381
+ * "unixVer": "x"
1382
+ * }
1383
+ * }
1384
+ */
1385
+ errCode: AppleIAPUnfinishedTransactionErrorCode
1386
+ };
1387
+ export type AppleIAPUnfinishedTransactionComplete = any
1388
+ export type AppleIAPUnfinishedTransactionCompleteCallback = (result: AppleIAPUnfinishedTransactionComplete) => void;
1389
+ /**
1390
+ * 错误码
1391
+ * - 700800 只支持iOS15以上的版本。
1392
+ */
1393
+ export type AppleIAPUnfinishedTransactionErrorCode = 700800;
1394
+
1395
+ export type AppleIAPUnfinishedTransactionOptions = {
1396
+ /**
1397
+ * 接口调用成功的回调函数
1398
+ * @uniPlatform {
1399
+ * "app": {
1400
+ * "android": {
1401
+ * "osVer": "5.0",
1402
+ * "uniVer": "x",
1403
+ * "unixVer": "x"
1404
+ * },
1405
+ * "ios": {
1406
+ * "osVer": "15.0",
1407
+ * "uniVer": "√",
1408
+ * "unixVer": "4.25"
1409
+ * }
1410
+ * },
1411
+ * "web": {
1412
+ * "uniVer": "x",
1413
+ * "unixVer": "x"
1414
+ * }
1415
+ * }
1416
+ */
1417
+ success?: AppleIAPUnfinishedTransactionSuccessCallback | null,
1418
+ /**
1419
+ * 接口调用失败的回调函数
1420
+ * @uniPlatform {
1421
+ * "app": {
1422
+ * "android": {
1423
+ * "osVer": "5.0",
1424
+ * "uniVer": "x",
1425
+ * "unixVer": "x"
1426
+ * },
1427
+ * "ios": {
1428
+ * "osVer": "15.0",
1429
+ * "uniVer": "√",
1430
+ * "unixVer": "4.25"
1431
+ * }
1432
+ * },
1433
+ * "web": {
1434
+ * "uniVer": "x",
1435
+ * "unixVer": "x"
1436
+ * }
1437
+ * }
1438
+ */
1439
+ fail?: AppleIAPUnfinishedTransactionFailCallback | null,
1440
+ /**
1441
+ * 接口调用结束的回调函数(调用成功、失败都会执行)
1442
+ * @uniPlatform {
1443
+ * "app": {
1444
+ * "android": {
1445
+ * "osVer": "5.0",
1446
+ * "uniVer": "x",
1447
+ * "unixVer": "x"
1448
+ * },
1449
+ * "ios": {
1450
+ * "osVer": "15.0",
1451
+ * "uniVer": "√",
1452
+ * "unixVer": "4.25"
1453
+ * }
1454
+ * },
1455
+ * "web": {
1456
+ * "uniVer": "x",
1457
+ * "unixVer": "x"
1458
+ * }
1459
+ * }
1460
+ */
1461
+ complete?: AppleIAPUnfinishedTransactionCompleteCallback | null
1462
+ };
1463
+
1464
+
1465
+
1466
+ //finishTransaction 相关定义
1467
+ export type FinishTransaction = (options: AppleIAPFinishTransactionOptions) => void;
1468
+ export type AppleIAPFinishTransactionSuccess = {
1469
+ /**
1470
+ * 关单状态
1471
+ * @uniPlatform {
1472
+ * "app": {
1473
+ * "android": {
1474
+ * "osVer": "5.0",
1475
+ * "uniVer": "x",
1476
+ * "unixVer": "x"
1477
+ * },
1478
+ * "ios": {
1479
+ * "osVer": "15.0",
1480
+ * "uniVer": "√",
1481
+ * "unixVer": "4.25"
1482
+ * }
1483
+ * },
1484
+ * "web": {
1485
+ * "uniVer": "x",
1486
+ * "unixVer": "x"
1487
+ * }
1488
+ * }
1489
+ */
1490
+ state?: boolean | null
1491
+ };
1492
+ export type AppleIAPFinishTransactionSuccessCallback = (result: AppleIAPFinishTransactionSuccess) => void;
1493
+ export type AppleIAPFinishTransactionFail = IAppleIAPFinishTransactionFail;
1494
+ export type AppleIAPFinishTransactionFailCallback = (result: AppleIAPFinishTransactionFail) => void;
1495
+ export interface IAppleIAPFinishTransactionFail extends IUniError {
1496
+ /**
1497
+ * 错误码
1498
+ * @uniPlatform {
1499
+ * "app": {
1500
+ * "android": {
1501
+ * "osVer": "5.0",
1502
+ * "uniVer": "x",
1503
+ * "unixVer": "x"
1504
+ * },
1505
+ * "ios": {
1506
+ * "osVer": "15.0",
1507
+ * "uniVer": "√",
1508
+ * "unixVer": "4.25"
1509
+ * }
1510
+ * },
1511
+ * "web": {
1512
+ * "uniVer": "x",
1513
+ * "unixVer": "x"
1514
+ * }
1515
+ * }
1516
+ */
1517
+ errCode: AppleIAPFinishTransactionFailErrorCode
1518
+ };
1519
+ export type AppleIAPFinishTransactionComplete = any
1520
+ export type AppleIAPFinishTransactionCompleteCallback = (result: AppleIAPFinishTransactionComplete) => void;
1521
+ /**
1522
+ * 错误码
1523
+ */
1524
+ export type AppleIAPFinishTransactionFailErrorCode =
1525
+ /**
1526
+ * 没有该交易。
1527
+ * @uniPlatform {
1528
+ * "app": {
1529
+ * "android": {
1530
+ * "osVer": "5.0",
1531
+ * "uniVer": "x",
1532
+ * "unixVer": "x"
1533
+ * },
1534
+ * "ios": {
1535
+ * "osVer": "15.0",
1536
+ * "uniVer": "√",
1537
+ * "unixVer": "4.25"
1538
+ * }
1539
+ * },
1540
+ * "web": {
1541
+ * "uniVer": "x",
1542
+ * "unixVer": "x"
1543
+ * }
1544
+ * }
1545
+ */
1546
+ 700600 |
1547
+ /**
1548
+ * 只支持iOS15以上的版本。
1549
+ * @uniPlatform {
1550
+ * "app": {
1551
+ * "android": {
1552
+ * "osVer": "5.0",
1553
+ * "uniVer": "x",
1554
+ * "unixVer": "x"
1555
+ * },
1556
+ * "ios": {
1557
+ * "osVer": "15.0",
1558
+ * "uniVer": "√",
1559
+ * "unixVer": "4.25"
1560
+ * }
1561
+ * },
1562
+ * "web": {
1563
+ * "uniVer": "x",
1564
+ * "unixVer": "x"
1565
+ * }
1566
+ * }
1567
+ */
1568
+ 700800;
1569
+
1570
+
1571
+ export type AppleIAPFinishTransactionOptions = {
1572
+ /**
1573
+ * 交易对象
1574
+ * @uniPlatform {
1575
+ * "app": {
1576
+ * "android": {
1577
+ * "osVer": "5.0",
1578
+ * "uniVer": "x",
1579
+ * "unixVer": "x"
1580
+ * },
1581
+ * "ios": {
1582
+ * "osVer": "15.0",
1583
+ * "uniVer": "√",
1584
+ * "unixVer": "4.25"
1585
+ * }
1586
+ * },
1587
+ * "web": {
1588
+ * "uniVer": "x",
1589
+ * "unixVer": "x"
1590
+ * }
1591
+ * }
1592
+ */
1593
+ transaction: AppleIAPTransactionOptions
1594
+ /**
1595
+ * 接口调用成功的回调函数
1596
+ * @uniPlatform {
1597
+ * "app": {
1598
+ * "android": {
1599
+ * "osVer": "5.0",
1600
+ * "uniVer": "x",
1601
+ * "unixVer": "x"
1602
+ * },
1603
+ * "ios": {
1604
+ * "osVer": "15.0",
1605
+ * "uniVer": "√",
1606
+ * "unixVer": "4.25"
1607
+ * }
1608
+ * },
1609
+ * "web": {
1610
+ * "uniVer": "x",
1611
+ * "unixVer": "x"
1612
+ * }
1613
+ * }
1614
+ */
1615
+ success?: AppleIAPFinishTransactionSuccessCallback | null,
1616
+ /**
1617
+ * 接口调用失败的回调函数
1618
+ * @uniPlatform {
1619
+ * "app": {
1620
+ * "android": {
1621
+ * "osVer": "5.0",
1622
+ * "uniVer": "x",
1623
+ * "unixVer": "x"
1624
+ * },
1625
+ * "ios": {
1626
+ * "osVer": "15.0",
1627
+ * "uniVer": "√",
1628
+ * "unixVer": "4.25"
1629
+ * }
1630
+ * },
1631
+ * "web": {
1632
+ * "uniVer": "x",
1633
+ * "unixVer": "x"
1634
+ * }
1635
+ * }
1636
+ */
1637
+ fail?: AppleIAPFinishTransactionFailCallback | null,
1638
+ /**
1639
+ * 接口调用结束的回调函数(调用成功、失败都会执行)
1640
+ * @uniPlatform {
1641
+ * "app": {
1642
+ * "android": {
1643
+ * "osVer": "5.0",
1644
+ * "uniVer": "x",
1645
+ * "unixVer": "x"
1646
+ * },
1647
+ * "ios": {
1648
+ * "osVer": "15.0",
1649
+ * "uniVer": "√",
1650
+ * "unixVer": "4.25"
1651
+ * }
1652
+ * },
1653
+ * "web": {
1654
+ * "uniVer": "x",
1655
+ * "unixVer": "x"
1656
+ * }
1657
+ * }
1658
+ */
1659
+ complete?: AppleIAPFinishTransactionCompleteCallback | null
1660
+ };