wxpay-node-v3 4.0.4

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.
@@ -0,0 +1,557 @@
1
+ /**
2
+ * 统一返回格式
3
+ */
4
+ export interface Output {
5
+ /** http 状态 */
6
+ status: number;
7
+ /** 报错时返回的 text */
8
+ error?: any;
9
+ /** 原错误信息 */
10
+ errRaw?: any;
11
+ /** body 返回参数 */
12
+ data?: any;
13
+ }
14
+ /**
15
+ * 发起商家转账零钱
16
+ */
17
+ export declare namespace BatchesTransfer {
18
+ interface TransferDetailList {
19
+ /** 商家明细单号 */
20
+ out_detail_no: string;
21
+ /** 转账金额 */
22
+ transfer_amount: number;
23
+ /** 转账备注 */
24
+ transfer_remark: string;
25
+ /** 用户在直连商户应用下的用户标示 */
26
+ openid: string;
27
+ /** 收款用户姓名 */
28
+ user_name?: string;
29
+ }
30
+ /**
31
+ * 发起商家转账API 请求参数
32
+ */
33
+ interface Input {
34
+ /** 直连商户的appid -不传 默认使用初始化数据 */
35
+ appid?: string;
36
+ /** 商家批次单号 */
37
+ out_batch_no: string;
38
+ /** 批次名称 */
39
+ batch_name: string;
40
+ /** 批次备注 */
41
+ batch_remark: string;
42
+ /** 转账总金额 */
43
+ total_amount: number;
44
+ /** 转账总笔数 */
45
+ total_num: number;
46
+ /** 转账明细列表 */
47
+ transfer_detail_list: TransferDetailList[];
48
+ /** 转账场景ID */
49
+ transfer_scene_id?: string;
50
+ /** 微信平台证书序列号-Wechatpay-Serial(当有敏感信息加密时,需要当前参数) */
51
+ wx_serial_no?: string;
52
+ }
53
+ interface DataOutput {
54
+ out_batch_no: string;
55
+ batch_id: string;
56
+ create_time: Date;
57
+ }
58
+ /**
59
+ * 发起商家转账API 返回参数
60
+ */
61
+ interface IOutput extends Output {
62
+ data?: DataOutput;
63
+ }
64
+ /**
65
+ * 转账批次单
66
+ */
67
+ interface QueryTransferBatch {
68
+ /** 微信支付分配的商户号 */
69
+ mchid: string;
70
+ /** 商户系统内部的商家批次单号,在商户系统内部唯一 */
71
+ out_batch_no: string;
72
+ /** 微信批次单号,微信商家转账系统返回的唯一标识 */
73
+ batch_id: string;
74
+ /** 申请商户号的appid或商户号绑定的appid(企业号corpid即为此appid) */
75
+ appid: string;
76
+ /** 批次状态 */
77
+ batch_status: string;
78
+ /** 批次类型 */
79
+ batch_type: string;
80
+ /** 该笔批量转账的名称 */
81
+ batch_name: string;
82
+ /** 转账说明,UTF8编码,最多允许32个字符 */
83
+ batch_remark: string;
84
+ /** 批次关闭原因 */
85
+ close_reason?: string;
86
+ /** 转账总金额 */
87
+ total_amount: number;
88
+ /** 转账总笔数 */
89
+ total_num: number;
90
+ /** 批次创建时间 */
91
+ create_time?: Date;
92
+ /** 批次更新时间 */
93
+ update_time?: Date;
94
+ /** 转账成功金额 */
95
+ success_amount?: number;
96
+ /** 转账成功笔数 */
97
+ success_num?: number;
98
+ /** 转账失败金额 */
99
+ fail_amount?: number;
100
+ /** 转账失败笔数 */
101
+ fail_num?: number;
102
+ }
103
+ /**
104
+ * 转账明细单列表
105
+ */
106
+ interface QueryTransferDetailList {
107
+ /** 微信明细单号 */
108
+ detail_id: string;
109
+ /** 商家明细单号 */
110
+ out_detail_no: string;
111
+ /** 明细状态 */
112
+ detail_status: string;
113
+ }
114
+ /**
115
+ * 商家批次单号查询批次单API
116
+ */
117
+ namespace QueryBatchesTransferList {
118
+ /**
119
+ * 商家批次单号查询参数
120
+ */
121
+ interface Input {
122
+ /**商户系统内部的商家批次单号,要求此参数只能由数字、大小写字母组成,在商户系统内部唯一 */
123
+ out_batch_no: string;
124
+ /**商户可选择是否查询指定状态的转账明细单,当转账批次单状态为“FINISHED”(已完成)时,才会返回满足条件的转账明细单 */
125
+ need_query_detail: boolean;
126
+ /**该次请求资源(转账明细单)的起始位置,从0开始,默认值为0 */
127
+ offset?: number;
128
+ /**该次请求可返回的最大资源(转账明细单)条数,最小20条,最大100条,不传则默认20条。不足20条按实际条数返回 */
129
+ limit?: number;
130
+ /**查询指定状态的转账明细单,当need_query_detail为true时,该字段必填 */
131
+ detail_status?: 'ALL' | 'SUCCESS' | 'FAIL';
132
+ }
133
+ interface IOutput extends Output {
134
+ data?: {
135
+ limit: number;
136
+ offset: number;
137
+ transfer_batch: QueryTransferBatch;
138
+ transfer_detail_list: QueryTransferDetailList[];
139
+ };
140
+ }
141
+ }
142
+ /**
143
+ * 微信批次单号查询批次单API
144
+ */
145
+ namespace QueryBatchesTransferByWx {
146
+ interface Input {
147
+ /** 微信批次单号,微信商家转账系统返回的唯一标识 */
148
+ batch_id: string;
149
+ /**商户可选择是否查询指定状态的转账明细单,当转账批次单状态为“FINISHED”(已完成)时,才会返回满足条件的转账明细单 */
150
+ need_query_detail: boolean;
151
+ /**该次请求资源(转账明细单)的起始位置,从0开始,默认值为0 */
152
+ offset?: number;
153
+ /**该次请求可返回的最大资源(转账明细单)条数,最小20条,最大100条,不传则默认20条。不足20条按实际条数返回 */
154
+ limit?: number;
155
+ /**查询指定状态的转账明细单,当need_query_detail为true时,该字段必填 */
156
+ detail_status?: 'ALL' | 'SUCCESS' | 'FAIL';
157
+ }
158
+ interface IOutput extends Output {
159
+ data?: {
160
+ limit: number;
161
+ offset: number;
162
+ transfer_batch: QueryTransferBatch;
163
+ transfer_detail_list: QueryTransferDetailList[];
164
+ };
165
+ }
166
+ }
167
+ /**
168
+ * 微信明细单号查询明细单API
169
+ */
170
+ namespace QueryBatchesTransferDetailByWx {
171
+ interface Input {
172
+ /** 微信批次单号 */
173
+ batch_id: string;
174
+ /** 微信明细单号 */
175
+ detail_id: string;
176
+ }
177
+ interface DetailOutput {
178
+ /** 商户号 */
179
+ mchid: string;
180
+ /** 商家批次单号 */
181
+ out_batch_no: string;
182
+ /** 微信批次单号 */
183
+ batch_id: string;
184
+ /** 直连商户的appid */
185
+ appid: string;
186
+ /** 商家明细单号 */
187
+ out_detail_no: string;
188
+ /** 微信明细单号 */
189
+ detail_id: string;
190
+ /** 明细状态 */
191
+ detail_status: string;
192
+ /** 转账金额 */
193
+ transfer_amount: number;
194
+ /** 转账备注 */
195
+ transfer_remark: string;
196
+ /** 明细失败原因 */
197
+ fail_reason?: string;
198
+ /** 用户在直连商户应用下的用户标示 */
199
+ openid: string;
200
+ /** 收款用户姓名 */
201
+ user_name?: string;
202
+ /** 转账发起时间 */
203
+ initiate_time: Date;
204
+ /** 明细更新时间 */
205
+ update_time: Date;
206
+ }
207
+ interface IOutput extends Output {
208
+ data?: DetailOutput;
209
+ }
210
+ }
211
+ /**
212
+ * 商家明细单号查询明细单API
213
+ */
214
+ namespace QueryBatchesTransferDetail {
215
+ interface Input {
216
+ /** 商家明细单号 */
217
+ out_detail_no: string;
218
+ /** 商家批次单号 */
219
+ out_batch_no: string;
220
+ }
221
+ interface DetailOutput {
222
+ /** 商户号 */
223
+ mchid: string;
224
+ /** 商家批次单号 */
225
+ out_batch_no: string;
226
+ /** 微信批次单号 */
227
+ batch_id: string;
228
+ /** 直连商户的appid */
229
+ appid: string;
230
+ /** 商家明细单号 */
231
+ out_detail_no: string;
232
+ /** 微信明细单号 */
233
+ detail_id: string;
234
+ /** 明细状态 */
235
+ detail_status: string;
236
+ /** 转账金额 */
237
+ transfer_amount: number;
238
+ /** 转账备注 */
239
+ transfer_remark: string;
240
+ /** 明细失败原因 */
241
+ fail_reason?: string;
242
+ /** 用户在直连商户应用下的用户标示 */
243
+ openid: string;
244
+ /** 收款用户姓名 */
245
+ user_name?: string;
246
+ /** 转账发起时间 */
247
+ initiate_time: Date;
248
+ /** 明细更新时间 */
249
+ update_time: Date;
250
+ }
251
+ interface IOutput extends Output {
252
+ data?: DetailOutput;
253
+ }
254
+ }
255
+ }
256
+ /**
257
+ * 分账
258
+ */
259
+ export declare namespace ProfitSharing {
260
+ interface ProfitSharingOrdersReceiversOutput {
261
+ /** 分账接收方类型 */
262
+ type: 'MERCHANT_ID' | 'PERSONAL_OPENID';
263
+ /** 分账接收方账号 */
264
+ account: string;
265
+ /** 分账金额 */
266
+ amount: number;
267
+ /** 分账描述 */
268
+ description: string;
269
+ /** 分账结果 */
270
+ result: string;
271
+ /** 分账失败原因 */
272
+ fail_reason: string;
273
+ /** 分账创建时间 */
274
+ create_time: string;
275
+ /** 分账完成时间 */
276
+ finish_time: string;
277
+ /** 分账明细单号 */
278
+ detail_id: string;
279
+ }
280
+ interface ProfitSharingOrderDetailOutput {
281
+ /** 微信订单号 */
282
+ transaction_id: string;
283
+ /** 商户分账单号 */
284
+ out_order_no: string;
285
+ /** 微信分账单号 */
286
+ order_id: string;
287
+ /** 分账单状态 */
288
+ state: string;
289
+ /** 分账接收方列表 */
290
+ receivers?: ProfitSharingOrdersReceiversOutput[];
291
+ }
292
+ /**
293
+ * 请求分账
294
+ */
295
+ namespace CreateProfitSharingOrders {
296
+ interface Input {
297
+ /** 微信分配的商户appid 不传 使用默认 */
298
+ appid?: string;
299
+ /** 微信订单号 */
300
+ transaction_id: string;
301
+ /** 商户分账单号 */
302
+ out_order_no: string;
303
+ /** 分账接收方列表 */
304
+ receivers: CreateProfitSharingOrdersReceivers[];
305
+ /** 是否解冻剩余未分资金 */
306
+ unfreeze_unsplit: boolean;
307
+ /** 当有敏感信息加密 必填 */
308
+ wx_serial_no?: string;
309
+ }
310
+ interface CreateProfitSharingOrdersReceivers {
311
+ /** 分账接收方类型 */
312
+ type: 'MERCHANT_ID' | 'PERSONAL_OPENID';
313
+ /** 分账接收方账号 */
314
+ account: string;
315
+ /** 分账个人接收方姓名 */
316
+ name?: string;
317
+ /** 分账金额 */
318
+ amount: number;
319
+ /** 分账描述 */
320
+ description: string;
321
+ }
322
+ interface IOutput extends Output {
323
+ data?: ProfitSharingOrderDetailOutput;
324
+ }
325
+ }
326
+ /**
327
+ * 分账回退
328
+ */
329
+ namespace ProfitSharingReturnOrders {
330
+ interface Input {
331
+ /** 微信分账单号 */
332
+ order_id?: string;
333
+ /** 商户分账单号 */
334
+ out_order_no?: string;
335
+ /** 商户回退单号 */
336
+ out_return_no: string;
337
+ /** 回退商户号 */
338
+ return_mchid: string;
339
+ /** 回退金额 */
340
+ amount: number;
341
+ /** 回退描述 */
342
+ description: string;
343
+ }
344
+ interface IOutput extends Output {
345
+ data?: IDetail;
346
+ }
347
+ interface IDetail {
348
+ /** 微信分账单号 */
349
+ order_id: string;
350
+ /** 商户分账单号 */
351
+ out_order_no: string;
352
+ /** 商户回退单号 */
353
+ out_return_no: string;
354
+ /** 微信回退单号 */
355
+ return_id: string;
356
+ /** 回退商户号 */
357
+ return_mchid: string;
358
+ /** 回退金额 */
359
+ amount: number;
360
+ /** 回退描述 */
361
+ description: string;
362
+ /** 回退结果 */
363
+ result: string;
364
+ /** 失败原因 */
365
+ fail_reason: string;
366
+ /** 创建时间 */
367
+ create_time: string;
368
+ /** 完成时间 */
369
+ finish_time: string;
370
+ }
371
+ }
372
+ /**
373
+ * 解冻剩余资金
374
+ */
375
+ namespace ProfitsharingOrdersUnfreeze {
376
+ interface Input {
377
+ /** 微信订单号 */
378
+ transaction_id: string;
379
+ /** 商户分账单号 */
380
+ out_order_no: string;
381
+ /** 分账描述 */
382
+ description: string;
383
+ }
384
+ type IOutput = ProfitSharing.CreateProfitSharingOrders.IOutput;
385
+ }
386
+ namespace QueryProfitSharingAmounts {
387
+ interface IOutput extends Output {
388
+ data?: {
389
+ transaction_id: string;
390
+ unsplit_amount: number;
391
+ };
392
+ }
393
+ }
394
+ namespace ProfitSharingReceiversAdd {
395
+ interface Input {
396
+ /** 应用ID */
397
+ appid?: string;
398
+ /** 分账接收方类型 */
399
+ type: string;
400
+ /** 分账接收方账号 */
401
+ account: string;
402
+ /** 分账个人接收方姓名 */
403
+ name?: string;
404
+ /** 与分账方的关系类型 */
405
+ relation_type: string;
406
+ /** 自定义的分账关系 */
407
+ custom_relation?: string;
408
+ /** 当有敏感信息加密 必填 */
409
+ wx_serial_no?: string;
410
+ }
411
+ interface IOutput extends Output {
412
+ data?: {
413
+ /** 分账接收方类型 */
414
+ type: string;
415
+ /** 分账接收方账号 */
416
+ account: number;
417
+ /** 分账个人接收方姓名 */
418
+ name?: string;
419
+ /** 与分账方的关系类型 */
420
+ relation_type: string;
421
+ /** 自定义的分账关系 */
422
+ custom_relation?: string;
423
+ };
424
+ }
425
+ }
426
+ namespace ProfitSharingReceiversDelete {
427
+ interface Input {
428
+ /** 应用ID */
429
+ appid?: string;
430
+ /** 分账接收方类型 */
431
+ type: string;
432
+ /** 分账接收方账号 */
433
+ account: string;
434
+ }
435
+ interface IOutput extends Output {
436
+ data?: {
437
+ /** 分账接收方类型 */
438
+ type: string;
439
+ /** 分账接收方账号 */
440
+ account: string;
441
+ };
442
+ }
443
+ }
444
+ namespace ProfitSharingBills {
445
+ interface IOutput extends Output {
446
+ data?: {
447
+ /** 哈希类型 */
448
+ hash_type: string;
449
+ /** 哈希值 */
450
+ hash_value: string;
451
+ /** 账单下载地址 */
452
+ download_url: string;
453
+ };
454
+ }
455
+ }
456
+ }
457
+ export declare namespace Refunds {
458
+ interface DataOutput {
459
+ refund_id: string;
460
+ out_refund_no: string;
461
+ transaction_id: string;
462
+ out_trade_no: string;
463
+ channel: string;
464
+ user_received_account: string;
465
+ success_time: string;
466
+ create_time: string;
467
+ status: string;
468
+ funds_account: string;
469
+ amount: {
470
+ total: number;
471
+ refund: number;
472
+ from: {
473
+ account: string;
474
+ amount: number;
475
+ }[];
476
+ payer_total: number;
477
+ payer_refund: number;
478
+ settlement_refund: number;
479
+ settlement_total: number;
480
+ discount_refund: number;
481
+ currency: string;
482
+ refund_fee: number;
483
+ };
484
+ promotion_detail: {
485
+ promotion_id: string;
486
+ scope: string;
487
+ type: string;
488
+ amount: number;
489
+ refund_amount: number;
490
+ goods_detail: {
491
+ merchant_goods_id: string;
492
+ wechatpay_goods_id: string;
493
+ goods_name: string;
494
+ unit_price: number;
495
+ refund_amount: number;
496
+ refund_quantity: number;
497
+ }[];
498
+ }[];
499
+ }
500
+ interface IOutput extends Output {
501
+ data?: DataOutput;
502
+ }
503
+ }
504
+ export declare namespace FindRefunds {
505
+ interface DataOutput {
506
+ refund_id: string;
507
+ out_refund_no: string;
508
+ transaction_id: string;
509
+ out_trade_no: string;
510
+ channel: string;
511
+ user_received_account: string;
512
+ success_time: string;
513
+ create_time: string;
514
+ status: string;
515
+ funds_account: string;
516
+ amount: {
517
+ total: number;
518
+ refund: number;
519
+ from: {
520
+ account: string;
521
+ amount: number;
522
+ }[];
523
+ payer_total: number;
524
+ payer_refund: number;
525
+ settlement_refund: number;
526
+ settlement_total: number;
527
+ discount_refund: number;
528
+ currency: string;
529
+ refund_fee: number;
530
+ };
531
+ promotion_detail: {
532
+ promotion_id: string;
533
+ scope: string;
534
+ type: string;
535
+ amount: number;
536
+ refund_amount: number;
537
+ goods_detail: {
538
+ merchant_goods_id: string;
539
+ wechatpay_goods_id: string;
540
+ goods_name: string;
541
+ unit_price: number;
542
+ refund_amount: number;
543
+ refund_quantity: number;
544
+ }[];
545
+ }[];
546
+ }
547
+ interface IOutput extends Output {
548
+ data?: DataOutput;
549
+ }
550
+ }
551
+ export declare namespace UploadImages {
552
+ interface IOutput extends Output {
553
+ data?: {
554
+ media_id: string;
555
+ };
556
+ }
557
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,97 @@
1
+ /**
2
+ * 商户转账,微信更新时间2025.03.21
3
+ */
4
+ import { Output } from './interface-v2';
5
+ export declare namespace TransferBills {
6
+ interface TransferDataOutput {
7
+ /** 商户单号 */
8
+ out_bill_no: string;
9
+ /** 微信转账单号 */
10
+ transfer_bill_no: string;
11
+ /** 单据状态 */
12
+ state: string;
13
+ }
14
+ interface TransferSceneReportInfo {
15
+ /** 场景信息类型,如"活动名称"、"奖励说明"等 */
16
+ info_type: string;
17
+ /** 场景信息内容 */
18
+ info_content: string;
19
+ }
20
+ interface Input {
21
+ /** 直连商户的appid -不传 默认使用初始化数据 */
22
+ appid?: string;
23
+ /** 商户单号 */
24
+ out_bill_no: string;
25
+ /** 转账场景ID */
26
+ transfer_scene_id: string;
27
+ /** 收款用户OpenID */
28
+ openid: string;
29
+ /** 收款用户姓名 */
30
+ user_name?: number;
31
+ /** 转账金额单位为"分" */
32
+ transfer_amount: number;
33
+ /** 转账备注 */
34
+ transfer_remark: string;
35
+ /** 通知地址 */
36
+ notify_url?: string;
37
+ /** 用户收款感知 */
38
+ user_recv_perception?: string;
39
+ /** 转账场景报备信息 */
40
+ transfer_scene_report_infos: TransferSceneReportInfo[];
41
+ /** 微信平台证书序列号-Wechatpay-Serial(当有敏感信息加密时,需要当前参数) */
42
+ wx_serial_no?: string;
43
+ }
44
+ interface DataOutput extends TransferDataOutput {
45
+ /** 单据创建时间 */
46
+ create_time: string;
47
+ /** 失败原因 */
48
+ fail_reason?: string;
49
+ /** 跳转领取页面的package信息 */
50
+ package_info?: string;
51
+ }
52
+ interface IOutput extends Output {
53
+ data?: DataOutput;
54
+ }
55
+ interface CancelInput {
56
+ /** 商户单号 */
57
+ out_bill_no: string;
58
+ }
59
+ interface CancelDataOutput extends TransferDataOutput {
60
+ /** 单据创建时间 */
61
+ update_time: string;
62
+ }
63
+ interface CancelOutput extends Output {
64
+ data?: CancelDataOutput;
65
+ }
66
+ interface OutBillNoInput {
67
+ /** 商户单号 */
68
+ out_bill_no: string;
69
+ }
70
+ interface BillNoInput {
71
+ /** 微信转账单号 */
72
+ transfer_bill_no: string;
73
+ }
74
+ interface BillDataOutput extends TransferDataOutput {
75
+ /** 商户号 */
76
+ mch_id: string;
77
+ /** 商户AppID */
78
+ appid: string;
79
+ /** 转账金额单位为"分"*/
80
+ transfer_amount: number;
81
+ /** 转账备注 */
82
+ transfer_remark: string;
83
+ /** 失败原因 */
84
+ fail_reason?: string;
85
+ /** 收款用户OpenID */
86
+ openid?: string;
87
+ /** 收款用户姓名 */
88
+ user_name?: string;
89
+ /** 单据创建时间 */
90
+ create_time: string;
91
+ /** 最后一次状态变更时间 */
92
+ update_time: string;
93
+ }
94
+ interface BillOutput extends Output {
95
+ data?: BillDataOutput;
96
+ }
97
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });