@yunzhanghu/sdk-nodejs 1.0.9 → 1.0.10
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/README.md +1 -0
- package/example/authentication.js +2 -2
- package/example/payment.js +51 -0
- package/example/tax.js +2 -2
- package/example/uploadusersign.js +0 -1
- package/package.json +1 -1
- package/src/services/authentication/index.ts +6 -6
- package/src/services/payment/index.ts +54 -0
- package/src/services/tax/index.ts +3 -3
- package/yzh/services/authentication/index.d.ts +4 -4
- package/yzh/services/authentication/index.js +2 -2
- package/yzh/services/payment/index.d.ts +46 -0
- package/yzh/services/payment/index.js +8 -0
- package/yzh/services/tax/index.d.ts +2 -2
- package/yzh/services/tax/index.js +1 -1
package/README.md
CHANGED
|
@@ -188,7 +188,7 @@ function parse(file) {
|
|
|
188
188
|
return data
|
|
189
189
|
}
|
|
190
190
|
|
|
191
|
-
//
|
|
191
|
+
// 上传非居民身份证验证名单信息
|
|
192
192
|
authentication
|
|
193
193
|
.UserExemptedInfo({
|
|
194
194
|
|
|
@@ -225,7 +225,7 @@ authentication
|
|
|
225
225
|
console.log(err.toString())
|
|
226
226
|
})
|
|
227
227
|
|
|
228
|
-
//
|
|
228
|
+
// 查看用户是否在非居民身份证验证名单中
|
|
229
229
|
authentication
|
|
230
230
|
.UserWhiteCheck({
|
|
231
231
|
|
package/example/payment.js
CHANGED
|
@@ -212,6 +212,28 @@ payment
|
|
|
212
212
|
console.log('@@@@@@', err.toString())
|
|
213
213
|
})
|
|
214
214
|
|
|
215
|
+
// 重试挂起状态订单
|
|
216
|
+
payment
|
|
217
|
+
.RetryOrder({
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* @param {string} request-id:请求 ID,请求的唯一标识
|
|
221
|
+
* 建议平台企业自定义 request-id,并记录在日志中,便于问题发现及排查
|
|
222
|
+
* 如未自定义 request-id,将使用 SDK 中的 UUID 方法自动生成。注意:UUID 方法生成的 request-id 不能保证全局唯一,推荐自定义 request-id
|
|
223
|
+
*/
|
|
224
|
+
request_id: 'requestIdExample123456789',
|
|
225
|
+
dealer_id: config.dealer_id,
|
|
226
|
+
order_id: '202009010016562012987',
|
|
227
|
+
ref: '176826728298982',
|
|
228
|
+
channel: 'bankpay',
|
|
229
|
+
})
|
|
230
|
+
.then((data) => {
|
|
231
|
+
console.log('响应内容:', data)
|
|
232
|
+
})
|
|
233
|
+
.catch((err) => {
|
|
234
|
+
console.log('@@@@@@', err.toString())
|
|
235
|
+
})
|
|
236
|
+
|
|
215
237
|
// 查询平台企业汇款信息
|
|
216
238
|
payment
|
|
217
239
|
.GetDealerVARechargeAccount({
|
|
@@ -239,6 +261,35 @@ payment
|
|
|
239
261
|
console.log(err.toString())
|
|
240
262
|
})
|
|
241
263
|
|
|
264
|
+
// 用户结算金额校验
|
|
265
|
+
payment
|
|
266
|
+
.CheckUserAmount({
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* @param {string} request-id:请求 ID,请求的唯一标识
|
|
270
|
+
* 建议平台企业自定义 request-id,并记录在日志中,便于问题发现及排查
|
|
271
|
+
* 如未自定义 request-id,将使用 SDK 中的 UUID 方法自动生成。注意:UUID 方法生成的 request-id 不能保证全局唯一,推荐自定义 request-id
|
|
272
|
+
*/
|
|
273
|
+
request_id: 'requestIdExample123456789',
|
|
274
|
+
broker_id: config.broker_id,
|
|
275
|
+
real_name: '张三',
|
|
276
|
+
id_card: '11010519491231002X',
|
|
277
|
+
amount: '10000.00',
|
|
278
|
+
})
|
|
279
|
+
.then((data) => {
|
|
280
|
+
if (data.code === '0000') {
|
|
281
|
+
// 操作成功
|
|
282
|
+
console.log('操作成功 ', data.data)
|
|
283
|
+
} else {
|
|
284
|
+
// 失败返回
|
|
285
|
+
console.log('失败返回 ', 'code:' + data.code + ' message:' + data.message + ' request_id:' + data.request_id)
|
|
286
|
+
}
|
|
287
|
+
})
|
|
288
|
+
.catch((err) => {
|
|
289
|
+
// 发生异常
|
|
290
|
+
console.log(err.toString())
|
|
291
|
+
})
|
|
292
|
+
|
|
242
293
|
// 批次下单
|
|
243
294
|
payment
|
|
244
295
|
.CreateBatchOrder({
|
package/example/tax.js
CHANGED
package/package.json
CHANGED
|
@@ -76,7 +76,7 @@ interface IDCardVerifyRequest {
|
|
|
76
76
|
/** IDCardVerifyResponse 身份证实名验证返回 */
|
|
77
77
|
interface IDCardVerifyResponse {}
|
|
78
78
|
|
|
79
|
-
/** UserExemptedInfoRequest
|
|
79
|
+
/** UserExemptedInfoRequest 上传非居民身份证验证名单信息请求 */
|
|
80
80
|
interface UserExemptedInfoRequest {
|
|
81
81
|
/** 证件类型码 */
|
|
82
82
|
card_type: string;
|
|
@@ -104,13 +104,13 @@ interface UserExemptedInfoRequest {
|
|
|
104
104
|
ref: string;
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
-
/** UserExemptedInfoResponse
|
|
107
|
+
/** UserExemptedInfoResponse 上传非居民身份证验证名单信息返回 */
|
|
108
108
|
interface UserExemptedInfoResponse {
|
|
109
109
|
/** 是否上传成功 */
|
|
110
110
|
ok: string;
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
-
/** UserWhiteCheckRequest
|
|
113
|
+
/** UserWhiteCheckRequest 查看用户是否在非居民身份证验证名单中请求 */
|
|
114
114
|
interface UserWhiteCheckRequest {
|
|
115
115
|
/** 证件号码 */
|
|
116
116
|
id_card: string;
|
|
@@ -118,7 +118,7 @@ interface UserWhiteCheckRequest {
|
|
|
118
118
|
real_name: string;
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
-
/** UserWhiteCheckResponse
|
|
121
|
+
/** UserWhiteCheckResponse 查看用户是否在非居民身份证验证名单中返回 */
|
|
122
122
|
interface UserWhiteCheckResponse {
|
|
123
123
|
ok: boolean;
|
|
124
124
|
}
|
|
@@ -199,7 +199,7 @@ export class AuthenticationClient extends YZHclient {
|
|
|
199
199
|
return this.request('post', '/authentication/verify-id', req, { encryption: false }, cb);
|
|
200
200
|
}
|
|
201
201
|
|
|
202
|
-
// UserExemptedInfo
|
|
202
|
+
// UserExemptedInfo 上传非居民身份证验证名单信息
|
|
203
203
|
async UserExemptedInfo(
|
|
204
204
|
req: UserExemptedInfoRequest,
|
|
205
205
|
cb?: (error: null | string, rep: UserExemptedInfoResponse) => void
|
|
@@ -207,7 +207,7 @@ export class AuthenticationClient extends YZHclient {
|
|
|
207
207
|
return this.request('post', '/api/payment/v1/user/exempted/info', req, { encryption: false }, cb);
|
|
208
208
|
}
|
|
209
209
|
|
|
210
|
-
// UserWhiteCheck
|
|
210
|
+
// UserWhiteCheck 查看用户是否在非居民身份证验证名单中
|
|
211
211
|
async UserWhiteCheck(
|
|
212
212
|
req: UserWhiteCheckRequest,
|
|
213
213
|
cb?: (error: null | string, rep: UserWhiteCheckResponse) => void
|
|
@@ -229,6 +229,24 @@ interface CancelOrderResponse {
|
|
|
229
229
|
ok: string;
|
|
230
230
|
}
|
|
231
231
|
|
|
232
|
+
/** RetryOrderRequest 重试挂起状态订单请求 */
|
|
233
|
+
interface RetryOrderRequest {
|
|
234
|
+
/** 平台企业 ID */
|
|
235
|
+
dealer_id: string;
|
|
236
|
+
/** 平台企业订单号 */
|
|
237
|
+
order_id: string;
|
|
238
|
+
/** 综合服务平台流水号 */
|
|
239
|
+
ref: string;
|
|
240
|
+
/** 支付路径名 */
|
|
241
|
+
channel: string;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/** RetryOrderResponse 重试挂起状态订单返回 */
|
|
245
|
+
interface RetryOrderResponse {
|
|
246
|
+
/** 请求标识 */
|
|
247
|
+
ok: string;
|
|
248
|
+
}
|
|
249
|
+
|
|
232
250
|
/** ListAccountRequest 查询平台企业余额请求 */
|
|
233
251
|
interface ListAccountRequest {
|
|
234
252
|
/** 平台企业 ID */
|
|
@@ -474,6 +492,26 @@ interface CancelBatchOrderRequest {
|
|
|
474
492
|
/** CancelBatchOrderResponse 批次撤销返回 */
|
|
475
493
|
interface CancelBatchOrderResponse {}
|
|
476
494
|
|
|
495
|
+
/** CheckUserAmountRequest 用户结算金额校验请求 */
|
|
496
|
+
interface CheckUserAmountRequest {
|
|
497
|
+
/** 综合服务主体 ID */
|
|
498
|
+
broker_id: string;
|
|
499
|
+
/** 姓名 */
|
|
500
|
+
real_name: string;
|
|
501
|
+
/** 身份证号码 */
|
|
502
|
+
id_card: string;
|
|
503
|
+
/** 校验金额 */
|
|
504
|
+
amount: string;
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
/** CheckUserAmountResponse 用户结算金额校验返回 */
|
|
508
|
+
interface CheckUserAmountResponse {
|
|
509
|
+
/** 是否超过月限额 */
|
|
510
|
+
is_over_whole_user_month_quota: boolean;
|
|
511
|
+
/** 是否超过年限额 */
|
|
512
|
+
is_over_whole_user_year_quota: boolean;
|
|
513
|
+
}
|
|
514
|
+
|
|
477
515
|
export class PaymentClient extends YZHclient {
|
|
478
516
|
// eslint-disable-next-line no-useless-constructor
|
|
479
517
|
constructor(conf: {
|
|
@@ -560,6 +598,14 @@ export class PaymentClient extends YZHclient {
|
|
|
560
598
|
return this.request('post', '/api/payment/v1/order/fail', req, { encryption: false }, cb);
|
|
561
599
|
}
|
|
562
600
|
|
|
601
|
+
// RetryOrder 重试挂起状态订单
|
|
602
|
+
async RetryOrder(
|
|
603
|
+
req: RetryOrderRequest,
|
|
604
|
+
cb?: (error: null | string, rep: RetryOrderResponse) => void
|
|
605
|
+
): Promise<RetryOrderResponse> {
|
|
606
|
+
return this.request('post', '/api/payment/v1/order/retry', req, { encryption: false }, cb);
|
|
607
|
+
}
|
|
608
|
+
|
|
563
609
|
// CreateBatchOrder 批次下单
|
|
564
610
|
async CreateBatchOrder(
|
|
565
611
|
req: CreateBatchOrderRequest,
|
|
@@ -591,4 +637,12 @@ export class PaymentClient extends YZHclient {
|
|
|
591
637
|
): Promise<CancelBatchOrderResponse> {
|
|
592
638
|
return this.request('post', '/api/payment/v1/cancel-batch', req, { encryption: false }, cb);
|
|
593
639
|
}
|
|
640
|
+
|
|
641
|
+
// CheckUserAmount 用户结算金额校验
|
|
642
|
+
async CheckUserAmount(
|
|
643
|
+
req: CheckUserAmountRequest,
|
|
644
|
+
cb?: (error: null | string, rep: CheckUserAmountResponse) => void
|
|
645
|
+
): Promise<CheckUserAmountResponse> {
|
|
646
|
+
return this.request('post', '/api/payment/v1/risk-check/amount', req, { encryption: false }, cb);
|
|
647
|
+
}
|
|
594
648
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import YZHclient from '../../common/client';
|
|
2
2
|
|
|
3
|
-
/** GetTaxFileRequest
|
|
3
|
+
/** GetTaxFileRequest 下载个人所得税申报明细表请求 */
|
|
4
4
|
interface GetTaxFileRequest {
|
|
5
5
|
/** 平台企业 ID */
|
|
6
6
|
dealer_id: string;
|
|
@@ -10,7 +10,7 @@ interface GetTaxFileRequest {
|
|
|
10
10
|
year_month: string;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
/** GetTaxFileResponse
|
|
13
|
+
/** GetTaxFileResponse 下载个人所得税申报明细表返回 */
|
|
14
14
|
interface GetTaxFileResponse {
|
|
15
15
|
/** 文件详情 */
|
|
16
16
|
file_info: FileInfo[];
|
|
@@ -60,7 +60,7 @@ export class TaxClient extends YZHclient {
|
|
|
60
60
|
super(conf);
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
// GetTaxFile
|
|
63
|
+
// GetTaxFile 下载个人所得税申报明细表
|
|
64
64
|
async GetTaxFile(
|
|
65
65
|
req: GetTaxFileRequest,
|
|
66
66
|
cb?: (error: null | string, rep: GetTaxFileResponse) => void
|
|
@@ -75,7 +75,7 @@ interface IDCardVerifyRequest {
|
|
|
75
75
|
/** IDCardVerifyResponse 身份证实名验证返回 */
|
|
76
76
|
interface IDCardVerifyResponse {}
|
|
77
77
|
|
|
78
|
-
/** UserExemptedInfoRequest
|
|
78
|
+
/** UserExemptedInfoRequest 上传非居民身份证验证名单信息请求 */
|
|
79
79
|
interface UserExemptedInfoRequest {
|
|
80
80
|
/** 证件类型码 */
|
|
81
81
|
card_type: string;
|
|
@@ -103,13 +103,13 @@ interface UserExemptedInfoRequest {
|
|
|
103
103
|
ref: string;
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
-
/** UserExemptedInfoResponse
|
|
106
|
+
/** UserExemptedInfoResponse 上传非居民身份证验证名单信息返回 */
|
|
107
107
|
interface UserExemptedInfoResponse {
|
|
108
108
|
/** 是否上传成功 */
|
|
109
109
|
ok: string;
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
-
/** UserWhiteCheckRequest
|
|
112
|
+
/** UserWhiteCheckRequest 查看用户是否在非居民身份证验证名单中请求 */
|
|
113
113
|
interface UserWhiteCheckRequest {
|
|
114
114
|
/** 证件号码 */
|
|
115
115
|
id_card: string;
|
|
@@ -117,7 +117,7 @@ interface UserWhiteCheckRequest {
|
|
|
117
117
|
real_name: string;
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
-
/** UserWhiteCheckResponse
|
|
120
|
+
/** UserWhiteCheckResponse 查看用户是否在非居民身份证验证名单中返回 */
|
|
121
121
|
interface UserWhiteCheckResponse {
|
|
122
122
|
ok: boolean;
|
|
123
123
|
}
|
|
@@ -27,11 +27,11 @@ class AuthenticationClient extends client_1.default {
|
|
|
27
27
|
async IDCardVerify(req, cb) {
|
|
28
28
|
return this.request('post', '/authentication/verify-id', req, { encryption: false }, cb);
|
|
29
29
|
}
|
|
30
|
-
// UserExemptedInfo
|
|
30
|
+
// UserExemptedInfo 上传非居民身份证验证名单信息
|
|
31
31
|
async UserExemptedInfo(req, cb) {
|
|
32
32
|
return this.request('post', '/api/payment/v1/user/exempted/info', req, { encryption: false }, cb);
|
|
33
33
|
}
|
|
34
|
-
// UserWhiteCheck
|
|
34
|
+
// UserWhiteCheck 查看用户是否在非居民身份证验证名单中
|
|
35
35
|
async UserWhiteCheck(req, cb) {
|
|
36
36
|
return this.request('post', '/api/payment/v1/user/white/check', req, { encryption: false }, cb);
|
|
37
37
|
}
|
|
@@ -228,6 +228,24 @@ interface CancelOrderResponse {
|
|
|
228
228
|
ok: string;
|
|
229
229
|
}
|
|
230
230
|
|
|
231
|
+
/** RetryOrderRequest 重试挂起状态订单请求 */
|
|
232
|
+
interface RetryOrderRequest {
|
|
233
|
+
/** 平台企业 ID */
|
|
234
|
+
dealer_id: string;
|
|
235
|
+
/** 平台企业订单号 */
|
|
236
|
+
order_id: string;
|
|
237
|
+
/** 综合服务平台流水号 */
|
|
238
|
+
ref: string;
|
|
239
|
+
/** 支付路径名 */
|
|
240
|
+
channel: string;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
/** RetryOrderResponse 重试挂起状态订单返回 */
|
|
244
|
+
interface RetryOrderResponse {
|
|
245
|
+
/** 请求标识 */
|
|
246
|
+
ok: string;
|
|
247
|
+
}
|
|
248
|
+
|
|
231
249
|
/** ListAccountRequest 查询平台企业余额请求 */
|
|
232
250
|
interface ListAccountRequest {
|
|
233
251
|
/** 平台企业 ID */
|
|
@@ -473,6 +491,26 @@ interface CancelBatchOrderRequest {
|
|
|
473
491
|
/** CancelBatchOrderResponse 批次撤销返回 */
|
|
474
492
|
interface CancelBatchOrderResponse {}
|
|
475
493
|
|
|
494
|
+
/** CheckUserAmountRequest 用户结算金额校验请求 */
|
|
495
|
+
interface CheckUserAmountRequest {
|
|
496
|
+
/** 综合服务主体 ID */
|
|
497
|
+
broker_id: string;
|
|
498
|
+
/** 姓名 */
|
|
499
|
+
real_name: string;
|
|
500
|
+
/** 身份证号码 */
|
|
501
|
+
id_card: string;
|
|
502
|
+
/** 校验金额 */
|
|
503
|
+
amount: string;
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
/** CheckUserAmountResponse 用户结算金额校验返回 */
|
|
507
|
+
interface CheckUserAmountResponse {
|
|
508
|
+
/** 是否超过月限额 */
|
|
509
|
+
is_over_whole_user_month_quota: boolean;
|
|
510
|
+
/** 是否超过年限额 */
|
|
511
|
+
is_over_whole_user_year_quota: boolean;
|
|
512
|
+
}
|
|
513
|
+
|
|
476
514
|
export declare class PaymentClient extends YZHclient {
|
|
477
515
|
constructor(conf: {
|
|
478
516
|
dealer_id: string;
|
|
@@ -517,6 +555,10 @@ export declare class PaymentClient extends YZHclient {
|
|
|
517
555
|
req: CancelOrderRequest,
|
|
518
556
|
cb?: (error: null | string, rep: CancelOrderResponse) => void
|
|
519
557
|
): Promise<CancelOrderResponse>;
|
|
558
|
+
RetryOrder(
|
|
559
|
+
req: RetryOrderRequest,
|
|
560
|
+
cb?: (error: null | string, rep: RetryOrderResponse) => void
|
|
561
|
+
): Promise<RetryOrderResponse>;
|
|
520
562
|
CreateBatchOrder(
|
|
521
563
|
req: CreateBatchOrderRequest,
|
|
522
564
|
cb?: (error: null | string, rep: CreateBatchOrderResponse) => void
|
|
@@ -533,6 +575,10 @@ export declare class PaymentClient extends YZHclient {
|
|
|
533
575
|
req: CancelBatchOrderRequest,
|
|
534
576
|
cb?: (error: null | string, rep: CancelBatchOrderResponse) => void
|
|
535
577
|
): Promise<CancelBatchOrderResponse>;
|
|
578
|
+
CheckUserAmount(
|
|
579
|
+
req: CheckUserAmountRequest,
|
|
580
|
+
cb?: (error: null | string, rep: CheckUserAmountResponse) => void
|
|
581
|
+
): Promise<CheckUserAmountResponse>;
|
|
536
582
|
}
|
|
537
583
|
|
|
538
584
|
export {};
|
|
@@ -45,6 +45,10 @@ class PaymentClient extends client_1.default {
|
|
|
45
45
|
async CancelOrder(req, cb) {
|
|
46
46
|
return this.request('post', '/api/payment/v1/order/fail', req, { encryption: false }, cb);
|
|
47
47
|
}
|
|
48
|
+
// RetryOrder 重试挂起状态订单
|
|
49
|
+
async RetryOrder(req, cb) {
|
|
50
|
+
return this.request('post', '/api/payment/v1/order/retry', req, { encryption: false }, cb);
|
|
51
|
+
}
|
|
48
52
|
// CreateBatchOrder 批次下单
|
|
49
53
|
async CreateBatchOrder(req, cb) {
|
|
50
54
|
return this.request('post', '/api/payment/v1/order-batch', req, { encryption: false }, cb);
|
|
@@ -61,5 +65,9 @@ class PaymentClient extends client_1.default {
|
|
|
61
65
|
async CancelBatchOrder(req, cb) {
|
|
62
66
|
return this.request('post', '/api/payment/v1/cancel-batch', req, { encryption: false }, cb);
|
|
63
67
|
}
|
|
68
|
+
// CheckUserAmount 用户结算金额校验
|
|
69
|
+
async CheckUserAmount(req, cb) {
|
|
70
|
+
return this.request('post', '/api/payment/v1/risk-check/amount', req, { encryption: false }, cb);
|
|
71
|
+
}
|
|
64
72
|
}
|
|
65
73
|
exports.PaymentClient = PaymentClient;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import YZHclient from '../../common/client';
|
|
2
|
-
/** GetTaxFileRequest
|
|
2
|
+
/** GetTaxFileRequest 下载个人所得税申报明细表请求 */
|
|
3
3
|
interface GetTaxFileRequest {
|
|
4
4
|
/** 平台企业 ID */
|
|
5
5
|
dealer_id: string;
|
|
@@ -9,7 +9,7 @@ interface GetTaxFileRequest {
|
|
|
9
9
|
year_month: string;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
/** GetTaxFileResponse
|
|
12
|
+
/** GetTaxFileResponse 下载个人所得税申报明细表返回 */
|
|
13
13
|
interface GetTaxFileResponse {
|
|
14
14
|
/** 文件详情 */
|
|
15
15
|
file_info: FileInfo[];
|
|
@@ -7,7 +7,7 @@ class TaxClient extends client_1.default {
|
|
|
7
7
|
constructor(conf) {
|
|
8
8
|
super(conf);
|
|
9
9
|
}
|
|
10
|
-
// GetTaxFile
|
|
10
|
+
// GetTaxFile 下载个人所得税申报明细表
|
|
11
11
|
async GetTaxFile(req, cb) {
|
|
12
12
|
return this.request('post', '/api/tax/v1/taxfile/download', req, { encryption: false }, cb);
|
|
13
13
|
}
|