@yunzhanghu/sdk-nodejs 0.0.4 → 1.0.1

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 (45) hide show
  1. package/README.md +16 -14
  2. package/example/apiUserSign.js +3 -3
  3. package/example/authentication.js +1 -1
  4. package/example/bizlicXjjH5.js +1 -1
  5. package/example/bizlicXjjH5Api.js +4 -1
  6. package/example/dataService.js +1 -1
  7. package/example/h5UserSign.js +2 -2
  8. package/example/invoice.js +14 -1
  9. package/example/notify.js +1 -1
  10. package/example/payment.js +1 -1
  11. package/example/tax.js +1 -1
  12. package/package.json +1 -1
  13. package/src/common/client.ts +14 -13
  14. package/src/services/apiusersign/index.ts +25 -1
  15. package/src/services/authentication/index.ts +1 -1
  16. package/src/services/bizlicxjjh5/index.ts +2 -2
  17. package/src/services/bizlicxjjh5api/index.ts +2 -2
  18. package/src/services/dataservice/index.ts +1 -1
  19. package/src/services/h5usersign/index.ts +1 -1
  20. package/src/services/index.ts +9 -9
  21. package/src/services/invoice/index.ts +49 -1
  22. package/src/services/payment/index.ts +1 -1
  23. package/src/services/tax/index.ts +1 -1
  24. package/yzh/common/client.d.ts +5 -5
  25. package/yzh/common/client.js +15 -15
  26. package/yzh/services/apiusersign/index.d.ts +16 -1
  27. package/yzh/services/apiusersign/index.js +7 -3
  28. package/yzh/services/authentication/index.d.ts +1 -1
  29. package/yzh/services/authentication/index.js +3 -3
  30. package/yzh/services/bizlicxjjh5/index.d.ts +2 -2
  31. package/yzh/services/bizlicxjjh5/index.js +3 -3
  32. package/yzh/services/bizlicxjjh5api/index.d.ts +2 -2
  33. package/yzh/services/bizlicxjjh5api/index.js +3 -3
  34. package/yzh/services/dataservice/index.d.ts +1 -1
  35. package/yzh/services/dataservice/index.js +3 -3
  36. package/yzh/services/h5usersign/index.d.ts +1 -1
  37. package/yzh/services/h5usersign/index.js +3 -3
  38. package/yzh/services/index.d.ts +9 -9
  39. package/yzh/services/index.js +10 -10
  40. package/yzh/services/invoice/index.d.ts +33 -1
  41. package/yzh/services/invoice/index.js +7 -3
  42. package/yzh/services/payment/index.d.ts +1 -1
  43. package/yzh/services/payment/index.js +3 -3
  44. package/yzh/services/tax/index.d.ts +1 -1
  45. package/yzh/services/tax/index.js +3 -3
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # 云账户 SDK for Node.js
2
2
 
3
3
  欢迎使用云账户 SDK for Node.js。
4
- 云账户是一家专注为平台企业和新就业形态劳动者提供高质量灵活就业服务的新时代企业。云账户 SDK 对云账户综合服务平台 API 接口进行封装,让您不必担心过多参数请求,帮助您快速接入到云账户综合服务平台。云账户 SDK for Node.js 为您提供签约、下单、回调、数据查询等功能,帮助您完成与云账户综合服务平台的接口对接及业务开发。
4
+ 云账户是一家专注为平台企业和新就业形态劳动者提供高质量灵活就业服务的新时代企业。云账户 SDK 对云账户综合服务平台 API 接口进行封装,帮助您快速接入到云账户综合服务平台。云账户 SDK for Node.js 为您提供签约、支付、回调、数据查询等功能,帮助您完成与云账户综合服务平台的接口对接及业务开发。
5
5
  如果您在使用过程中遇到任何问题,请在当前 GitHub 提交 Issues,或发送邮件至技术支持组 [techsupport@yunzhanghu.com](mailto:techsupport@yunzhanghu.com)。
6
6
 
7
7
  ## 环境要求
@@ -12,7 +12,7 @@
12
12
 
13
13
  ### 1、获取配置
14
14
 
