@yunzhanghu/sdk-nodejs 1.0.2 → 1.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.
- package/.editorconfig +8 -0
- package/.eslintrc.js +16 -0
- package/.prettierrc.js +3 -0
- package/README.md +23 -6
- package/example/apiUserSign.js +66 -12
- package/example/authentication.js +136 -25
- package/example/bizlicXjjH5.js +33 -7
- package/example/bizlicXjjH5Api.js +50 -10
- package/example/conf/config.js +2 -0
- package/example/dataService.js +105 -8
- package/example/h5UserSign.js +65 -10
- package/example/invoice.js +111 -14
- package/example/notify.js +0 -1
- package/example/payment.js +208 -26
- package/example/tax.js +31 -3
- package/example/uploadusersign.js +66 -0
- package/package.json +50 -45
- package/src/common/client.ts +364 -355
- package/src/common/exception/yzhSDKHttpException.ts +29 -26
- package/src/common/http/index.ts +62 -53
- package/src/common/utils/index.ts +16 -14
- package/src/index.ts +1 -1
- package/src/services/apiusersign/index.ts +107 -105
- package/src/services/authentication/index.ts +162 -196
- package/src/services/bizlicxjjh5/index.ts +77 -107
- package/src/services/bizlicxjjh5api/index.ts +108 -156
- package/src/services/dataservice/index.ts +246 -268
- package/src/services/h5usersign/index.ts +93 -105
- package/src/services/index.ts +11 -10
- package/src/services/invoice/index.ts +184 -244
- package/src/services/payment/index.ts +501 -435
- package/src/services/tax/index.ts +53 -51
- package/src/services/uploadusersign/index.ts +88 -0
- package/src/typings.d.ts +1 -1
- package/tdsformat.js +22 -0
- package/tsconfig.json +2 -1
- package/yzh/common/client.d.ts +3 -0
- package/yzh/common/client.js +9 -3
- package/yzh/common/http/index.d.ts +1 -0
- package/yzh/common/http/index.js +18 -8
- package/yzh/common/utils/index.d.ts +1 -0
- package/yzh/common/utils/index.js +1 -0
- package/yzh/services/apiusersign/index.d.ts +34 -7
- package/yzh/services/apiusersign/index.js +9 -8
- package/yzh/services/authentication/index.d.ts +57 -19
- package/yzh/services/authentication/index.js +12 -11
- package/yzh/services/bizlicxjjh5/index.d.ts +16 -4
- package/yzh/services/bizlicxjjh5/index.js +6 -5
- package/yzh/services/bizlicxjjh5api/index.d.ts +22 -5
- package/yzh/services/bizlicxjjh5api/index.js +7 -6
- package/yzh/services/dataservice/index.d.ts +52 -11
- package/yzh/services/dataservice/index.js +23 -10
- package/yzh/services/h5usersign/index.d.ts +28 -6
- package/yzh/services/h5usersign/index.js +8 -7
- package/yzh/services/index.d.ts +3 -2
- package/yzh/services/index.js +7 -5
- package/yzh/services/invoice/index.d.ts +51 -12
- package/yzh/services/invoice/index.js +11 -10
- package/yzh/services/payment/index.d.ts +194 -18
- package/yzh/services/payment/index.js +28 -13
- package/yzh/services/tax/index.d.ts +17 -4
- package/yzh/services/tax/index.js +6 -5
- package/yzh/services/uploadusersign/index.d.ts +78 -0
- package/yzh/services/uploadusersign/index.js +19 -0
- package/.eslintrc.json +0 -19
- package/prettier.config.js +0 -32
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import YZHclient from
|
|
1
|
+
import YZHclient from '../../common/client';
|
|
2
2
|
/** CreateBankpayOrderRequest 银行卡实时支付请求 */
|
|
3
3
|
interface CreateBankpayOrderRequest {
|
|
4
4
|
/** 平台企业订单号 */
|
|
@@ -24,14 +24,17 @@ interface CreateBankpayOrderRequest {
|
|
|
24
24
|
/** 项目标识 */
|
|
25
25
|
project_id: string;
|
|
26
26
|
}
|
|
27
|
+
|
|
27
28
|
/** CreateBankpayOrderResponse 银行卡实时支付返回 */
|
|
28
29
|
interface CreateBankpayOrderResponse {
|
|
30
|
+
/** 平台企业订单号 */
|
|
29
31
|
order_id: string;
|
|
30
32
|
/** 综合服务平台流水号 */
|
|
31
33
|
ref: string;
|
|
32
34
|
/** 订单金额 */
|
|
33
35
|
pay: string;
|
|
34
36
|
}
|
|
37
|
+
|
|
35
38
|
/** CreateAlipayOrderRequest 支付宝实时支付请求 */
|
|
36
39
|
interface CreateAlipayOrderRequest {
|
|
37
40
|
/** 平台企业订单号 */
|
|
@@ -59,6 +62,7 @@ interface CreateAlipayOrderRequest {
|
|
|
59
62
|
/** 校验支付宝账户姓名,固定值:Check */
|
|
60
63
|
check_name: string;
|
|
61
64
|
}
|
|
65
|
+
|
|
62
66
|
/** CreateAlipayOrderResponse 支付宝实时支付返回 */
|
|
63
67
|
interface CreateAlipayOrderResponse {
|
|
64
68
|
/** 平台企业订单号 */
|
|
@@ -68,6 +72,7 @@ interface CreateAlipayOrderResponse {
|
|
|
68
72
|
/** 订单金额 */
|
|
69
73
|
pay: string;
|
|
70
74
|
}
|
|
75
|
+
|
|
71
76
|
/** CreateWxpayOrderRequest 微信实时支付请求 */
|
|
72
77
|
interface CreateWxpayOrderRequest {
|
|
73
78
|
/** 平台企业订单号 */
|
|
@@ -99,6 +104,7 @@ interface CreateWxpayOrderRequest {
|
|
|
99
104
|
/** 描述信息,该字段已废弃 */
|
|
100
105
|
notes: string;
|
|
101
106
|
}
|
|
107
|
+
|
|
102
108
|
/** CreateWxpayOrderResponse 微信实时支付返回 */
|
|
103
109
|
interface CreateWxpayOrderResponse {
|
|
104
110
|
/** 平台企业订单号 */
|
|
@@ -108,6 +114,7 @@ interface CreateWxpayOrderResponse {
|
|
|
108
114
|
/** 订单金额 */
|
|
109
115
|
pay: string;
|
|
110
116
|
}
|
|
117
|
+
|
|
111
118
|
/** GetOrderRequest 查询单笔订单信息请求 */
|
|
112
119
|
interface GetOrderRequest {
|
|
113
120
|
/** 平台企业订单号 */
|
|
@@ -117,6 +124,7 @@ interface GetOrderRequest {
|
|
|
117
124
|
/** 数据类型,如果为 encryption,则对返回的 data 进行加密 */
|
|
118
125
|
data_type: string;
|
|
119
126
|
}
|
|
127
|
+
|
|
120
128
|
/** GetOrderResponse 查询单笔订单信息返回 */
|
|
121
129
|
interface GetOrderResponse {
|
|
122
130
|
/** 平台企业订单号 */
|
|
@@ -180,6 +188,7 @@ interface GetOrderResponse {
|
|
|
180
188
|
/** 系统支付费用,该字段已废弃 */
|
|
181
189
|
sys_fee: string;
|
|
182
190
|
}
|
|
191
|
+
|
|
183
192
|
/** GetDealerVARechargeAccountRequest 查询平台企业汇款信息请求 */
|
|
184
193
|
interface GetDealerVARechargeAccountRequest {
|
|
185
194
|
/** 综合服务主体 ID */
|
|
@@ -187,6 +196,7 @@ interface GetDealerVARechargeAccountRequest {
|
|
|
187
196
|
/** 平台企业 ID */
|
|
188
197
|
dealer_id: string;
|
|
189
198
|
}
|
|
199
|
+
|
|
190
200
|
/** GetDealerVARechargeAccountResponse 查询平台企业汇款信息返回 */
|
|
191
201
|
interface GetDealerVARechargeAccountResponse {
|
|
192
202
|
/** 账户名称 */
|
|
@@ -198,6 +208,7 @@ interface GetDealerVARechargeAccountResponse {
|
|
|
198
208
|
/** 付款账户 */
|
|
199
209
|
dealer_acct_name: string;
|
|
200
210
|
}
|
|
211
|
+
|
|
201
212
|
/** CancelOrderRequest 取消待支付订单请求 */
|
|
202
213
|
interface CancelOrderRequest {
|
|
203
214
|
/** 平台企业 ID */
|
|
@@ -209,19 +220,23 @@ interface CancelOrderRequest {
|
|
|
209
220
|
/** 支付路径名,银行卡(默认)、支付宝、微信 */
|
|
210
221
|
channel: string;
|
|
211
222
|
}
|
|
223
|
+
|
|
212
224
|
/** CancelOrderResponse 取消待支付订单返回 */
|
|
213
225
|
interface CancelOrderResponse {
|
|
214
226
|
ok: string;
|
|
215
227
|
}
|
|
228
|
+
|
|
216
229
|
/** ListAccountRequest 查询平台企业余额请求 */
|
|
217
230
|
interface ListAccountRequest {
|
|
218
231
|
/** 平台企业 ID */
|
|
219
232
|
dealer_id: string;
|
|
220
233
|
}
|
|
234
|
+
|
|
221
235
|
/** ListAccountResponse 查询平台企业余额返回 */
|
|
222
236
|
interface ListAccountResponse {
|
|
223
237
|
dealer_infos: AccountInfo[];
|
|
224
238
|
}
|
|
239
|
+
|
|
225
240
|
/** AccountInfo 账户信息 */
|
|
226
241
|
interface AccountInfo {
|
|
227
242
|
/** 综合服务主体 ID */
|
|
@@ -245,6 +260,7 @@ interface AccountInfo {
|
|
|
245
260
|
/** 总余额 */
|
|
246
261
|
total_balance: string;
|
|
247
262
|
}
|
|
263
|
+
|
|
248
264
|
/** GetEleReceiptFileRequest 查询电子回单请求 */
|
|
249
265
|
interface GetEleReceiptFileRequest {
|
|
250
266
|
/** 平台企业订单号 */
|
|
@@ -252,6 +268,7 @@ interface GetEleReceiptFileRequest {
|
|
|
252
268
|
/** 综合服务平台流水号 */
|
|
253
269
|
ref: string;
|
|
254
270
|
}
|
|
271
|
+
|
|
255
272
|
/** GetEleReceiptFileResponse 查询电子回单返回 */
|
|
256
273
|
interface GetEleReceiptFileResponse {
|
|
257
274
|
/** 链接失效时间 */
|
|
@@ -261,7 +278,8 @@ interface GetEleReceiptFileResponse {
|
|
|
261
278
|
/** 下载链接 */
|
|
262
279
|
url: string;
|
|
263
280
|
}
|
|
264
|
-
|
|
281
|
+
|
|
282
|
+
/** CreateBatchOrderRequest 批次下单请求 */
|
|
265
283
|
interface CreateBatchOrderRequest {
|
|
266
284
|
/** 平台企业批次号 */
|
|
267
285
|
batch_id: string;
|
|
@@ -277,10 +295,13 @@ interface CreateBatchOrderRequest {
|
|
|
277
295
|
total_pay: string;
|
|
278
296
|
/** 总笔数 */
|
|
279
297
|
total_count: string;
|
|
298
|
+
/** 支付模式 */
|
|
299
|
+
mode: string;
|
|
280
300
|
/** 订单列表 */
|
|
281
301
|
order_list: BatchOrderInfo[];
|
|
282
302
|
}
|
|
283
|
-
|
|
303
|
+
|
|
304
|
+
/** BatchOrderInfo 批次下单订单信息 */
|
|
284
305
|
interface BatchOrderInfo {
|
|
285
306
|
/** 平台企业订单号 */
|
|
286
307
|
order_id: string;
|
|
@@ -303,14 +324,16 @@ interface BatchOrderInfo {
|
|
|
303
324
|
/** 回调地址 */
|
|
304
325
|
notify_url: string;
|
|
305
326
|
}
|
|
306
|
-
|
|
327
|
+
|
|
328
|
+
/** CreateBatchOrderResponse 批次下单返回 */
|
|
307
329
|
interface CreateBatchOrderResponse {
|
|
308
330
|
/** 平台企业批次号 */
|
|
309
331
|
batch_id: string;
|
|
310
332
|
/** 订单结果列表 */
|
|
311
333
|
result_list: BatchOrderResult[];
|
|
312
334
|
}
|
|
313
|
-
|
|
335
|
+
|
|
336
|
+
/** BatchOrderResult 批次下单返回订单信息 */
|
|
314
337
|
interface BatchOrderResult {
|
|
315
338
|
/** 平台企业订单号 */
|
|
316
339
|
order_id: string;
|
|
@@ -318,7 +341,20 @@ interface BatchOrderResult {
|
|
|
318
341
|
ref: string;
|
|
319
342
|
/** 订单金额 */
|
|
320
343
|
pay: string;
|
|
344
|
+
/** 下单状态 */
|
|
345
|
+
status: string;
|
|
346
|
+
/** 下单失败原因 */
|
|
347
|
+
error_reasons: BatchOrderErrorReasons[];
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
/** BatchOrderErrorReasons 下单失败原因信息 */
|
|
351
|
+
interface BatchOrderErrorReasons {
|
|
352
|
+
/** 不允许下单原因码 */
|
|
353
|
+
error_code: string;
|
|
354
|
+
/** 不允许下单原因描述 */
|
|
355
|
+
error_message: string;
|
|
321
356
|
}
|
|
357
|
+
|
|
322
358
|
/** ConfirmBatchOrderRequest 批次确认请求 */
|
|
323
359
|
interface ConfirmBatchOrderRequest {
|
|
324
360
|
/** 平台企业批次号 */
|
|
@@ -330,9 +366,109 @@ interface ConfirmBatchOrderRequest {
|
|
|
330
366
|
/** 支付路径 */
|
|
331
367
|
channel: string;
|
|
332
368
|
}
|
|
333
|
-
|
|
334
|
-
|
|
369
|
+
|
|
370
|
+
/** ConfirmBatchOrderResponse 批次确认返回 */
|
|
371
|
+
interface ConfirmBatchOrderResponse {}
|
|
372
|
+
|
|
373
|
+
/** QueryBatchOrderRequest 查询批次订单信息请求 */
|
|
374
|
+
interface QueryBatchOrderRequest {
|
|
375
|
+
/** 平台企业批次号 */
|
|
376
|
+
batch_id: string;
|
|
377
|
+
/** 平台企业 ID */
|
|
378
|
+
dealer_id: string;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
/** QueryBatchOrderResponse 查询批次订单信息返回 */
|
|
382
|
+
interface QueryBatchOrderResponse {
|
|
383
|
+
/** 综合服务主体 ID */
|
|
384
|
+
broker_id: string;
|
|
385
|
+
/** 平台企业 ID */
|
|
386
|
+
dealer_id: string;
|
|
387
|
+
/** 平台企业批次号 */
|
|
388
|
+
batch_id: string;
|
|
389
|
+
/** 总笔数 */
|
|
390
|
+
total_count: string;
|
|
391
|
+
/** 订单总金额 */
|
|
392
|
+
total_pay: string;
|
|
393
|
+
/** 支付路径 */
|
|
394
|
+
channel: string;
|
|
395
|
+
/** 批次状态码 */
|
|
396
|
+
batch_status: string;
|
|
397
|
+
/** 批次状态码描述 */
|
|
398
|
+
batch_status_message: string;
|
|
399
|
+
/** 批次接收时间 */
|
|
400
|
+
batch_received_time: string;
|
|
401
|
+
/** 批次订单列表 */
|
|
402
|
+
order_list: QueryBatchOrderInfo[];
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
/** QueryBatchOrderInfo 查询批次订单信息订单详情 */
|
|
406
|
+
interface QueryBatchOrderInfo {
|
|
407
|
+
/** 平台企业订单号 */
|
|
408
|
+
order_id: string;
|
|
409
|
+
/** 订单金额 */
|
|
410
|
+
pay: string;
|
|
411
|
+
/** 综合服务主体 ID */
|
|
412
|
+
broker_id: string;
|
|
413
|
+
/** 平台企业 ID */
|
|
414
|
+
dealer_id: string;
|
|
415
|
+
/** 姓名 */
|
|
416
|
+
real_name: string;
|
|
417
|
+
/** 收款人账号 */
|
|
418
|
+
card_no: string;
|
|
419
|
+
/** 身份证号码 */
|
|
420
|
+
id_card: string;
|
|
421
|
+
/** 手机号 */
|
|
422
|
+
phone_no: string;
|
|
423
|
+
/** 订单状态码 */
|
|
424
|
+
status: string;
|
|
425
|
+
/** 订单详情状态码 */
|
|
426
|
+
status_detail: string;
|
|
427
|
+
/** 订单状态码描述 */
|
|
428
|
+
status_message: string;
|
|
429
|
+
/** 订单详情状态码描述 */
|
|
430
|
+
status_detail_message: string;
|
|
431
|
+
/** 综合服务主体支付金额 */
|
|
432
|
+
broker_amount: string;
|
|
433
|
+
/** 综合服务平台流水号 */
|
|
434
|
+
ref: string;
|
|
435
|
+
/** 支付交易流水号 */
|
|
436
|
+
broker_bank_bill: string;
|
|
437
|
+
/** 支付路径 */
|
|
438
|
+
withdraw_platform: string;
|
|
439
|
+
/** 订单接收时间 */
|
|
440
|
+
created_at: string;
|
|
441
|
+
/** 订单完成时间 */
|
|
442
|
+
finished_time: string;
|
|
443
|
+
/** 综合服务主体加成服务费 */
|
|
444
|
+
broker_fee: string;
|
|
445
|
+
/** 余额账户支出加成服务费 */
|
|
446
|
+
broker_real_fee: string;
|
|
447
|
+
/** 加成服务费抵扣金额 */
|
|
448
|
+
broker_deduct_fee: string;
|
|
449
|
+
/** 订单备注 */
|
|
450
|
+
pay_remark: string;
|
|
451
|
+
/** 用户加成服务费 */
|
|
452
|
+
user_fee: string;
|
|
453
|
+
/** 银行名称 */
|
|
454
|
+
bank_name: string;
|
|
455
|
+
/** 业务线标识 */
|
|
456
|
+
project_id: string;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
/** CancelBatchOrderRequest 批次撤销请求 */
|
|
460
|
+
interface CancelBatchOrderRequest {
|
|
461
|
+
/** 平台企业批次号 */
|
|
462
|
+
batch_id: string;
|
|
463
|
+
/** 平台企业 ID */
|
|
464
|
+
dealer_id: string;
|
|
465
|
+
/** 综合服务主体 ID */
|
|
466
|
+
broker_id: string;
|
|
335
467
|
}
|
|
468
|
+
|
|
469
|
+
/** CancelBatchOrderResponse 批次撤销返回 */
|
|
470
|
+
interface CancelBatchOrderResponse {}
|
|
471
|
+
|
|
336
472
|
export declare class PaymentClient extends YZHclient {
|
|
337
473
|
constructor(conf: {
|
|
338
474
|
dealer_id: string;
|
|
@@ -341,18 +477,58 @@ export declare class PaymentClient extends YZHclient {
|
|
|
341
477
|
des3_key: string;
|
|
342
478
|
private_key: string;
|
|
343
479
|
yzh_public_key: string;
|
|
344
|
-
sign_type:
|
|
480
|
+
sign_type: 'rsa' | 'sha256';
|
|
345
481
|
base_url?: string;
|
|
482
|
+
timeout?: number;
|
|
346
483
|
});
|
|
347
|
-
CreateBankpayOrder(
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
484
|
+
CreateBankpayOrder(
|
|
485
|
+
req: CreateBankpayOrderRequest,
|
|
486
|
+
cb?: (error: null | string, rep: CreateBankpayOrderResponse) => void
|
|
487
|
+
): Promise<CreateBankpayOrderResponse>;
|
|
488
|
+
CreateAlipayOrder(
|
|
489
|
+
req: CreateAlipayOrderRequest,
|
|
490
|
+
cb?: (error: null | string, rep: CreateAlipayOrderResponse) => void
|
|
491
|
+
): Promise<CreateAlipayOrderResponse>;
|
|
492
|
+
CreateWxpayOrder(
|
|
493
|
+
req: CreateWxpayOrderRequest,
|
|
494
|
+
cb?: (error: null | string, rep: CreateWxpayOrderResponse) => void
|
|
495
|
+
): Promise<CreateWxpayOrderResponse>;
|
|
496
|
+
GetOrder(
|
|
497
|
+
req: GetOrderRequest,
|
|
498
|
+
cb?: (error: null | string, rep: GetOrderResponse) => void
|
|
499
|
+
): Promise<GetOrderResponse>;
|
|
500
|
+
GetDealerVARechargeAccount(
|
|
501
|
+
req: GetDealerVARechargeAccountRequest,
|
|
502
|
+
cb?: (error: null | string, rep: GetDealerVARechargeAccountResponse) => void
|
|
503
|
+
): Promise<GetDealerVARechargeAccountResponse>;
|
|
504
|
+
ListAccount(
|
|
505
|
+
req: ListAccountRequest,
|
|
506
|
+
cb?: (error: null | string, rep: ListAccountResponse) => void
|
|
507
|
+
): Promise<ListAccountResponse>;
|
|
508
|
+
GetEleReceiptFile(
|
|
509
|
+
req: GetEleReceiptFileRequest,
|
|
510
|
+
cb?: (error: null | string, rep: GetEleReceiptFileResponse) => void
|
|
511
|
+
): Promise<GetEleReceiptFileResponse>;
|
|
512
|
+
CancelOrder(
|
|
513
|
+
req: CancelOrderRequest,
|
|
514
|
+
cb?: (error: null | string, rep: CancelOrderResponse) => void
|
|
515
|
+
): Promise<CancelOrderResponse>;
|
|
516
|
+
CreateBatchOrder(
|
|
517
|
+
req: CreateBatchOrderRequest,
|
|
518
|
+
cb?: (error: null | string, rep: CreateBatchOrderResponse) => void
|
|
519
|
+
): Promise<CreateBatchOrderResponse>;
|
|
520
|
+
ConfirmBatchOrder(
|
|
521
|
+
req: ConfirmBatchOrderRequest,
|
|
522
|
+
cb?: (error: null | string, rep: ConfirmBatchOrderResponse) => void
|
|
523
|
+
): Promise<ConfirmBatchOrderResponse>;
|
|
524
|
+
QueryBatchOrder(
|
|
525
|
+
req: QueryBatchOrderRequest,
|
|
526
|
+
cb?: (error: null | string, rep: QueryBatchOrderResponse) => void
|
|
527
|
+
): Promise<QueryBatchOrderResponse>;
|
|
528
|
+
CancelBatchOrder(
|
|
529
|
+
req: CancelBatchOrderRequest,
|
|
530
|
+
cb?: (error: null | string, rep: CancelBatchOrderResponse) => void
|
|
531
|
+
): Promise<CancelBatchOrderResponse>;
|
|
357
532
|
}
|
|
533
|
+
|
|
358
534
|
export {};
|
|
@@ -1,50 +1,65 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3
3
|
exports.PaymentClient = void 0;
|
|
4
|
-
const client_1 = require(
|
|
4
|
+
const client_1 = require('../../common/client');
|
|
5
5
|
class PaymentClient extends client_1.default {
|
|
6
|
+
// eslint-disable-next-line no-useless-constructor
|
|
6
7
|
constructor(conf) {
|
|
7
8
|
super(conf);
|
|
8
9
|
}
|
|
9
10
|
// CreateBankpayOrder 银行卡实时支付
|
|
10
11
|
async CreateBankpayOrder(req, cb) {
|
|
11
|
-
return this.request(
|
|
12
|
+
return this.request('post', '/api/payment/v1/order-bankpay', req, { encryption: false }, cb);
|
|
12
13
|
}
|
|
13
14
|
// CreateAlipayOrder 支付宝实时支付
|
|
14
15
|
async CreateAlipayOrder(req, cb) {
|
|
15
|
-
return this.request(
|
|
16
|
+
return this.request('post', '/api/payment/v1/order-alipay', req, { encryption: false }, cb);
|
|
16
17
|
}
|
|
17
18
|
// CreateWxpayOrder 微信实时支付
|
|
18
19
|
async CreateWxpayOrder(req, cb) {
|
|
19
|
-
return this.request(
|
|
20
|
+
return this.request('post', '/api/payment/v1/order-wxpay', req, { encryption: false }, cb);
|
|
20
21
|
}
|
|
21
22
|
// GetOrder 查询单笔订单信息
|
|
22
23
|
async GetOrder(req, cb) {
|
|
23
|
-
return this.request(
|
|
24
|
+
return this.request(
|
|
25
|
+
'get',
|
|
26
|
+
'/api/payment/v1/query-order',
|
|
27
|
+
req,
|
|
28
|
+
{ encryption: (req === null || req === void 0 ? void 0 : req.data_type) === 'encryption' },
|
|
29
|
+
cb
|
|
30
|
+
);
|
|
24
31
|
}
|
|
25
32
|
// GetDealerVARechargeAccount 查询平台企业汇款信息
|
|
26
33
|
async GetDealerVARechargeAccount(req, cb) {
|
|
27
|
-
return this.request(
|
|
34
|
+
return this.request('get', '/api/payment/v1/va-account', req, { encryption: false }, cb);
|
|
28
35
|
}
|
|
29
36
|
// ListAccount 查询平台企业余额
|
|
30
37
|
async ListAccount(req, cb) {
|
|
31
|
-
return this.request(
|
|
38
|
+
return this.request('get', '/api/payment/v1/query-accounts', req, { encryption: false }, cb);
|
|
32
39
|
}
|
|
33
40
|
// GetEleReceiptFile 查询电子回单
|
|
34
41
|
async GetEleReceiptFile(req, cb) {
|
|
35
|
-
return this.request(
|
|
42
|
+
return this.request('get', '/api/payment/v1/receipt/file', req, { encryption: false }, cb);
|
|
36
43
|
}
|
|
37
44
|
// CancelOrder 取消待支付订单
|
|
38
45
|
async CancelOrder(req, cb) {
|
|
39
|
-
return this.request(
|
|
46
|
+
return this.request('post', '/api/payment/v1/order/fail', req, { encryption: false }, cb);
|
|
40
47
|
}
|
|
41
48
|
// CreateBatchOrder 批次下单
|
|
42
49
|
async CreateBatchOrder(req, cb) {
|
|
43
|
-
return this.request(
|
|
50
|
+
return this.request('post', '/api/payment/v1/order-batch', req, { encryption: false }, cb);
|
|
44
51
|
}
|
|
45
52
|
// ConfirmBatchOrder 批次确认
|
|
46
53
|
async ConfirmBatchOrder(req, cb) {
|
|
47
|
-
return this.request(
|
|
54
|
+
return this.request('post', '/api/payment/v1/confirm-batch', req, { encryption: false }, cb);
|
|
55
|
+
}
|
|
56
|
+
// QueryBatchOrder 查询批次订单信息
|
|
57
|
+
async QueryBatchOrder(req, cb) {
|
|
58
|
+
return this.request('get', '/api/payment/v1/query-batch', req, { encryption: false }, cb);
|
|
59
|
+
}
|
|
60
|
+
// CancelBatchOrder 批次撤销
|
|
61
|
+
async CancelBatchOrder(req, cb) {
|
|
62
|
+
return this.request('post', '/api/payment/v1/cancel-batch', req, { encryption: false }, cb);
|
|
48
63
|
}
|
|
49
64
|
}
|
|
50
65
|
exports.PaymentClient = PaymentClient;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import YZHclient from
|
|
1
|
+
import YZHclient from '../../common/client';
|
|
2
2
|
/** GetTaxFileRequest 下载个人所得税扣缴明细表请求 */
|
|
3
3
|
interface GetTaxFileRequest {
|
|
4
4
|
/** 平台企业 ID */
|
|
@@ -8,11 +8,13 @@ interface GetTaxFileRequest {
|
|
|
8
8
|
/** 所属期 */
|
|
9
9
|
year_month: string;
|
|
10
10
|
}
|
|
11
|
+
|
|
11
12
|
/** GetTaxFileResponse 下载个人所得税扣缴明细表返回 */
|
|
12
13
|
interface GetTaxFileResponse {
|
|
13
14
|
/** 文件详情 */
|
|
14
15
|
file_info: FileInfo[];
|
|
15
16
|
}
|
|
17
|
+
|
|
16
18
|
/** FileInfo 报税文件详情 */
|
|
17
19
|
interface FileInfo {
|
|
18
20
|
/** 文件名称 */
|
|
@@ -22,6 +24,7 @@ interface FileInfo {
|
|
|
22
24
|
/** 文件解压缩密码 */
|
|
23
25
|
pwd: string;
|
|
24
26
|
}
|
|
27
|
+
|
|
25
28
|
/** GetUserCrossRequest 查询纳税人是否为跨集团用户请求 */
|
|
26
29
|
interface GetUserCrossRequest {
|
|
27
30
|
/** 平台企业 ID */
|
|
@@ -33,11 +36,13 @@ interface GetUserCrossRequest {
|
|
|
33
36
|
/** 平台企业签约主体 */
|
|
34
37
|
ent_id: string;
|
|
35
38
|
}
|
|
39
|
+
|
|
36
40
|
/** GetUserCrossResponse 查询纳税人是否为跨集团用户返回 */
|
|
37
41
|
interface GetUserCrossResponse {
|
|
38
42
|
/** 跨集团标识 */
|
|
39
43
|
is_cross: boolean;
|
|
40
44
|
}
|
|
45
|
+
|
|
41
46
|
export declare class TaxClient extends YZHclient {
|
|
42
47
|
constructor(conf: {
|
|
43
48
|
dealer_id: string;
|
|
@@ -46,10 +51,18 @@ export declare class TaxClient extends YZHclient {
|
|
|
46
51
|
des3_key: string;
|
|
47
52
|
private_key: string;
|
|
48
53
|
yzh_public_key: string;
|
|
49
|
-
sign_type:
|
|
54
|
+
sign_type: 'rsa' | 'sha256';
|
|
50
55
|
base_url?: string;
|
|
56
|
+
timeout?: number;
|
|
51
57
|
});
|
|
52
|
-
GetTaxFile(
|
|
53
|
-
|
|
58
|
+
GetTaxFile(
|
|
59
|
+
req: GetTaxFileRequest,
|
|
60
|
+
cb?: (error: null | string, rep: GetTaxFileResponse) => void
|
|
61
|
+
): Promise<GetTaxFileResponse>;
|
|
62
|
+
GetUserCross(
|
|
63
|
+
req: GetUserCrossRequest,
|
|
64
|
+
cb?: (error: null | string, rep: GetUserCrossResponse) => void
|
|
65
|
+
): Promise<GetUserCrossResponse>;
|
|
54
66
|
}
|
|
67
|
+
|
|
55
68
|
export {};
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3
3
|
exports.TaxClient = void 0;
|
|
4
|
-
const client_1 = require(
|
|
4
|
+
const client_1 = require('../../common/client');
|
|
5
5
|
class TaxClient extends client_1.default {
|
|
6
|
+
// eslint-disable-next-line no-useless-constructor
|
|
6
7
|
constructor(conf) {
|
|
7
8
|
super(conf);
|
|
8
9
|
}
|
|
9
10
|
// GetTaxFile 下载个人所得税扣缴明细表
|
|
10
11
|
async GetTaxFile(req, cb) {
|
|
11
|
-
return this.request(
|
|
12
|
+
return this.request('post', '/api/tax/v1/taxfile/download', req, { encryption: false }, cb);
|
|
12
13
|
}
|
|
13
14
|
// GetUserCross 查询纳税人是否为跨集团用户
|
|
14
15
|
async GetUserCross(req, cb) {
|
|
15
|
-
return this.request(
|
|
16
|
+
return this.request('post', '/api/tax/v1/user/cross', req, { encryption: false }, cb);
|
|
16
17
|
}
|
|
17
18
|
}
|
|
18
19
|
exports.TaxClient = TaxClient;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import YZHclient from '../../common/client';
|
|
2
|
+
/** UploadUserSignRequest 用户签约信息上传请求 */
|
|
3
|
+
interface UploadUserSignRequest {
|
|
4
|
+
/** 平台企业 ID */
|
|
5
|
+
dealer_id: string;
|
|
6
|
+
/** 综合服务主体 ID */
|
|
7
|
+
broker_id: string;
|
|
8
|
+
/** 姓名 */
|
|
9
|
+
real_name: string;
|
|
10
|
+
/** 证件号码 */
|
|
11
|
+
id_card: string;
|
|
12
|
+
/** 手机号 */
|
|
13
|
+
phone: string;
|
|
14
|
+
/** 是否是海外用户 */
|
|
15
|
+
is_abroad: boolean;
|
|
16
|
+
/** 签约回调地址 */
|
|
17
|
+
notify_url: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/** UploadUserSignResponse 用户签约信息上传返回 */
|
|
21
|
+
interface UploadUserSignResponse {
|
|
22
|
+
/** 上传状态 */
|
|
23
|
+
status: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** GetUploadUserSignStatusRequest 获取用户签约状态请求 */
|
|
27
|
+
interface GetUploadUserSignStatusRequest {
|
|
28
|
+
/** 平台企业 ID */
|
|
29
|
+
dealer_id: string;
|
|
30
|
+
/** 综合服务主体 ID */
|
|
31
|
+
broker_id: string;
|
|
32
|
+
/** 姓名 */
|
|
33
|
+
real_name: string;
|
|
34
|
+
/** 证件号码 */
|
|
35
|
+
id_card: string;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** GetUploadUserSignStatusResponse 获取用户签约状态返回 */
|
|
39
|
+
interface GetUploadUserSignStatusResponse {
|
|
40
|
+
/** 平台企业 ID */
|
|
41
|
+
dealer_id: string;
|
|
42
|
+
/** 综合服务主体 ID */
|
|
43
|
+
broker_id: string;
|
|
44
|
+
/** 姓名 */
|
|
45
|
+
real_name: string;
|
|
46
|
+
/** 证件号码 */
|
|
47
|
+
id_card: string;
|
|
48
|
+
/** 签约状态 */
|
|
49
|
+
status: number;
|
|
50
|
+
/** 创建时间 */
|
|
51
|
+
created_at: string;
|
|
52
|
+
/** 更新时间 */
|
|
53
|
+
updated_at: string;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export declare class UploadUserSignServiceClient extends YZHclient {
|
|
57
|
+
constructor(conf: {
|
|
58
|
+
dealer_id: string;
|
|
59
|
+
broker_id: string;
|
|
60
|
+
app_key: string;
|
|
61
|
+
des3_key: string;
|
|
62
|
+
private_key: string;
|
|
63
|
+
yzh_public_key: string;
|
|
64
|
+
sign_type: 'rsa' | 'sha256';
|
|
65
|
+
base_url?: string;
|
|
66
|
+
timeout?: number;
|
|
67
|
+
});
|
|
68
|
+
UploadUserSign(
|
|
69
|
+
req: UploadUserSignRequest,
|
|
70
|
+
cb?: (error: null | string, rep: UploadUserSignResponse) => void
|
|
71
|
+
): Promise<UploadUserSignResponse>;
|
|
72
|
+
GetUploadUserSignStatus(
|
|
73
|
+
req: GetUploadUserSignStatusRequest,
|
|
74
|
+
cb?: (error: null | string, rep: GetUploadUserSignStatusResponse) => void
|
|
75
|
+
): Promise<GetUploadUserSignStatusResponse>;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3
|
+
exports.UploadUserSignServiceClient = void 0;
|
|
4
|
+
const client_1 = require('../../common/client');
|
|
5
|
+
class UploadUserSignServiceClient extends client_1.default {
|
|
6
|
+
// eslint-disable-next-line no-useless-constructor
|
|
7
|
+
constructor(conf) {
|
|
8
|
+
super(conf);
|
|
9
|
+
}
|
|
10
|
+
// UploadUserSign 用户签约信息上传
|
|
11
|
+
async UploadUserSign(req, cb) {
|
|
12
|
+
return this.request('post', '/api/payment/v1/sign/user', req, { encryption: false }, cb);
|
|
13
|
+
}
|
|
14
|
+
// GetUploadUserSignStatus 获取用户签约状态
|
|
15
|
+
async GetUploadUserSignStatus(req, cb) {
|
|
16
|
+
return this.request('get', '/api/payment/v1/sign/user/status', req, { encryption: false }, cb);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.UploadUserSignServiceClient = UploadUserSignServiceClient;
|
package/.eslintrc.json
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"env": {
|
|
3
|
-
"browser": true,
|
|
4
|
-
"node": true,
|
|
5
|
-
"es2021": true
|
|
6
|
-
},
|
|
7
|
-
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
|
|
8
|
-
"overrides": [],
|
|
9
|
-
"parser": "@typescript-eslint/parser",
|
|
10
|
-
"parserOptions": {
|
|
11
|
-
"ecmaVersion": "latest",
|
|
12
|
-
"sourceType": "module"
|
|
13
|
-
},
|
|
14
|
-
"plugins": ["@typescript-eslint"],
|
|
15
|
-
"rules": {
|
|
16
|
-
"@typescript-eslint/no-empty-interface": [0],
|
|
17
|
-
"@typescript-eslint/no-var-requires": [0]
|
|
18
|
-
}
|
|
19
|
-
}
|