@yunzhanghu/sdk-nodejs 1.0.1 → 1.0.3
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 +22 -7
- package/example/apiUserSign.js +54 -12
- package/example/authentication.js +112 -25
- package/example/bizlicXjjH5.js +27 -7
- package/example/bizlicXjjH5Api.js +41 -10
- package/example/conf/config.js +4 -2
- package/example/dataService.js +84 -8
- package/example/h5UserSign.js +53 -10
- package/example/invoice.js +90 -14
- package/example/notify.js +0 -1
- package/example/payment.js +148 -26
- package/example/tax.js +25 -3
- package/example/uploadusersign.js +60 -0
- package/package.json +50 -45
- package/src/common/client.ts +26 -7
- package/src/common/exception/yzhSDKHttpException.ts +3 -0
- package/src/common/http/index.ts +20 -9
- package/src/common/utils/index.ts +2 -0
- package/src/services/apiusersign/index.ts +2 -0
- package/src/services/authentication/index.ts +2 -18
- package/src/services/bizlicxjjh5/index.ts +2 -32
- package/src/services/bizlicxjjh5api/index.ts +2 -32
- package/src/services/dataservice/index.ts +4 -2
- package/src/services/h5usersign/index.ts +2 -14
- package/src/services/index.ts +3 -2
- package/src/services/invoice/index.ts +2 -38
- package/src/services/payment/index.ts +27 -67
- package/src/services/tax/index.ts +2 -0
- package/src/services/uploadusersign/index.ts +88 -0
- package/tdsformat.js +22 -0
- package/tsconfig.json +2 -1
- package/yzh/common/client.d.ts +7 -4
- package/yzh/common/client.js +12 -6
- 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 +88 -14
- package/yzh/services/payment/index.js +24 -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
package/yzh/common/client.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export declare class YZHClient {
|
|
|
9
9
|
yzh_public_key: string;
|
|
10
10
|
sign_type: "rsa" | "sha256";
|
|
11
11
|
base_url?: string;
|
|
12
|
+
timeout?: number;
|
|
12
13
|
/**
|
|
13
14
|
* 构造函数参数
|
|
14
15
|
* @param {string} dealer_id 平台企业 ID
|
|
@@ -17,8 +18,9 @@ export declare class YZHClient {
|
|
|
17
18
|
* @param {string} des3_key 3DES Key
|
|
18
19
|
* @param {string} private_key 平台企业私钥
|
|
19
20
|
* @param {string} yzh_public_key 云账户公钥
|
|
20
|
-
* @param {string} sign_type
|
|
21
|
+
* @param {string} sign_type 签名算法,支持 RSA、HMAC,枚举分别为 rsa、sha256
|
|
21
22
|
* @param {string} base_url 可选,默认为 https://api-service.yunzhanghu.com/
|
|
23
|
+
* @param {number} timeout 请求超时时间。可选,默认30*1000ms。0为永不超时。
|
|
22
24
|
*/
|
|
23
25
|
constructor(conf: {
|
|
24
26
|
dealer_id: string;
|
|
@@ -29,6 +31,7 @@ export declare class YZHClient {
|
|
|
29
31
|
yzh_public_key: string;
|
|
30
32
|
sign_type: "rsa" | "sha256";
|
|
31
33
|
base_url?: string;
|
|
34
|
+
timeout?: number;
|
|
32
35
|
});
|
|
33
36
|
private doRequest;
|
|
34
37
|
request(method: string, action: string, req?: any, options?: {
|
|
@@ -41,7 +44,7 @@ export declare class YZHClient {
|
|
|
41
44
|
*/
|
|
42
45
|
private generatorRequestParams;
|
|
43
46
|
/**
|
|
44
|
-
* 生成签名(RSA
|
|
47
|
+
* 生成签名(RSA 签名算法)
|
|
45
48
|
* @param {string} data 经过加密后的具体数据
|
|
46
49
|
* @param {string} mess 自定义随机字符串,用于签名
|
|
47
50
|
* @param {string} timestamp 时间戳,精确到秒
|
|
@@ -49,7 +52,7 @@ export declare class YZHClient {
|
|
|
49
52
|
*/
|
|
50
53
|
private signRSASHA256;
|
|
51
54
|
/**
|
|
52
|
-
* 生成签名(
|
|
55
|
+
* 生成签名(HMAC 签名算法)
|
|
53
56
|
* @param {string} data 经过加密后的具体数据
|
|
54
57
|
* @param {string} mess 自定义随机字符串,用于签名
|
|
55
58
|
* @param {string} timestamp 时间戳,精确到秒
|
|
@@ -61,7 +64,7 @@ export declare class YZHClient {
|
|
|
61
64
|
* @param {string} data 经过加密后的具体数据
|
|
62
65
|
* @param {string} mess 自定义随机字符串,用于签名
|
|
63
66
|
* @param {string} timestamp 时间戳,精确到秒
|
|
64
|
-
* @param {string} sign_type
|
|
67
|
+
* @param {string} sign_type 签名算法,支持 RSA、HMAC,枚举分别为 rsa、sha256
|
|
65
68
|
* @returns {string} 签名内容
|
|
66
69
|
*/
|
|
67
70
|
private sign;
|
package/yzh/common/client.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.YZHClient = void 0;
|
|
4
|
-
|
|
4
|
+
/* eslint-disable no-param-reassign */
|
|
5
5
|
const crypto = require("crypto");
|
|
6
|
+
const http_1 = require("../common/http");
|
|
6
7
|
const yzhSDKHttpException_1 = require("./exception/yzhSDKHttpException");
|
|
7
8
|
const clearEncoding = "utf8";
|
|
8
9
|
const cipherEncoding = "base64";
|
|
@@ -15,12 +16,13 @@ class YZHClient {
|
|
|
15
16
|
* @param {string} des3_key 3DES Key
|
|
16
17
|
* @param {string} private_key 平台企业私钥
|
|
17
18
|
* @param {string} yzh_public_key 云账户公钥
|
|
18
|
-
* @param {string} sign_type
|
|
19
|
+
* @param {string} sign_type 签名算法,支持 RSA、HMAC,枚举分别为 rsa、sha256
|
|
19
20
|
* @param {string} base_url 可选,默认为 https://api-service.yunzhanghu.com/
|
|
21
|
+
* @param {number} timeout 请求超时时间。可选,默认30*1000ms。0为永不超时。
|
|
20
22
|
*/
|
|
21
23
|
constructor(conf) {
|
|
22
24
|
/**
|
|
23
|
-
* 生成签名(RSA
|
|
25
|
+
* 生成签名(RSA 签名算法)
|
|
24
26
|
* @param {string} data 经过加密后的具体数据
|
|
25
27
|
* @param {string} mess 自定义随机字符串,用于签名
|
|
26
28
|
* @param {string} timestamp 时间戳,精确到秒
|
|
@@ -39,7 +41,7 @@ class YZHClient {
|
|
|
39
41
|
}
|
|
40
42
|
};
|
|
41
43
|
/**
|
|
42
|
-
* 生成签名(
|
|
44
|
+
* 生成签名(HMAC 签名算法)
|
|
43
45
|
* @param {string} data 经过加密后的具体数据
|
|
44
46
|
* @param {string} mess 自定义随机字符串,用于签名
|
|
45
47
|
* @param {string} timestamp 时间戳,精确到秒
|
|
@@ -61,7 +63,7 @@ class YZHClient {
|
|
|
61
63
|
* @param {string} data 经过加密后的具体数据
|
|
62
64
|
* @param {string} mess 自定义随机字符串,用于签名
|
|
63
65
|
* @param {string} timestamp 时间戳,精确到秒
|
|
64
|
-
* @param {string} sign_type
|
|
66
|
+
* @param {string} sign_type 签名算法,支持 RSA、HMAC,枚举分别为 rsa、sha256
|
|
65
67
|
* @returns {string} 签名内容
|
|
66
68
|
*/
|
|
67
69
|
this.sign = (data, mess, timestamp) => {
|
|
@@ -82,6 +84,7 @@ class YZHClient {
|
|
|
82
84
|
}
|
|
83
85
|
};
|
|
84
86
|
// 自定义随机字符串
|
|
87
|
+
// eslint-disable-next-line class-methods-use-this
|
|
85
88
|
this.mess = () => {
|
|
86
89
|
const buf = crypto.randomBytes(16);
|
|
87
90
|
const token = buf.toString("hex");
|
|
@@ -218,6 +221,7 @@ class YZHClient {
|
|
|
218
221
|
this.yzh_public_key = conf.yzh_public_key;
|
|
219
222
|
this.sign_type = conf.sign_type;
|
|
220
223
|
this.base_url = conf === null || conf === void 0 ? void 0 : conf.base_url;
|
|
224
|
+
this.timeout = conf === null || conf === void 0 ? void 0 : conf.timeout;
|
|
221
225
|
}
|
|
222
226
|
else {
|
|
223
227
|
throw new yzhSDKHttpException_1.default(`实例初始化失败,请检查以下配置是否缺失:\ndealer_id、broker_id、app_key、des3_key、private_key、yzh_public_key、sign_type`);
|
|
@@ -233,9 +237,10 @@ class YZHClient {
|
|
|
233
237
|
request_id: request_id !== null && request_id !== void 0 ? request_id : this.mess(),
|
|
234
238
|
dealer_id: this.dealer_id,
|
|
235
239
|
base_url: this.base_url,
|
|
240
|
+
timeout: this.timeout,
|
|
236
241
|
});
|
|
237
242
|
// 返回请求实例
|
|
238
|
-
const baseInstanceConf = { method
|
|
243
|
+
const baseInstanceConf = { method, url: action };
|
|
239
244
|
let instanceConf;
|
|
240
245
|
if (method === "get") {
|
|
241
246
|
instanceConf = { ...baseInstanceConf, params: encryptParams };
|
|
@@ -292,6 +297,7 @@ class YZHClient {
|
|
|
292
297
|
}
|
|
293
298
|
}
|
|
294
299
|
// 返回处理结果
|
|
300
|
+
// eslint-disable-next-line @typescript-eslint/require-await
|
|
295
301
|
async parseResponse(result, encryption) {
|
|
296
302
|
if (result.status !== 200) {
|
|
297
303
|
const yzhError = new yzhSDKHttpException_1.default(result.statusText);
|
package/yzh/common/http/index.js
CHANGED
|
@@ -3,28 +3,38 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const axios_1 = require("axios");
|
|
4
4
|
const urlencode = require("urlencode");
|
|
5
5
|
const pkg = require("../../../package.json");
|
|
6
|
-
const
|
|
6
|
+
const JsonBigString = require("json-bigint")({ storeAsString: true });
|
|
7
7
|
const BASE_URL = "https://api-service.yunzhanghu.com/";
|
|
8
8
|
const getInstance = (config = {}) => {
|
|
9
|
+
var _a;
|
|
9
10
|
const instance = axios_1.default.create({
|
|
10
11
|
baseURL: config.base_url || BASE_URL,
|
|
11
12
|
headers: {
|
|
12
13
|
"request-id": config === null || config === void 0 ? void 0 : config.request_id,
|
|
13
14
|
"dealer-id": config === null || config === void 0 ? void 0 : config.dealer_id,
|
|
14
15
|
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
|
|
15
|
-
"User-Agent": `yunzhanghu-sdk-nodejs/${pkg.version}/${
|
|
16
|
-
.execSync("uname -m -r -s")
|
|
17
|
-
.toString("utf-8")
|
|
18
|
-
.replace("\n", "")}/${process.version}`,
|
|
16
|
+
"User-Agent": `yunzhanghu-sdk-nodejs/${pkg.version}/${process.version}`,
|
|
19
17
|
},
|
|
20
|
-
timeout: 30 * 1000,
|
|
18
|
+
timeout: (_a = config.timeout) !== null && _a !== void 0 ? _a : 30 * 1000,
|
|
19
|
+
transformResponse: [
|
|
20
|
+
function toJson(data) {
|
|
21
|
+
try {
|
|
22
|
+
return JsonBigString.parse(data);
|
|
23
|
+
}
|
|
24
|
+
catch (e) {
|
|
25
|
+
// data 返回的内容不是合法的json字符串时会报错,此时直接返回原 data 数据
|
|
26
|
+
return data;
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
],
|
|
21
30
|
});
|
|
22
31
|
// 拦截器
|
|
23
|
-
instance.interceptors.request.use(
|
|
32
|
+
instance.interceptors.request.use((config) => {
|
|
24
33
|
// URL Encode
|
|
25
34
|
if (config.method === "get") {
|
|
26
35
|
const { params: urlData } = config;
|
|
27
36
|
const { data, sign, ...resData } = urlData;
|
|
37
|
+
// eslint-disable-next-line no-param-reassign
|
|
28
38
|
config.data = {
|
|
29
39
|
data: urlencode(data),
|
|
30
40
|
sign: urlencode(sign),
|
|
@@ -33,7 +43,7 @@ const getInstance = (config = {}) => {
|
|
|
33
43
|
}
|
|
34
44
|
return config;
|
|
35
45
|
});
|
|
36
|
-
instance.interceptors.response.use(
|
|
46
|
+
instance.interceptors.response.use((response) => {
|
|
37
47
|
const { data } = response;
|
|
38
48
|
if (data) {
|
|
39
49
|
const { request_id, requestID, ...resResponse } = data;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import YZHclient from
|
|
1
|
+
import YZHclient from '../../common/client';
|
|
2
2
|
/** ApiUseSignContractRequest 获取协议预览 URL 请求 */
|
|
3
3
|
interface ApiUseSignContractRequest {
|
|
4
4
|
/** 平台企业 ID */
|
|
@@ -6,6 +6,7 @@ interface ApiUseSignContractRequest {
|
|
|
6
6
|
/** 综合服务主体 ID */
|
|
7
7
|
broker_id: string;
|
|
8
8
|
}
|
|
9
|
+
|
|
9
10
|
/** ApiUseSignContractResponse 获取协议预览 URL 返回 */
|
|
10
11
|
interface ApiUseSignContractResponse {
|
|
11
12
|
/** 预览跳转 URL */
|
|
@@ -13,6 +14,7 @@ interface ApiUseSignContractResponse {
|
|
|
13
14
|
/** 协议名称 */
|
|
14
15
|
title: string;
|
|
15
16
|
}
|
|
17
|
+
|
|
16
18
|
/** ApiUserSignContractRequest 获取协议预览 URL 请求 V2 */
|
|
17
19
|
interface ApiUserSignContractRequest {
|
|
18
20
|
/** 平台企业 ID */
|
|
@@ -20,6 +22,7 @@ interface ApiUserSignContractRequest {
|
|
|
20
22
|
/** 综合服务主体 ID */
|
|
21
23
|
broker_id: string;
|
|
22
24
|
}
|
|
25
|
+
|
|
23
26
|
/** ApiUserSignContractResponse 获取协议预览 URL 返回 V2 */
|
|
24
27
|
interface ApiUserSignContractResponse {
|
|
25
28
|
/** 预览跳转 URL */
|
|
@@ -27,6 +30,7 @@ interface ApiUserSignContractResponse {
|
|
|
27
30
|
/** 协议名称 */
|
|
28
31
|
title: string;
|
|
29
32
|
}
|
|
33
|
+
|
|
30
34
|
/** ApiUserSignRequest 用户签约请求 */
|
|
31
35
|
interface ApiUserSignRequest {
|
|
32
36
|
/** 综合服务主体 ID */
|
|
@@ -40,11 +44,13 @@ interface ApiUserSignRequest {
|
|
|
40
44
|
/** 证件类型 idcard:身份证 passport:护照 mtphkm:港澳居民来往内地通行证 mtpt:台湾居民往来大陆通行证 rphkm:中华人民共和国港澳居民居住证 rpt:中华人民共和国台湾居民居住证 fpr:外国人永久居留身份证 ffwp:中华人民共和国外国人就业许可证书 */
|
|
41
45
|
card_type: string;
|
|
42
46
|
}
|
|
47
|
+
|
|
43
48
|
/** ApiUserSignResponse 用户签约返回 */
|
|
44
49
|
interface ApiUserSignResponse {
|
|
45
50
|
/** 是否签约成功 */
|
|
46
51
|
status: string;
|
|
47
52
|
}
|
|
53
|
+
|
|
48
54
|
/** GetApiUserSignStatusRequest 获取用户签约状态请求 */
|
|
49
55
|
interface GetApiUserSignStatusRequest {
|
|
50
56
|
/** 平台企业 ID */
|
|
@@ -56,6 +62,7 @@ interface GetApiUserSignStatusRequest {
|
|
|
56
62
|
/** 证件号码 */
|
|
57
63
|
id_card: string;
|
|
58
64
|
}
|
|
65
|
+
|
|
59
66
|
/** GetApiUserSignStatusResponse 获取用户签约状态返回 */
|
|
60
67
|
interface GetApiUserSignStatusResponse {
|
|
61
68
|
/** 签约时间 */
|
|
@@ -63,6 +70,7 @@ interface GetApiUserSignStatusResponse {
|
|
|
63
70
|
/** 用户签约状态 */
|
|
64
71
|
status: string;
|
|
65
72
|
}
|
|
73
|
+
|
|
66
74
|
/** ApiUserSignReleaseRequest 用户解约(测试账号专用接口)请求 */
|
|
67
75
|
interface ApiUserSignReleaseRequest {
|
|
68
76
|
/** 综合服务主体 ID */
|
|
@@ -76,11 +84,13 @@ interface ApiUserSignReleaseRequest {
|
|
|
76
84
|
/** 证件类型 idcard:身份证 passport:护照 mtphkm:港澳居民来往内地通行证 mtpt:台湾居民往来大陆通行证 rphkm:中华人民共和国港澳居民居住证 rpt:中华人民共和国台湾居民居住证 fpr:外国人永久居留身份证 ffwp:中华人民共和国外国人就业许可证书 */
|
|
77
85
|
card_type: string;
|
|
78
86
|
}
|
|
87
|
+
|
|
79
88
|
/** ApiUserSignReleaseResponse 用户解约(测试账号专用接口)返回 */
|
|
80
89
|
interface ApiUserSignReleaseResponse {
|
|
81
90
|
/** 是否解约成功 */
|
|
82
91
|
status: string;
|
|
83
92
|
}
|
|
93
|
+
|
|
84
94
|
export declare class ApiUserSignServiceClient extends YZHclient {
|
|
85
95
|
constructor(conf: {
|
|
86
96
|
dealer_id: string;
|
|
@@ -89,13 +99,30 @@ export declare class ApiUserSignServiceClient extends YZHclient {
|
|
|
89
99
|
des3_key: string;
|
|
90
100
|
private_key: string;
|
|
91
101
|
yzh_public_key: string;
|
|
92
|
-
sign_type:
|
|
102
|
+
sign_type: 'rsa' | 'sha256';
|
|
93
103
|
base_url?: string;
|
|
104
|
+
timeout?: number;
|
|
94
105
|
});
|
|
95
|
-
ApiUseSignContract(
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
106
|
+
ApiUseSignContract(
|
|
107
|
+
req: ApiUseSignContractRequest,
|
|
108
|
+
cb?: (error: null | string, rep: ApiUseSignContractResponse) => void
|
|
109
|
+
): Promise<ApiUseSignContractResponse>;
|
|
110
|
+
ApiUserSignContract(
|
|
111
|
+
req: ApiUserSignContractRequest,
|
|
112
|
+
cb?: (error: null | string, rep: ApiUserSignContractResponse) => void
|
|
113
|
+
): Promise<ApiUserSignContractResponse>;
|
|
114
|
+
ApiUserSign(
|
|
115
|
+
req: ApiUserSignRequest,
|
|
116
|
+
cb?: (error: null | string, rep: ApiUserSignResponse) => void
|
|
117
|
+
): Promise<ApiUserSignResponse>;
|
|
118
|
+
GetApiUserSignStatus(
|
|
119
|
+
req: GetApiUserSignStatusRequest,
|
|
120
|
+
cb?: (error: null | string, rep: GetApiUserSignStatusResponse) => void
|
|
121
|
+
): Promise<GetApiUserSignStatusResponse>;
|
|
122
|
+
ApiUserSignRelease(
|
|
123
|
+
req: ApiUserSignReleaseRequest,
|
|
124
|
+
cb?: (error: null | string, rep: ApiUserSignReleaseResponse) => void
|
|
125
|
+
): Promise<ApiUserSignReleaseResponse>;
|
|
100
126
|
}
|
|
127
|
+
|
|
101
128
|
export {};
|
|
@@ -1,30 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3
3
|
exports.ApiUserSignServiceClient = void 0;
|
|
4
|
-
const client_1 = require(
|
|
4
|
+
const client_1 = require('../../common/client');
|
|
5
5
|
class ApiUserSignServiceClient extends client_1.default {
|
|
6
|
+
// eslint-disable-next-line no-useless-constructor
|
|
6
7
|
constructor(conf) {
|
|
7
8
|
super(conf);
|
|
8
9
|
}
|
|
9
10
|
// ApiUseSignContract 获取协议预览 URL
|
|
10
11
|
async ApiUseSignContract(req, cb) {
|
|
11
|
-
return this.request(
|
|
12
|
+
return this.request('get', '/api/sign/v1/user/contract', req, { encryption: false }, cb);
|
|
12
13
|
}
|
|
13
14
|
// ApiUserSignContract 获取协议预览 URL V2
|
|
14
15
|
async ApiUserSignContract(req, cb) {
|
|
15
|
-
return this.request(
|
|
16
|
+
return this.request('get', '/api/sign/v1/user/contract', req, { encryption: false }, cb);
|
|
16
17
|
}
|
|
17
18
|
// ApiUserSign 用户签约
|
|
18
19
|
async ApiUserSign(req, cb) {
|
|
19
|
-
return this.request(
|
|
20
|
+
return this.request('post', '/api/sign/v1/user/sign', req, { encryption: false }, cb);
|
|
20
21
|
}
|
|
21
22
|
// GetApiUserSignStatus 获取用户签约状态
|
|
22
23
|
async GetApiUserSignStatus(req, cb) {
|
|
23
|
-
return this.request(
|
|
24
|
+
return this.request('get', '/api/sign/v1/user/status', req, { encryption: false }, cb);
|
|
24
25
|
}
|
|
25
26
|
// ApiUserSignRelease 用户解约(测试账号专用接口)
|
|
26
27
|
async ApiUserSignRelease(req, cb) {
|
|
27
|
-
return this.request(
|
|
28
|
+
return this.request('post', '/api/sign/v1/user/release', req, { encryption: false }, cb);
|
|
28
29
|
}
|
|
29
30
|
}
|
|
30
31
|
exports.ApiUserSignServiceClient = ApiUserSignServiceClient;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import YZHclient from
|
|
1
|
+
import YZHclient from '../../common/client';
|
|
2
2
|
/** BankCardFourAuthVerifyRequest 银行卡四要素鉴权请求(下发短信验证码)请求 */
|
|
3
3
|
interface BankCardFourAuthVerifyRequest {
|
|
4
4
|
/** 银行卡号 */
|
|
@@ -10,11 +10,13 @@ interface BankCardFourAuthVerifyRequest {
|
|
|
10
10
|
/** 银行预留手机号 */
|
|
11
11
|
mobile: string;
|
|
12
12
|
}
|
|
13
|
+
|
|
13
14
|
/** BankCardFourAuthVerifyResponse 银行卡四要素鉴权请求(下发短信验证码)返回 */
|
|
14
15
|
interface BankCardFourAuthVerifyResponse {
|
|
15
16
|
/** 交易凭证 */
|
|
16
17
|
ref: string;
|
|
17
18
|
}
|
|
19
|
+
|
|
18
20
|
/** BankCardFourAuthConfirmRequest 银行卡四要素确认请求(上传短信验证码)请求 */
|
|
19
21
|
interface BankCardFourAuthConfirmRequest {
|
|
20
22
|
/** 银行卡号 */
|
|
@@ -30,9 +32,10 @@ interface BankCardFourAuthConfirmRequest {
|
|
|
30
32
|
/** 交易凭证 */
|
|
31
33
|
ref: string;
|
|
32
34
|
}
|
|
35
|
+
|
|
33
36
|
/** BankCardFourAuthConfirmResponse 银行卡四要素确认请求(上传短信验证码)返回 */
|
|
34
|
-
interface BankCardFourAuthConfirmResponse {
|
|
35
|
-
|
|
37
|
+
interface BankCardFourAuthConfirmResponse {}
|
|
38
|
+
|
|
36
39
|
/** BankCardFourVerifyRequest 银行卡四要素验证请求 */
|
|
37
40
|
interface BankCardFourVerifyRequest {
|
|
38
41
|
/** 银行卡号 */
|
|
@@ -44,9 +47,10 @@ interface BankCardFourVerifyRequest {
|
|
|
44
47
|
/** 银行预留手机号 */
|
|
45
48
|
mobile: string;
|
|
46
49
|
}
|
|
50
|
+
|
|
47
51
|
/** BankCardFourVerifyResponse 银行卡四要素验证返回 */
|
|
48
|
-
interface BankCardFourVerifyResponse {
|
|
49
|
-
|
|
52
|
+
interface BankCardFourVerifyResponse {}
|
|
53
|
+
|
|
50
54
|
/** BankCardThreeVerifyRequest 银行卡三要素验证请求 */
|
|
51
55
|
interface BankCardThreeVerifyRequest {
|
|
52
56
|
/** 银行卡号 */
|
|
@@ -56,9 +60,10 @@ interface BankCardThreeVerifyRequest {
|
|
|
56
60
|
/** 姓名 */
|
|
57
61
|
real_name: string;
|
|
58
62
|
}
|
|
63
|
+
|
|
59
64
|
/** BankCardThreeVerifyResponse 银行卡三要素验证返回 */
|
|
60
|
-
interface BankCardThreeVerifyResponse {
|
|
61
|
-
|
|
65
|
+
interface BankCardThreeVerifyResponse {}
|
|
66
|
+
|
|
62
67
|
/** IDCardVerifyRequest 身份证实名验证请求 */
|
|
63
68
|
interface IDCardVerifyRequest {
|
|
64
69
|
/** 身份证号码 */
|
|
@@ -66,9 +71,10 @@ interface IDCardVerifyRequest {
|
|
|
66
71
|
/** 姓名 */
|
|
67
72
|
real_name: string;
|
|
68
73
|
}
|
|
74
|
+
|
|
69
75
|
/** IDCardVerifyResponse 身份证实名验证返回 */
|
|
70
|
-
interface IDCardVerifyResponse {
|
|
71
|
-
|
|
76
|
+
interface IDCardVerifyResponse {}
|
|
77
|
+
|
|
72
78
|
/** UserExemptedInfoRequest 上传免验证用户名单信息请求 */
|
|
73
79
|
interface UserExemptedInfoRequest {
|
|
74
80
|
/** 证件类型码 */
|
|
@@ -96,11 +102,13 @@ interface UserExemptedInfoRequest {
|
|
|
96
102
|
/** 请求流水号 */
|
|
97
103
|
ref: string;
|
|
98
104
|
}
|
|
105
|
+
|
|
99
106
|
/** UserExemptedInfoResponse 上传免验证用户名单信息返回 */
|
|
100
107
|
interface UserExemptedInfoResponse {
|
|
101
108
|
/** 是否上传成功 */
|
|
102
109
|
ok: string;
|
|
103
110
|
}
|
|
111
|
+
|
|
104
112
|
/** UserWhiteCheckRequest 查看免验证用户名单是否存在请求 */
|
|
105
113
|
interface UserWhiteCheckRequest {
|
|
106
114
|
/** 证件号码 */
|
|
@@ -108,10 +116,12 @@ interface UserWhiteCheckRequest {
|
|
|
108
116
|
/** 姓名 */
|
|
109
117
|
real_name: string;
|
|
110
118
|
}
|
|
119
|
+
|
|
111
120
|
/** UserWhiteCheckResponse 查看免验证用户名单是否存在返回 */
|
|
112
121
|
interface UserWhiteCheckResponse {
|
|
113
122
|
ok: boolean;
|
|
114
123
|
}
|
|
124
|
+
|
|
115
125
|
/** GetBankCardInfoRequest 银行卡信息查询请求 */
|
|
116
126
|
interface GetBankCardInfoRequest {
|
|
117
127
|
/** 银行卡号 */
|
|
@@ -119,6 +129,7 @@ interface GetBankCardInfoRequest {
|
|
|
119
129
|
/** 银行名称 */
|
|
120
130
|
bank_name: string;
|
|
121
131
|
}
|
|
132
|
+
|
|
122
133
|
/** GetBankCardInfoResponse 银行卡信息查询返回 */
|
|
123
134
|
interface GetBankCardInfoResponse {
|
|
124
135
|
/** 银行代码 */
|
|
@@ -130,6 +141,7 @@ interface GetBankCardInfoResponse {
|
|
|
130
141
|
/** 云账户是否支持向该银行支付 */
|
|
131
142
|
is_support: boolean;
|
|
132
143
|
}
|
|
144
|
+
|
|
133
145
|
export declare class AuthenticationClient extends YZHclient {
|
|
134
146
|
constructor(conf: {
|
|
135
147
|
dealer_id: string;
|
|
@@ -138,16 +150,42 @@ export declare class AuthenticationClient extends YZHclient {
|
|
|
138
150
|
des3_key: string;
|
|
139
151
|
private_key: string;
|
|
140
152
|
yzh_public_key: string;
|
|
141
|
-
sign_type:
|
|
153
|
+
sign_type: 'rsa' | 'sha256';
|
|
142
154
|
base_url?: string;
|
|
155
|
+
timeout?: number;
|
|
143
156
|
});
|
|
144
|
-
BankCardFourAuthVerify(
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
157
|
+
BankCardFourAuthVerify(
|
|
158
|
+
req: BankCardFourAuthVerifyRequest,
|
|
159
|
+
cb?: (error: null | string, rep: BankCardFourAuthVerifyResponse) => void
|
|
160
|
+
): Promise<BankCardFourAuthVerifyResponse>;
|
|
161
|
+
BankCardFourAuthConfirm(
|
|
162
|
+
req: BankCardFourAuthConfirmRequest,
|
|
163
|
+
cb?: (error: null | string, rep: BankCardFourAuthConfirmResponse) => void
|
|
164
|
+
): Promise<BankCardFourAuthConfirmResponse>;
|
|
165
|
+
BankCardFourVerify(
|
|
166
|
+
req: BankCardFourVerifyRequest,
|
|
167
|
+
cb?: (error: null | string, rep: BankCardFourVerifyResponse) => void
|
|
168
|
+
): Promise<BankCardFourVerifyResponse>;
|
|
169
|
+
BankCardThreeVerify(
|
|
170
|
+
req: BankCardThreeVerifyRequest,
|
|
171
|
+
cb?: (error: null | string, rep: BankCardThreeVerifyResponse) => void
|
|
172
|
+
): Promise<BankCardThreeVerifyResponse>;
|
|
173
|
+
IDCardVerify(
|
|
174
|
+
req: IDCardVerifyRequest,
|
|
175
|
+
cb?: (error: null | string, rep: IDCardVerifyResponse) => void
|
|
176
|
+
): Promise<IDCardVerifyResponse>;
|
|
177
|
+
UserExemptedInfo(
|
|
178
|
+
req: UserExemptedInfoRequest,
|
|
179
|
+
cb?: (error: null | string, rep: UserExemptedInfoResponse) => void
|
|
180
|
+
): Promise<UserExemptedInfoResponse>;
|
|
181
|
+
UserWhiteCheck(
|
|
182
|
+
req: UserWhiteCheckRequest,
|
|
183
|
+
cb?: (error: null | string, rep: UserWhiteCheckResponse) => void
|
|
184
|
+
): Promise<UserWhiteCheckResponse>;
|
|
185
|
+
GetBankCardInfo(
|
|
186
|
+
req: GetBankCardInfoRequest,
|
|
187
|
+
cb?: (error: null | string, rep: GetBankCardInfoResponse) => void
|
|
188
|
+
): Promise<GetBankCardInfoResponse>;
|
|
189
|
+
}
|
|
190
|
+
|
|
153
191
|
export {};
|
|
@@ -1,42 +1,43 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3
3
|
exports.AuthenticationClient = void 0;
|
|
4
|
-
const client_1 = require(
|
|
4
|
+
const client_1 = require('../../common/client');
|
|
5
5
|
class AuthenticationClient extends client_1.default {
|
|
6
|
+
// eslint-disable-next-line no-useless-constructor
|
|
6
7
|
constructor(conf) {
|
|
7
8
|
super(conf);
|
|
8
9
|
}
|
|
9
10
|
// BankCardFourAuthVerify 银行卡四要素鉴权请求(下发短信验证码)
|
|
10
11
|
async BankCardFourAuthVerify(req, cb) {
|
|
11
|
-
return this.request(
|
|
12
|
+
return this.request('post', '/authentication/verify-request', req, { encryption: false }, cb);
|
|
12
13
|
}
|
|
13
14
|
// BankCardFourAuthConfirm 银行卡四要素确认请求(上传短信验证码)
|
|
14
15
|
async BankCardFourAuthConfirm(req, cb) {
|
|
15
|
-
return this.request(
|
|
16
|
+
return this.request('post', '/authentication/verify-confirm', req, { encryption: false }, cb);
|
|
16
17
|
}
|
|
17
18
|
// BankCardFourVerify 银行卡四要素验证
|
|
18
19
|
async BankCardFourVerify(req, cb) {
|
|
19
|
-
return this.request(
|
|
20
|
+
return this.request('post', '/authentication/verify-bankcard-four-factor', req, { encryption: false }, cb);
|
|
20
21
|
}
|
|
21
22
|
// BankCardThreeVerify 银行卡三要素验证
|
|
22
23
|
async BankCardThreeVerify(req, cb) {
|
|
23
|
-
return this.request(
|
|
24
|
+
return this.request('post', '/authentication/verify-bankcard-three-factor', req, { encryption: false }, cb);
|
|
24
25
|
}
|
|
25
26
|
// IDCardVerify 身份证实名验证
|
|
26
27
|
async IDCardVerify(req, cb) {
|
|
27
|
-
return this.request(
|
|
28
|
+
return this.request('post', '/authentication/verify-id', req, { encryption: false }, cb);
|
|
28
29
|
}
|
|
29
30
|
// UserExemptedInfo 上传免验证用户名单信息
|
|
30
31
|
async UserExemptedInfo(req, cb) {
|
|
31
|
-
return this.request(
|
|
32
|
+
return this.request('post', '/api/payment/v1/user/exempted/info', req, { encryption: false }, cb);
|
|
32
33
|
}
|
|
33
34
|
// UserWhiteCheck 查看免验证用户名单是否存在
|
|
34
35
|
async UserWhiteCheck(req, cb) {
|
|
35
|
-
return this.request(
|
|
36
|
+
return this.request('post', '/api/payment/v1/user/white/check', req, { encryption: false }, cb);
|
|
36
37
|
}
|
|
37
38
|
// GetBankCardInfo 银行卡信息查询接口
|
|
38
39
|
async GetBankCardInfo(req, cb) {
|
|
39
|
-
return this.request(
|
|
40
|
+
return this.request('get', '/api/payment/v1/card', req, { encryption: false }, cb);
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
43
|
exports.AuthenticationClient = AuthenticationClient;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import YZHclient from
|
|
1
|
+
import YZHclient from '../../common/client';
|
|
2
2
|
/** H5GetStartUrlRequest 预启动请求 */
|
|
3
3
|
interface H5GetStartUrlRequest {
|
|
4
4
|
/** 平台企业 ID */
|
|
@@ -18,11 +18,13 @@ interface H5GetStartUrlRequest {
|
|
|
18
18
|
/** H5 页面 Title */
|
|
19
19
|
customer_title: number;
|
|
20
20
|
}
|
|
21
|
+
|
|
21
22
|
/** H5GetStartUrlResponse 预启动返回 */
|
|
22
23
|
interface H5GetStartUrlResponse {
|
|
23
24
|
/** 跳转 URL */
|
|
24
25
|
h5_url: string;
|
|
25
26
|
}
|
|
27
|
+
|
|
26
28
|
/** H5EcoCityAicStatusRequest 查询个体工商户状态请求 */
|
|
27
29
|
interface H5EcoCityAicStatusRequest {
|
|
28
30
|
/** 平台企业 ID */
|
|
@@ -38,6 +40,7 @@ interface H5EcoCityAicStatusRequest {
|
|
|
38
40
|
/** 用户唯一标识 */
|
|
39
41
|
open_id: string;
|
|
40
42
|
}
|
|
43
|
+
|
|
41
44
|
/** H5EcoCityAicStatusResponse 查询个体工商户状态返回 */
|
|
42
45
|
interface H5EcoCityAicStatusResponse {
|
|
43
46
|
/** 用户签约状态 */
|
|
@@ -59,6 +62,7 @@ interface H5EcoCityAicStatusResponse {
|
|
|
59
62
|
/** 姓名 */
|
|
60
63
|
real_name: string;
|
|
61
64
|
}
|
|
65
|
+
|
|
62
66
|
export declare class BizlicXjjH5ServiceClient extends YZHclient {
|
|
63
67
|
constructor(conf: {
|
|
64
68
|
dealer_id: string;
|
|
@@ -67,10 +71,18 @@ export declare class BizlicXjjH5ServiceClient extends YZHclient {
|
|
|
67
71
|
des3_key: string;
|
|
68
72
|
private_key: string;
|
|
69
73
|
yzh_public_key: string;
|
|
70
|
-
sign_type:
|
|
74
|
+
sign_type: 'rsa' | 'sha256';
|
|
71
75
|
base_url?: string;
|
|
76
|
+
timeout?: number;
|
|
72
77
|
});
|
|
73
|
-
H5GetStartUrl(
|
|
74
|
-
|
|
78
|
+
H5GetStartUrl(
|
|
79
|
+
req: H5GetStartUrlRequest,
|
|
80
|
+
cb?: (error: null | string, rep: H5GetStartUrlResponse) => void
|
|
81
|
+
): Promise<H5GetStartUrlResponse>;
|
|
82
|
+
H5EcoCityAicStatus(
|
|
83
|
+
req: H5EcoCityAicStatusRequest,
|
|
84
|
+
cb?: (error: null | string, rep: H5EcoCityAicStatusResponse) => void
|
|
85
|
+
): Promise<H5EcoCityAicStatusResponse>;
|
|
75
86
|
}
|
|
87
|
+
|
|
76
88
|
export {};
|