15
- 使用云账户 SDK for Node.js 前,您需先获取 dealer_id、broker_id、3DES Key、App Key 信息。
15
+ 使用云账户 SDK for Node.js 前,您需先获取 dealer_id、broker_id、3DES Key、App Key、云账户公钥。
16
16
  获取方式:使用开户邮件中的账号登录【[云账户综合服务平台](https://service.yunzhanghu.com)】,选择“业务中心 > 业务管理 > 对接信息”,查看并获取以上配置信息。
17
17
  ![获取配置信息](https://yos.yunzhanghu.com/getobject/duijiexinxi.png?isAttachment=false&fileID=9487bd54b93a5abf49003c2b8ce7e069bfa24220&signature=X%2BR7PocQgPqSpR2xM1TgYU6lAapr%2FB9p3aFof03Gcfw%3D)
18
18
 
@@ -34,37 +34,37 @@ OpenSSL-> rsa -in private_key.pem -pubout -out pubkey.pem
34
34
 
35
35
  - 方式二:使用工具生成
36
36
 
37
- 请联系云账户技术支持获取 RSA 密钥生成工具 > 登录【[云账户开放平台](https://open.yunzhanghu.com/)】,选择“开发工具下载 > 开发助手 > 工具下载”,下载安装“云账户开放平台开发助手”
37
+ 登录【[云账户开放平台](https://open.yunzhanghu.com)】,选择“开发工具下载 > 开发助手 > 工具下载”,下载安装“云账户开放平台开发助手”。
38
38
 
39
39
  ### 3、配置密钥
40
40
 
41
41
  登录【[云账户综合服务平台](https://service.yunzhanghu.com)】,选择“业务中心 > 业务管理 > 对接信息”,单击页面右上角的“编辑”,配置平台企业公钥。
42
42
  ![配置平台企业公钥信息](https://yos.yunzhanghu.com/getobject/dujiexinxi-2.png?isAttachment=false&fileID=84e3cd1684a61c1e32eb0e7b7f43390cd053206b&signature=mqW8Zbk7h3gYXfzjR99pK%2B0pgVLcLly3VjBB2KsqDvQ%3D)
43
43
 
44
- ## 安装 Node.js SDK
44
+ ## 安装云账户 SDK for Node.js
45
45
 
46
46
  ### 通过 NPM 安装
47
47
 
48
- 推荐通过 Node.js 的包管理工具 NPM 获取并安装 Node.js SDK。NPM 详细介绍请参考[ NPM 官网](https://www.npmjs.com/) 。
48
+ 推荐通过 Node.js 的包管理工具 NPM 获取并安装云账户 SDK for Node.js。NPM 详细介绍请参考[ NPM 官网](https://www.npmjs.com) 。
49
49
 
50
- 1. 执行以下安装命令安装云账户 Node.js SDK
50
+ 1. 执行以下安装命令安装云账户 SDK for Node.js:
51
51
 
52
52
  > npm install @yunzhanghu/sdk-nodejs --save
53
53
 
54
- 2. 在您的代码中引用对应模块代码,可参考示例。
54
+ 2. 在您的代码中引用对应模块代码,具体引用方式可参考下文示例。
55
55
 
56
56
  ### 通过源码包安装
57
57
 
58
- 1. 前往 [Github 仓库](https://github.com/YunzhanghuOpen/sdk-nodejs) 下载源码压缩包;
59
- 2. 解压源码包到您项目的合适位置;
60
- 3. 在您的代码中引用对应模块代码,可参考示例。
58
+ 1. 前往 [Github 仓库](https://github.com/YunzhanghuOpen/sdk-nodejs) 下载源码压缩包;
59
+ 2. 解压源码包到您项目的合适位置;
60
+ 3. 在您的代码中引用对应模块代码,具体引用方式可参考下文示例。
61
61
 
62
62
  ## 快速使用
63
63
 
64
64
  ### 示例功能列表
65
65
 
66
- - [用户信息验证](./example/verify.js)
67
- - [H5 签约](./example/h5UserSign.js) or [API 签约](./example/apiUserSign.js)
66
+ - [用户信息验证](./example/authentication.js)
67
+ - [用户签约(H5 签约)](./example/h5UserSign.js) or [用户签约(API 签约)](./example/apiUserSign.js)
68
68
  - [个体工商户注册(云账户新经济 H5)](./example/bizlicXjjH5.js) or [个体工商户注册(云账户新经济 H5+API)](./example/bizlicXjjH5Api.js)
69
69
  - [实时支付](./example/payment.js)
70
70
  - [异步通知](./example/notify.js)
@@ -76,8 +76,8 @@ OpenSSL-> rsa -in private_key.pem -pubout -out pubkey.pem
76
76
  ```
77
77
  const yunzhanghu = require("@yunzhanghu/sdk-nodejs")
78
78
 
79
- // 实例化要请求的 client 对象(以 Invoice 为例)
80
- const client = new yunzhanghu.Invoice({
79
+ // 实例化要请求的 client 对象(以 InvoiceClient 为例)
80
+ const client = new yunzhanghu.InvoiceClient({
81
81
  // 为了保护密钥安全,建议将密钥配置到环境变量中或配置文件中。
82
82
  // 请勿在代码中使用硬编码密钥,可能导致密钥暴露,存在安全隐患。
83
83
 
@@ -104,6 +104,8 @@ client
104
104
  .GetInvoiceAmount({
105
105
  dealer_id: process.env.DEALER_ID,
106
106
  broker_id: process.env.BROKER_ID,
107
+ // 可自定义 Header 中的 request-id,建议将 request-id 记录在日志中
108
+ // request_id:'req1678257009001'
107
109
  })
108
110
  .then((data) => {
109
111
  console.log("data", data)
@@ -1,13 +1,13 @@
1
1
  const yzhAPI = require("../yzh/index.js")
2
2
  const config = require("./conf/config.js")
3
3
 
4
- // API 签约
4
+ // 用户签约(API 签约)
5
5
 
6
- const apiusersign = new yzhAPI.Apiusersign(config)
6
+ const apiusersign = new yzhAPI.ApiUserSignServiceClient(config)
7
7
 
8
8
  // 获取协议预览 URL
9
9
  apiusersign
10
- .ApiUseSignContract({
10
+ .ApiUserSignContract({
11
11
  dealer_id: config.dealer_id,
12
12
  broker_id: config.broker_id,
13
13
  })
@@ -5,7 +5,7 @@ const path = require("path")
5
5
 
6
6
  // 用户信息验证
7
7
 
8
- const authentication = new yzhAPI.Authentication(config)
8
+ const authentication = new yzhAPI.AuthenticationClient(config)
9
9
 
10
10
  // 银行卡四要素鉴权请求(下发短信验证码)
11
11
  authentication
@@ -3,7 +3,7 @@ const config = require("./conf/config.js")
3
3
 
4
4
  // 个体工商户注册(云账户新经济 H5)
5
5
 
6
- const bizlicxjjh5 = new yzhAPI.Bizlicxjjh5({
6
+ const bizlicxjjh5 = new yzhAPI.BizlicXjjH5ServiceClient({
7
7
  ...config,
8
8
  base_url: "https://api-aic.yunzhanghu.com/",
9
9
  })
@@ -3,7 +3,10 @@ const config = require("./conf/config.js")
3
3
 
4
4
  // 个体工商户注册(云账户新经济 H5+API)
5
5
 
6
- const bizlicxjjh5api = new yzhAPI.Bizlicxjjh5api({...config,base_url: "https://api-aic.yunzhanghu.com/"})
6
+ const bizlicxjjh5api = new yzhAPI.BizlicXjjH5APIServiceClient({
7
+ ...config,
8
+ base_url: "https://api-aic.yunzhanghu.com/",
9
+ })
7
10
 
8
11
  // 工商实名信息录入
9
12
  bizlicxjjh5api
@@ -3,7 +3,7 @@ const config = require("./conf/config.js")
3
3
 
4
4
  // 对账文件获取
5
5
 
6
- const dataService = new yzhAPI.Dataservice(config)
6
+ const dataService = new yzhAPI.DataServiceClient(config)
7
7
 
8
8
  // 查询日订单文件
9
9
  dataService
@@ -1,9 +1,9 @@
1
1
  const yzhAPI = require("../yzh/index.js")
2
2
  const config = require("./conf/config.js")
3
3
 
4
- // H5 签约
4
+ // 用户签约(H5 签约)
5
5
 
6
- const h5usersign = new yzhAPI.H5usersign(config)
6
+ const h5usersign = new yzhAPI.H5UserSignServiceClient(config)
7
7
 
8
8
  // 预申请签约
9
9
  h5usersign
@@ -3,7 +3,7 @@ const config = require("./conf/config.js")
3
3
 
4
4
  // 发票开具
5
5
 
6
- const invoice = new yzhAPI.Invoice(config)
6
+ const invoice = new yzhAPI.InvoiceClient(config)
7
7
 
8
8
  // 查询平台企业已开具和待开具发票金额
9
9
  invoice
@@ -89,3 +89,16 @@ invoice
89
89
  .catch((err) => {
90
90
  console.log(err.toString())
91
91
  })
92
+
93
+ // 查询发票信息
94
+ invoice
95
+ .GetInvoiceInformation({
96
+ invoice_apply_id: "",
97
+ application_id: "423721",
98
+ })
99
+ .then((data) => {
100
+ console.log('响应内容: %j', data)
101
+ })
102
+ .catch((err) => {
103
+ console.log(err.toString())
104
+ })
package/example/notify.js CHANGED
@@ -1,6 +1,6 @@
1
1
  const yunzhanghu = require("../yzh/index.js")
2
2
 
3
- // 模拟异步通知接口验签+解密
3
+ // 异步通知
4
4
 
5
5
  const util = new yunzhanghu.Util({
6
6
  dealer_id: process.env.DEALER_ID,
@@ -1,7 +1,7 @@
1
1
  const yzhAPI = require("../yzh/index.js")
2
2
  const config = require("./conf/config.js")
3
3
  // 实时支付
4
- const payment = new yzhAPI.Payment(config)
4
+ const payment = new yzhAPI.PaymentClient(config)
5
5
 
6
6
  // 银行卡实时支付
7
7
  payment
package/example/tax.js CHANGED
@@ -2,7 +2,7 @@ const yzhAPI = require("../yzh/index.js")
2
2
  const config = require("./conf/config.js")
3
3
 
4
4
  // 个人所得税扣缴明细表
5
- const tax = new yzhAPI.Tax(config)
5
+ const tax = new yzhAPI.TaxClient(config)
6
6
 
7
7
  // 下载个人所得税扣缴明细表
8
8
  tax
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yunzhanghu/sdk-nodejs",
3
- "version": "0.0.4",
3
+ "version": "1.0.1",
4
4
  "description": "云账户 SDK for Node.js",
5
5
  "main": "yzh/index.js",
6
6
  "scripts": {
@@ -68,11 +68,12 @@ export class YZHClient {
68
68
 
69
69
  // 基础请求:进行请求实例生成 Header,动态设置、请求体包装等偏底层操作
70
70
  private doRequest(method: string, action: string, req: any): Promise<ResponseData> {
71
+ const { request_id, ...resReq } = req
71
72
  // 请求参数加密
72
- const encryptParams = this.generatorResquestParams(req)
73
+ const encryptParams = this.generatorRequestParams(resReq)
73
74
  // 生成请求实例,配置 Header
74
75
  const instance = getInstance({
75
- request_id: req?.request_id ?? this.mess(),
76
+ request_id: request_id ?? this.mess(),
76
77
  dealer_id: this.dealer_id,
77
78
  base_url: this.base_url,
78
79
  })
@@ -120,7 +121,7 @@ export class YZHClient {
120
121
  * @param {object} params
121
122
  * @returns {*} object
122
123
  */
123
- private generatorResquestParams(params: string) {
124
+ private generatorRequestParams(params: string) {
124
125
  try {
125
126
  const t = Date.now().toString()
126
127
  const m = this.mess()
@@ -129,7 +130,7 @@ export class YZHClient {
129
130
 
130
131
  const data = this.encrypt(plaintext)
131
132
 
132
- const signStr = this.generatorSign(data, m, t)
133
+ const signStr = this.sign(data, m, t)
133
134
  return {
134
135
  data,
135
136
  mess: m,
@@ -149,7 +150,7 @@ export class YZHClient {
149
150
  * @param {string} timestamp 时间戳,精确到秒
150
151
  * @returns {string} 签名内容
151
152
  */
152
- private generatorSignRSASHA256 = (data: string, mess: string, timestamp: string) => {
153
+ private signRSASHA256 = (data: string, mess: string, timestamp: string) => {
153
154
  try {
154
155
  const plaintext = `data=${data}&mess=${mess}&timestamp=${timestamp}&key=${this.app_key}`
155
156
  const sign = crypto.createSign("RSA-SHA256")
@@ -168,7 +169,7 @@ export class YZHClient {
168
169
  * @param {string} timestamp 时间戳,精确到秒
169
170
  * @returns {string} 签名内容
170
171
  */
171
- private generatorSignHmacSHA256 = (data: string, mess: string, timestamp: string) => {
172
+ private signHmacSHA256 = (data: string, mess: string, timestamp: string) => {
172
173
  try {
173
174
  const plaintext = `data=${data}&mess=${mess}&timestamp=${timestamp}&key=${this.app_key}`
174
175
  const hmac = crypto.createHmac("sha256", this.app_key)
@@ -187,14 +188,14 @@ export class YZHClient {
187
188
  * @param {string} sign_type 签名方式
188
189
  * @returns {string} 签名内容
189
190
  */
190
- private generatorSign = (data: string, mess: string, timestamp: string) => {
191
+ private sign = (data: string, mess: string, timestamp: string) => {
191
192
  try {
192
193
  switch (this.sign_type) {
193
194
  case "rsa": {
194
- return this.generatorSignRSASHA256(data, mess, timestamp)
195
+ return this.signRSASHA256(data, mess, timestamp)
195
196
  }
196
197
  case "sha256": {
197
- return this.generatorSignHmacSHA256(data, mess, timestamp)
198
+ return this.signHmacSHA256(data, mess, timestamp)
198
199
  }
199
200
  default:
200
201
  throw new YZHSDKHttpException(`sign_type类型不存在`)
@@ -238,12 +239,12 @@ export class YZHClient {
238
239
  yzhError.httpCode = result.status
239
240
  throw yzhError
240
241
  } else {
241
- // httpcode 200
242
+ // HTTP Status Code 200
242
243
  const { data: axiosData } = result
243
244
  let response = axiosData
244
245
  // 需解密
245
246
  if (encryption) {
246
- response = { ...response, data: this.decryption(response.data) }
247
+ response = { ...response, data: this.decrypt(response.data) }
247
248
  }
248
249
  return response
249
250
  }
@@ -254,7 +255,7 @@ export class YZHClient {
254
255
  * @param ciphertext
255
256
  * @returns 明文数据
256
257
  */
257
- decryption = (ciphertext: string) => {
258
+ decrypt = (ciphertext: string) => {
258
259
  try {
259
260
  const iv = this.des3_key.slice(0, 8)
260
261
  const cipherChunks = []
@@ -349,7 +350,7 @@ export class YZHClient {
349
350
  const verifyResult = verifyMap[this.sign_type](data, mess, timestamp, sign)
350
351
  let plaintext = {}
351
352
  if (verifyResult) {
352
- plaintext = this.decryption(data)
353
+ plaintext = this.decrypt(data)
353
354
  }
354
355
  return {
355
356
  result: verifyResult,
@@ -16,6 +16,22 @@ interface ApiUseSignContractResponse {
16
16
  title: string
17
17
  }
18
18
 
19
+ /** ApiUserSignContractRequest 获取协议预览 URL 请求 V2 */
20
+ interface ApiUserSignContractRequest {
21
+ /** 平台企业 ID */
22
+ dealer_id: string
23
+ /** 综合服务主体 ID */
24
+ broker_id: string
25
+ }
26
+
27
+ /** ApiUserSignContractResponse 获取协议预览 URL 返回 V2 */
28
+ interface ApiUserSignContractResponse {
29
+ /** 预览跳转 URL */
30
+ url: string
31
+ /** 协议名称 */
32
+ title: string
33
+ }
34
+
19
35
  /** ApiUserSignRequest 用户签约请求 */
20
36
  interface ApiUserSignRequest {
21
37
  /** 综合服务主体 ID */
@@ -76,7 +92,7 @@ interface ApiUserSignReleaseResponse {
76
92
  status: string
77
93
  }
78
94
 
79
- export class Apiusersign extends YZHclient {
95
+ export class ApiUserSignServiceClient extends YZHclient {
80
96
  constructor(conf: {
81
97
  dealer_id: string
82
98
  broker_id: string
@@ -98,6 +114,14 @@ export class Apiusersign extends YZHclient {
98
114
  return this.request("get", "/api/sign/v1/user/contract", req, { encryption: false }, cb)
99
115
  }
100
116
 
117
+ // ApiUserSignContract 获取协议预览 URL V2
118
+ async ApiUserSignContract(
119
+ req: ApiUserSignContractRequest,
120
+ cb?: (error: null | string, rep: ApiUserSignContractResponse) => void
121
+ ): Promise<ApiUserSignContractResponse> {
122
+ return this.request("get", "/api/sign/v1/user/contract", req, { encryption: false }, cb)
123
+ }
124
+
101
125
  // ApiUserSign 用户签约
102
126
  async ApiUserSign(
103
127
  req: ApiUserSignRequest,
@@ -161,7 +161,7 @@ interface GetBankCardInfoResponse {
161
161
  is_support: boolean
162
162
  }
163
163
 
164
- export class Authentication extends YZHclient {
164
+ export class AuthenticationClient extends YZHclient {
165
165
  constructor(conf: {
166
166
  dealer_id: string
167
167
  broker_id: string
@@ -17,7 +17,7 @@ interface H5GetStartUrlRequest {
17
17
  /** 跳转 URL */
18
18
  return_url: string
19
19
  /** H5 页面 Title */
20
- custom_title: number
20
+ customer_title: number
21
21
  }
22
22
 
23
23
  /** H5GetStartUrlResponse 预启动返回 */
@@ -96,7 +96,7 @@ interface NotifyH5EcoCityAicRequest {
96
96
  type: number
97
97
  }
98
98
 
99
- export class Bizlicxjjh5 extends YZHclient {
99
+ export class BizlicXjjH5ServiceClient extends YZHclient {
100
100
  constructor(conf: {
101
101
  dealer_id: string
102
102
  broker_id: string
@@ -49,7 +49,7 @@ interface H5APIGetStartUrlRequest {
49
49
  /** 跳转 URL */
50
50
  return_url: string
51
51
  /** H5 页面 Title */
52
- custom_title: number
52
+ customer_title: number
53
53
  }
54
54
 
55
55
  /** H5APIGetStartUrlResponse 预启动返回 */
@@ -128,7 +128,7 @@ interface NotifyH5APIEcoCityAicRequest {
128
128
  type: number
129
129
  }
130
130
 
131
- export class Bizlicxjjh5api extends YZHclient {
131
+ export class BizlicXjjH5APIServiceClient extends YZHclient {
132
132
  constructor(conf: {
133
133
  dealer_id: string
134
134
  broker_id: string
@@ -242,7 +242,7 @@ interface StatementDetail {
242
242
  project_name: string
243
243
  }
244
244
 
245
- export class Dataservice extends YZHclient {
245
+ export class DataServiceClient extends YZHclient {
246
246
  constructor(conf: {
247
247
  dealer_id: string
248
248
  broker_id: string
@@ -96,7 +96,7 @@ interface NotifyH5UserSignRequest {
96
96
  phone: string
97
97
  }
98
98
 
99
- export class H5usersign extends YZHclient {
99
+ export class H5UserSignServiceClient extends YZHclient {
100
100
  constructor(conf: {
101
101
  dealer_id: string
102
102
  broker_id: string
@@ -1,10 +1,10 @@
1
1
  export { Util } from "../common/utils"
2
- export { Apiusersign } from "./apiusersign"
3
- export { Authentication } from "./authentication"
4
- export { Dataservice } from "./dataservice"
5
- export { H5usersign } from "./h5usersign"
6
- export { Invoice } from "./invoice"
7
- export { Payment } from "./payment"
8
- export { Tax } from "./tax"
9
- export { Bizlicxjjh5api } from "./bizlicxjjh5api"
10
- export { Bizlicxjjh5 } from "./bizlicxjjh5"
2
+ export { ApiUserSignServiceClient } from "./apiusersign"
3
+ export { AuthenticationClient } from "./authentication"
4
+ export { DataServiceClient } from "./dataservice"
5
+ export { H5UserSignServiceClient } from "./h5usersign"
6
+ export { InvoiceClient } from "./invoice"
7
+ export { PaymentClient } from "./payment"
8
+ export { TaxClient } from "./tax"
9
+ export { BizlicXjjH5APIServiceClient } from "./bizlicxjjh5api"
10
+ export { BizlicXjjH5ServiceClient } from "./bizlicxjjh5"
@@ -110,6 +110,40 @@ interface GetInvoiceStatusResponse {
110
110
  waybill_number: string[]
111
111
  }
112
112
 
113
+ /** GetInvoiceInformationRequest 查询发票信息请求 */
114
+ interface GetInvoiceInformationRequest {
115
+ /** 发票申请编号 */
116
+ invoice_apply_id: string
117
+ /** 发票申请单 ID */
118
+ application_id: string
119
+ }
120
+
121
+ /** GetInvoiceInformationResponse 查询发票信息返回 */
122
+ interface GetInvoiceInformationResponse {
123
+ /** 发票信息 */
124
+ information: InformationDataInfo[]
125
+ }
126
+
127
+ /** InformationDataInfo 查询发票信息返回 */
128
+ interface InformationDataInfo {
129
+ /** 货物或应税劳务、服务名称 */
130
+ goods_services_name: string
131
+ /** 发票号码 */
132
+ invoice_num: string
133
+ /** 发票代码 */
134
+ invoice_code: string
135
+ /** 不含税金额 */
136
+ price_amount: string
137
+ /** 税额 */
138
+ tax_amount: string
139
+ /** 税率 */
140
+ tax_rate: string
141
+ /** 价税合计 */
142
+ price_tax_amount: string
143
+ /** 开票日期 */
144
+ invoiced_date: string
145
+ }
146
+
113
147
  /** BankNameAccount 系统支持的开户行及账号 */
114
148
  interface BankNameAccount {
115
149
  /** 开户行及账号 */
@@ -191,7 +225,7 @@ interface NotifyInvoiceDoneRequest {
191
225
  reject_reason: string
192
226
  }
193
227
 
194
- export class Invoice extends YZHclient {
228
+ export class InvoiceClient extends YZHclient {
195
229
  constructor(conf: {
196
230
  dealer_id: string
197
231
  broker_id: string
@@ -243,6 +277,20 @@ export class Invoice extends YZHclient {
243
277
  )
244
278
  }
245
279
 
280
+ // GetInvoiceInformation 查询发票信息
281
+ async GetInvoiceInformation(
282
+ req: GetInvoiceInformationRequest,
283
+ cb?: (error: null | string, rep: GetInvoiceInformationResponse) => void
284
+ ): Promise<GetInvoiceInformationResponse> {
285
+ return this.request(
286
+ "post",
287
+ "/api/invoice/v2/invoice-face-information",
288
+ req,
289
+ { encryption: false },
290
+ cb
291
+ )
292
+ }
293
+
246
294
  // GetInvoiceFile 下载 PDF 版发票
247
295
  async GetInvoiceFile(
248
296
  req: GetInvoiceFileRequest,
@@ -422,7 +422,7 @@ interface ConfirmBatchOrderRequest {
422
422
  /** ConfirmBatchOrderResponse 批次确认响应 */
423
423
  interface ConfirmBatchOrderResponse {}
424
424
 
425
- export class Payment extends YZHclient {
425
+ export class PaymentClient extends YZHclient {
426
426
  constructor(conf: {
427
427
  dealer_id: string
428
428
  broker_id: string
@@ -44,7 +44,7 @@ interface GetUserCrossResponse {
44
44
  is_cross: boolean
45
45
  }
46
46
 
47
- export class Tax extends YZHclient {
47
+ export class TaxClient extends YZHclient {
48
48
  constructor(conf: {
49
49
  dealer_id: string
50
50
  broker_id: string
@@ -39,7 +39,7 @@ export declare class YZHClient {
39
39
  * @param {object} params
40
40
  * @returns {*} object
41
41
  */
42
- private generatorResquestParams;
42
+ private generatorRequestParams;
43
43
  /**
44
44
  * 生成签名(RSA-SHA256)
45
45
  * @param {string} data 经过加密后的具体数据
@@ -47,7 +47,7 @@ export declare class YZHClient {
47
47
  * @param {string} timestamp 时间戳,精确到秒
48
48
  * @returns {string} 签名内容
49
49
  */
50
- private generatorSignRSASHA256;
50
+ private signRSASHA256;
51
51
  /**
52
52
  * 生成签名(HmacSHA256)
53
53
  * @param {string} data 经过加密后的具体数据
@@ -55,7 +55,7 @@ export declare class YZHClient {
55
55
  * @param {string} timestamp 时间戳,精确到秒
56
56
  * @returns {string} 签名内容
57
57
  */
58
- private generatorSignHmacSHA256;
58
+ private signHmacSHA256;
59
59
  /**
60
60
  * 生成签名
61
61
  * @param {string} data 经过加密后的具体数据
@@ -64,7 +64,7 @@ export declare class YZHClient {
64
64
  * @param {string} sign_type 签名方式
65
65
  * @returns {string} 签名内容
66
66
  */
67
- private generatorSign;
67
+ private sign;
68
68
  private mess;
69
69
  /**
70
70
  * 3DES 加密数据
@@ -78,7 +78,7 @@ export declare class YZHClient {
78
78
  * @param ciphertext
79
79
  * @returns 明文数据
80
80
  */
81
- decryption: (ciphertext: string) => any;
81
+ decrypt: (ciphertext: string) => any;
82
82
  /**
83
83
  * 验签
84
84
  * @param {string} data 返回的数据
@@ -26,7 +26,7 @@ class YZHClient {
26
26
  * @param {string} timestamp 时间戳,精确到秒
27
27
  * @returns {string} 签名内容
28
28
  */
29
- this.generatorSignRSASHA256 = (data, mess, timestamp) => {
29
+ this.signRSASHA256 = (data, mess, timestamp) => {
30
30
  try {
31
31
  const plaintext = `data=${data}&mess=${mess}&timestamp=${timestamp}&key=${this.app_key}`;
32
32
  const sign = crypto.createSign("RSA-SHA256");
@@ -45,7 +45,7 @@ class YZHClient {
45
45
  * @param {string} timestamp 时间戳,精确到秒
46
46
  * @returns {string} 签名内容
47
47
  */
48
- this.generatorSignHmacSHA256 = (data, mess, timestamp) => {
48
+ this.signHmacSHA256 = (data, mess, timestamp) => {
49
49
  try {
50
50
  const plaintext = `data=${data}&mess=${mess}&timestamp=${timestamp}&key=${this.app_key}`;
51
51
  const hmac = crypto.createHmac("sha256", this.app_key);
@@ -64,17 +64,17 @@ class YZHClient {
64
64
  * @param {string} sign_type 签名方式
65
65
  * @returns {string} 签名内容
66
66
  */
67
- this.generatorSign = (data, mess, timestamp) => {
67
+ this.sign = (data, mess, timestamp) => {
68
68
  try {
69
69
  switch (this.sign_type) {
70
70
  case "rsa": {
71
- return this.generatorSignRSASHA256(data, mess, timestamp);
71
+ return this.signRSASHA256(data, mess, timestamp);
72
72
  }
73
73
  case "sha256": {
74
- return this.generatorSignHmacSHA256(data, mess, timestamp);
74
+ return this.signHmacSHA256(data, mess, timestamp);
75
75
  }
76
76
  default:
77
- throw new yzhSDKHttpException_1.default(`sign_type类型不存在`);
77
+ throw new yzhSDKHttpException_1.default(`sign_type 类型不存在`);
78
78
  }
79
79
  }
80
80
  catch (err) {
@@ -111,7 +111,7 @@ class YZHClient {
111
111
  * @param ciphertext
112
112
  * @returns 明文数据
113
113
  */
114
- this.decryption = (ciphertext) => {
114
+ this.decrypt = (ciphertext) => {
115
115
  try {
116
116
  const iv = this.des3_key.slice(0, 8);
117
117
  const cipherChunks = [];
@@ -188,7 +188,7 @@ class YZHClient {
188
188
  const verifyResult = verifyMap[this.sign_type](data, mess, timestamp, sign);
189
189
  let plaintext = {};
190
190
  if (verifyResult) {
191
- plaintext = this.decryption(data);
191
+ plaintext = this.decrypt(data);
192
192
  }
193
193
  return {
194
194
  result: verifyResult,
@@ -225,12 +225,12 @@ class YZHClient {
225
225
  }
226
226
  // 基础请求:进行请求实例生成 Header,动态设置、请求体包装等偏底层操作
227
227
  doRequest(method, action, req) {
228
- var _a;
228
+ const { request_id, ...resReq } = req;
229
229
  // 请求参数加密
230
- const encryptParams = this.generatorResquestParams(req);
230
+ const encryptParams = this.generatorRequestParams(resReq);
231
231
  // 生成请求实例,配置 Header
232
232
  const instance = (0, http_1.default)({
233
- request_id: (_a = req === null || req === void 0 ? void 0 : req.request_id) !== null && _a !== void 0 ? _a : this.mess(),
233
+ request_id: request_id !== null && request_id !== void 0 ? request_id : this.mess(),
234
234
  dealer_id: this.dealer_id,
235
235
  base_url: this.base_url,
236
236
  });
@@ -272,13 +272,13 @@ class YZHClient {
272
272
  * @param {object} params
273
273
  * @returns {*} object
274
274
  */
275
- generatorResquestParams(params) {
275
+ generatorRequestParams(params) {
276
276
  try {
277
277
  const t = Date.now().toString();
278
278
  const m = this.mess();
279
279
  const plaintext = JSON.stringify(params);
280
280
  const data = this.encrypt(plaintext);
281
- const signStr = this.generatorSign(data, m, t);
281
+ const signStr = this.sign(data, m, t);
282
282
  return {
283
283
  data,
284
284
  mess: m,
@@ -299,12 +299,12 @@ class YZHClient {
299
299
  throw yzhError;
300
300
  }
301
301
  else {
302
- // httpcode 200
302
+ // HTTP Status Code 200
303
303
  const { data: axiosData } = result;
304
304
  let response = axiosData;
305
305
  // 需解密
306
306
  if (encryption) {
307
- response = { ...response, data: this.decryption(response.data) };
307
+ response = { ...response, data: this.decrypt(response.data) };
308
308
  }
309
309
  return response;
310
310
  }
@@ -13,6 +13,20 @@ interface ApiUseSignContractResponse {
13
13
  /** 协议名称 */
14
14
  title: string;
15
15
  }
16
+ /** ApiUserSignContractRequest 获取协议预览 URL 请求 V2 */
17
+ interface ApiUserSignContractRequest {
18
+ /** 平台企业 ID */
19
+ dealer_id: string;
20
+ /** 综合服务主体 ID */
21
+ broker_id: string;
22
+ }
23
+ /** ApiUserSignContractResponse 获取协议预览 URL 返回 V2 */
24
+ interface ApiUserSignContractResponse {
25
+ /** 预览跳转 URL */
26
+ url: string;
27
+ /** 协议名称 */
28
+ title: string;
29
+ }
16
30
  /** ApiUserSignRequest 用户签约请求 */
17
31
  interface ApiUserSignRequest {
18
32
  /** 综合服务主体 ID */
@@ -67,7 +81,7 @@ interface ApiUserSignReleaseResponse {
67
81
  /** 是否解约成功 */
68
82
  status: string;
69
83
  }
70
- export declare class Apiusersign extends YZHclient {
84
+ export declare class ApiUserSignServiceClient extends YZHclient {
71
85
  constructor(conf: {
72
86
  dealer_id: string;
73
87
  broker_id: string;
@@ -79,6 +93,7 @@ export declare class Apiusersign extends YZHclient {
79
93
  base_url?: string;
80
94
  });
81
95
  ApiUseSignContract(req: ApiUseSignContractRequest, cb?: (error: null | string, rep: ApiUseSignContractResponse) => void): Promise<ApiUseSignContractResponse>;
96
+ ApiUserSignContract(req: ApiUserSignContractRequest, cb?: (error: null | string, rep: ApiUserSignContractResponse) => void): Promise<ApiUserSignContractResponse>;
82
97
  ApiUserSign(req: ApiUserSignRequest, cb?: (error: null | string, rep: ApiUserSignResponse) => void): Promise<ApiUserSignResponse>;
83
98
  GetApiUserSignStatus(req: GetApiUserSignStatusRequest, cb?: (error: null | string, rep: GetApiUserSignStatusResponse) => void): Promise<GetApiUserSignStatusResponse>;
84
99
  ApiUserSignRelease(req: ApiUserSignReleaseRequest, cb?: (error: null | string, rep: ApiUserSignReleaseResponse) => void): Promise<ApiUserSignReleaseResponse>;
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Apiusersign = void 0;
3
+ exports.ApiUserSignServiceClient = void 0;
4
4
  const client_1 = require("../../common/client");
5
- class Apiusersign extends client_1.default {
5
+ class ApiUserSignServiceClient extends client_1.default {
6
6
  constructor(conf) {
7
7
  super(conf);
8
8
  }
@@ -10,6 +10,10 @@ class Apiusersign extends client_1.default {
10
10
  async ApiUseSignContract(req, cb) {
11
11
  return this.request("get", "/api/sign/v1/user/contract", req, { encryption: false }, cb);
12
12
  }
13
+ // ApiUserSignContract 获取协议预览 URL V2
14
+ async ApiUserSignContract(req, cb) {
15
+ return this.request("get", "/api/sign/v1/user/contract", req, { encryption: false }, cb);
16
+ }
13
17
  // ApiUserSign 用户签约
14
18
  async ApiUserSign(req, cb) {
15
19
  return this.request("post", "/api/sign/v1/user/sign", req, { encryption: false }, cb);
@@ -23,4 +27,4 @@ class Apiusersign extends client_1.default {
23
27
  return this.request("post", "/api/sign/v1/user/release", req, { encryption: false }, cb);
24
28
  }
25
29
  }
26
- exports.Apiusersign = Apiusersign;
30
+ exports.ApiUserSignServiceClient = ApiUserSignServiceClient;
@@ -130,7 +130,7 @@ interface GetBankCardInfoResponse {
130
130
  /** 云账户是否支持向该银行支付 */
131
131
  is_support: boolean;
132
132
  }
133
- export declare class Authentication extends YZHclient {
133
+ export declare class AuthenticationClient extends YZHclient {
134
134
  constructor(conf: {
135
135
  dealer_id: string;
136
136
  broker_id: string;
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Authentication = void 0;
3
+ exports.AuthenticationClient = void 0;
4
4
  const client_1 = require("../../common/client");
5
- class Authentication extends client_1.default {
5
+ class AuthenticationClient extends client_1.default {
6
6
  constructor(conf) {
7
7
  super(conf);
8
8
  }
@@ -39,4 +39,4 @@ class Authentication extends client_1.default {
39
39
  return this.request("get", "/api/payment/v1/card", req, { encryption: false }, cb);
40
40
  }
41
41
  }
42
- exports.Authentication = Authentication;
42
+ exports.AuthenticationClient = AuthenticationClient;
@@ -16,7 +16,7 @@ interface H5GetStartUrlRequest {
16
16
  /** 跳转 URL */
17
17
  return_url: string;
18
18
  /** H5 页面 Title */
19
- custom_title: number;
19
+ customer_title: number;
20
20
  }
21
21
  /** H5GetStartUrlResponse 预启动返回 */
22
22
  interface H5GetStartUrlResponse {
@@ -59,7 +59,7 @@ interface H5EcoCityAicStatusResponse {
59
59
  /** 姓名 */
60
60
  real_name: string;
61
61
  }
62
- export declare class Bizlicxjjh5 extends YZHclient {
62
+ export declare class BizlicXjjH5ServiceClient extends YZHclient {
63
63
  constructor(conf: {
64
64
  dealer_id: string;
65
65
  broker_id: string;
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Bizlicxjjh5 = void 0;
3
+ exports.BizlicXjjH5ServiceClient = void 0;
4
4
  const client_1 = require("../../common/client");
5
- class Bizlicxjjh5 extends client_1.default {
5
+ class BizlicXjjH5ServiceClient extends client_1.default {
6
6
  constructor(conf) {
7
7
  super(conf);
8
8
  }
@@ -15,4 +15,4 @@ class Bizlicxjjh5 extends client_1.default {
15
15
  return this.request("get", "/api/aic/new-economy/h5/v1/status", req, { encryption: false }, cb);
16
16
  }
17
17
  }
18
- exports.Bizlicxjjh5 = Bizlicxjjh5;
18
+ exports.BizlicXjjH5ServiceClient = BizlicXjjH5ServiceClient;
@@ -46,7 +46,7 @@ interface H5APIGetStartUrlRequest {
46
46
  /** 跳转 URL */
47
47
  return_url: string;
48
48
  /** H5 页面 Title */
49
- custom_title: number;
49
+ customer_title: number;
50
50
  }
51
51
  /** H5APIGetStartUrlResponse 预启动返回 */
52
52
  interface H5APIGetStartUrlResponse {
@@ -89,7 +89,7 @@ interface H5APIEcoCityAicStatusResponse {
89
89
  /** 姓名 */
90
90
  real_name: string;
91
91
  }
92
- export declare class Bizlicxjjh5api extends YZHclient {
92
+ export declare class BizlicXjjH5APIServiceClient extends YZHclient {
93
93
  constructor(conf: {
94
94
  dealer_id: string;
95
95
  broker_id: string;
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Bizlicxjjh5api = void 0;
3
+ exports.BizlicXjjH5APIServiceClient = void 0;
4
4
  const client_1 = require("../../common/client");
5
- class Bizlicxjjh5api extends client_1.default {
5
+ class BizlicXjjH5APIServiceClient extends client_1.default {
6
6
  constructor(conf) {
7
7
  super(conf);
8
8
  }
@@ -19,4 +19,4 @@ class Bizlicxjjh5api extends client_1.default {
19
19
  return this.request("get", "/api/aic/new-economy/api-h5/v1/status", req, { encryption: false }, cb);
20
20
  }
21
21
  }
22
- exports.Bizlicxjjh5api = Bizlicxjjh5api;
22
+ exports.BizlicXjjH5APIServiceClient = BizlicXjjH5APIServiceClient;
@@ -223,7 +223,7 @@ interface StatementDetail {
223
223
  /** 项目名称 */
224
224
  project_name: string;
225
225
  }
226
- export declare class Dataservice extends YZHclient {
226
+ export declare class DataServiceClient extends YZHclient {
227
227
  constructor(conf: {
228
228
  dealer_id: string;
229
229
  broker_id: string;
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Dataservice = void 0;
3
+ exports.DataServiceClient = void 0;
4
4
  const client_1 = require("../../common/client");
5
- class Dataservice extends client_1.default {
5
+ class DataServiceClient extends client_1.default {
6
6
  constructor(conf) {
7
7
  super(conf);
8
8
  }
@@ -35,4 +35,4 @@ class Dataservice extends client_1.default {
35
35
  return this.request("get", "/api/dataservice/v1/statements-daily", req, { encryption: false }, cb);
36
36
  }
37
37
  }
38
- exports.Dataservice = Dataservice;
38
+ exports.DataServiceClient = DataServiceClient;
@@ -73,7 +73,7 @@ interface H5UserReleaseResponse {
73
73
  /** 是否解约成功 */
74
74
  status: string;
75
75
  }
76
- export declare class H5usersign extends YZHclient {
76
+ export declare class H5UserSignServiceClient extends YZHclient {
77
77
  constructor(conf: {
78
78
  dealer_id: string;
79
79
  broker_id: string;
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.H5usersign = void 0;
3
+ exports.H5UserSignServiceClient = void 0;
4
4
  const client_1 = require("../../common/client");
5
- class H5usersign extends client_1.default {
5
+ class H5UserSignServiceClient extends client_1.default {
6
6
  constructor(conf) {
7
7
  super(conf);
8
8
  }
@@ -23,4 +23,4 @@ class H5usersign extends client_1.default {
23
23
  return this.request("post", "/api/sdk/v1/sign/release", req, { encryption: false }, cb);
24
24
  }
25
25
  }
26
- exports.H5usersign = H5usersign;
26
+ exports.H5UserSignServiceClient = H5UserSignServiceClient;
@@ -1,10 +1,10 @@
1
1
  export { Util } from "../common/utils";
2
- export { Apiusersign } from "./apiusersign";
3
- export { Authentication } from "./authentication";
4
- export { Dataservice } from "./dataservice";
5
- export { H5usersign } from "./h5usersign";
6
- export { Invoice } from "./invoice";
7
- export { Payment } from "./payment";
8
- export { Tax } from "./tax";
9
- export { Bizlicxjjh5api } from "./bizlicxjjh5api";
10
- export { Bizlicxjjh5 } from "./bizlicxjjh5";
2
+ export { ApiUserSignServiceClient } from "./apiusersign";
3
+ export { AuthenticationClient } from "./authentication";
4
+ export { DataServiceClient } from "./dataservice";
5
+ export { H5UserSignServiceClient } from "./h5usersign";
6
+ export { InvoiceClient } from "./invoice";
7
+ export { PaymentClient } from "./payment";
8
+ export { TaxClient } from "./tax";
9
+ export { BizlicXjjH5APIServiceClient } from "./bizlicxjjh5api";
10
+ export { BizlicXjjH5ServiceClient } from "./bizlicxjjh5";
@@ -1,23 +1,23 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Bizlicxjjh5 = exports.Bizlicxjjh5api = exports.Tax = exports.Payment = exports.Invoice = exports.H5usersign = exports.Dataservice = exports.Authentication = exports.Apiusersign = exports.Util = void 0;
3
+ exports.BizlicXjjH5ServiceClient = exports.BizlicXjjH5APIServiceClient = exports.TaxClient = exports.PaymentClient = exports.InvoiceClient = exports.H5UserSignServiceClient = exports.DataServiceClient = exports.AuthenticationClient = exports.ApiUserSignServiceClient = exports.Util = void 0;
4
4
  var utils_1 = require("../common/utils");
5
5
  Object.defineProperty(exports, "Util", { enumerable: true, get: function () { return utils_1.Util; } });
6
6
  var apiusersign_1 = require("./apiusersign");
7
- Object.defineProperty(exports, "Apiusersign", { enumerable: true, get: function () { return apiusersign_1.Apiusersign; } });
7
+ Object.defineProperty(exports, "ApiUserSignServiceClient", { enumerable: true, get: function () { return apiusersign_1.ApiUserSignServiceClient; } });
8
8
  var authentication_1 = require("./authentication");
9
- Object.defineProperty(exports, "Authentication", { enumerable: true, get: function () { return authentication_1.Authentication; } });
9
+ Object.defineProperty(exports, "AuthenticationClient", { enumerable: true, get: function () { return authentication_1.AuthenticationClient; } });
10
10
  var dataservice_1 = require("./dataservice");
11
- Object.defineProperty(exports, "Dataservice", { enumerable: true, get: function () { return dataservice_1.Dataservice; } });
11
+ Object.defineProperty(exports, "DataServiceClient", { enumerable: true, get: function () { return dataservice_1.DataServiceClient; } });
12
12
  var h5usersign_1 = require("./h5usersign");
13
- Object.defineProperty(exports, "H5usersign", { enumerable: true, get: function () { return h5usersign_1.H5usersign; } });
13
+ Object.defineProperty(exports, "H5UserSignServiceClient", { enumerable: true, get: function () { return h5usersign_1.H5UserSignServiceClient; } });
14
14
  var invoice_1 = require("./invoice");
15
- Object.defineProperty(exports, "Invoice", { enumerable: true, get: function () { return invoice_1.Invoice; } });
15
+ Object.defineProperty(exports, "InvoiceClient", { enumerable: true, get: function () { return invoice_1.InvoiceClient; } });
16
16
  var payment_1 = require("./payment");
17
- Object.defineProperty(exports, "Payment", { enumerable: true, get: function () { return payment_1.Payment; } });
17
+ Object.defineProperty(exports, "PaymentClient", { enumerable: true, get: function () { return payment_1.PaymentClient; } });
18
18
  var tax_1 = require("./tax");
19
- Object.defineProperty(exports, "Tax", { enumerable: true, get: function () { return tax_1.Tax; } });
19
+ Object.defineProperty(exports, "TaxClient", { enumerable: true, get: function () { return tax_1.TaxClient; } });
20
20
  var bizlicxjjh5api_1 = require("./bizlicxjjh5api");
21
- Object.defineProperty(exports, "Bizlicxjjh5api", { enumerable: true, get: function () { return bizlicxjjh5api_1.Bizlicxjjh5api; } });
21
+ Object.defineProperty(exports, "BizlicXjjH5APIServiceClient", { enumerable: true, get: function () { return bizlicxjjh5api_1.BizlicXjjH5APIServiceClient; } });
22
22
  var bizlicxjjh5_1 = require("./bizlicxjjh5");
23
- Object.defineProperty(exports, "Bizlicxjjh5", { enumerable: true, get: function () { return bizlicxjjh5_1.Bizlicxjjh5; } });
23
+ Object.defineProperty(exports, "BizlicXjjH5ServiceClient", { enumerable: true, get: function () { return bizlicxjjh5_1.BizlicXjjH5ServiceClient; } });
@@ -101,6 +101,37 @@ interface GetInvoiceStatusResponse {
101
101
  /** 快递单号 */
102
102
  waybill_number: string[];
103
103
  }
104
+ /** GetInvoiceInformationRequest 查询发票信息请求 */
105
+ interface GetInvoiceInformationRequest {
106
+ /** 发票申请编号 */
107
+ invoice_apply_id: string;
108
+ /** 发票申请单 ID */
109
+ application_id: string;
110
+ }
111
+ /** GetInvoiceInformationResponse 查询发票信息返回 */
112
+ interface GetInvoiceInformationResponse {
113
+ /** 发票信息 */
114
+ information: InformationDataInfo[];
115
+ }
116
+ /** InformationDataInfo 查询发票信息返回 */
117
+ interface InformationDataInfo {
118
+ /** 货物或应税劳务、服务名称 */
119
+ goods_services_name: string;
120
+ /** 发票号码 */
121
+ invoice_num: string;
122
+ /** 发票代码 */
123
+ invoice_code: string;
124
+ /** 不含税金额 */
125
+ price_amount: string;
126
+ /** 税额 */
127
+ tax_amount: string;
128
+ /** 税率 */
129
+ tax_rate: string;
130
+ /** 价税合计 */
131
+ price_tax_amount: string;
132
+ /** 开票日期 */
133
+ invoiced_date: string;
134
+ }
104
135
  /** BankNameAccount 系统支持的开户行及账号 */
105
136
  interface BankNameAccount {
106
137
  /** 开户行及账号 */
@@ -139,7 +170,7 @@ interface SendReminderEmailRequest {
139
170
  /** SendReminderEmailResponse 发送发票扫描件压缩包下载链接邮件返回 */
140
171
  interface SendReminderEmailResponse {
141
172
  }
142
- export declare class Invoice extends YZHclient {
173
+ export declare class InvoiceClient extends YZHclient {
143
174
  constructor(conf: {
144
175
  dealer_id: string;
145
176
  broker_id: string;
@@ -154,6 +185,7 @@ export declare class Invoice extends YZHclient {
154
185
  GetInvoiceAmount(req: GetInvoiceAmountRequest, cb?: (error: null | string, rep: GetInvoiceAmountResponse) => void): Promise<GetInvoiceAmountResponse>;
155
186
  ApplyInvoice(req: ApplyInvoiceRequest, cb?: (error: null | string, rep: ApplyInvoiceResponse) => void): Promise<ApplyInvoiceResponse>;
156
187
  GetInvoiceStatus(req: GetInvoiceStatusRequest, cb?: (error: null | string, rep: GetInvoiceStatusResponse) => void): Promise<GetInvoiceStatusResponse>;
188
+ GetInvoiceInformation(req: GetInvoiceInformationRequest, cb?: (error: null | string, rep: GetInvoiceInformationResponse) => void): Promise<GetInvoiceInformationResponse>;
157
189
  GetInvoiceFile(req: GetInvoiceFileRequest, cb?: (error: null | string, rep: GetInvoiceFileResponse) => void): Promise<GetInvoiceFileResponse>;
158
190
  SendReminderEmail(req: SendReminderEmailRequest, cb?: (error: null | string, rep: SendReminderEmailResponse) => void): Promise<SendReminderEmailResponse>;
159
191
  }
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Invoice = void 0;
3
+ exports.InvoiceClient = void 0;
4
4
  const client_1 = require("../../common/client");
5
- class Invoice extends client_1.default {
5
+ class InvoiceClient extends client_1.default {
6
6
  constructor(conf) {
7
7
  super(conf);
8
8
  }
@@ -22,6 +22,10 @@ class Invoice extends client_1.default {
22
22
  async GetInvoiceStatus(req, cb) {
23
23
  return this.request("post", "/api/invoice/v2/invoice/invoice-status", req, { encryption: false }, cb);
24
24
  }
25
+ // GetInvoiceInformation 查询发票信息
26
+ async GetInvoiceInformation(req, cb) {
27
+ return this.request("post", "/api/invoice/v2/invoice-face-information", req, { encryption: false }, cb);
28
+ }
25
29
  // GetInvoiceFile 下载 PDF 版发票
26
30
  async GetInvoiceFile(req, cb) {
27
31
  return this.request("post", "/api/invoice/v2/invoice/invoice-pdf", req, { encryption: false }, cb);
@@ -31,4 +35,4 @@ class Invoice extends client_1.default {
31
35
  return this.request("post", "/api/invoice/v2/invoice/reminder/email", req, { encryption: false }, cb);
32
36
  }
33
37
  }
34
- exports.Invoice = Invoice;
38
+ exports.InvoiceClient = InvoiceClient;
@@ -333,7 +333,7 @@ interface ConfirmBatchOrderRequest {
333
333
  /** ConfirmBatchOrderResponse 批次确认响应 */
334
334
  interface ConfirmBatchOrderResponse {
335
335
  }
336
- export declare class Payment extends YZHclient {
336
+ export declare class PaymentClient extends YZHclient {
337
337
  constructor(conf: {
338
338
  dealer_id: string;
339
339
  broker_id: string;
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Payment = void 0;
3
+ exports.PaymentClient = void 0;
4
4
  const client_1 = require("../../common/client");
5
- class Payment extends client_1.default {
5
+ class PaymentClient extends client_1.default {
6
6
  constructor(conf) {
7
7
  super(conf);
8
8
  }
@@ -47,4 +47,4 @@ class Payment extends client_1.default {
47
47
  return this.request("post", "/api/payment/v1/confirm-batch", req, { encryption: false }, cb);
48
48
  }
49
49
  }
50
- exports.Payment = Payment;
50
+ exports.PaymentClient = PaymentClient;
@@ -38,7 +38,7 @@ interface GetUserCrossResponse {
38
38
  /** 跨集团标识 */
39
39
  is_cross: boolean;
40
40
  }
41
- export declare class Tax extends YZHclient {
41
+ export declare class TaxClient extends YZHclient {
42
42
  constructor(conf: {
43
43
  dealer_id: string;
44
44
  broker_id: string;
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Tax = void 0;
3
+ exports.TaxClient = void 0;
4
4
  const client_1 = require("../../common/client");
5
- class Tax extends client_1.default {
5
+ class TaxClient extends client_1.default {
6
6
  constructor(conf) {
7
7
  super(conf);
8
8
  }
@@ -15,4 +15,4 @@ class Tax extends client_1.default {
15
15
  return this.request("post", "/api/tax/v1/user/cross", req, { encryption: false }, cb);
16
16
  }
17
17
  }
18
- exports.Tax = Tax;
18
+ exports.TaxClient = TaxClient;