@yunzhanghu/sdk-nodejs 1.0.11 → 1.0.13

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 CHANGED
@@ -77,7 +77,7 @@ OpenSSL-> rsa -in private_key.pem -pubout -out pubkey.pem
77
77
  - [异步通知](./example/notify.js)
78
78
  - [对账文件获取](./example/dataService.js)
79
79
  - [发票开具](./example/invoice.js)
80
- - [个人所得税扣缴明细表](./example/tax.js)
80
+ - [个人所得税申报明细表](./example/tax.js)
81
81
 
82
82
  ### 示例
83
83
 
@@ -113,6 +113,36 @@ dataService
113
113
  console.log(err.toString())
114
114
  })
115
115
 
116
+ // 查询日订单数据(支付和退款订单)
117
+ dataService
118
+ .ListDailyOrderV2({
119
+
120
+ /**
121
+ * @param {string} request-id:请求 ID,请求的唯一标识
122
+ * 建议平台企业自定义 request-id,并记录在日志中,便于问题发现及排查
123
+ * 如未自定义 request-id,将使用 SDK 中的 UUID 方法自动生成。注意:UUID 方法生成的 request-id 不能保证全局唯一,推荐自定义 request-id
124
+ */
125
+ request_id: 'requestIdExample123456789',
126
+ order_date: '2024-09-05',
127
+ offset: 0,
128
+ length: 100,
129
+ channel: 'alipay',
130
+ data_type: '',
131
+ })
132
+ .then((data) => {
133
+ if (data.code === '0000') {
134
+ // 操作成功
135
+ console.log('操作成功 ', JSON.stringify(data, null, 2))
136
+ } else {
137
+ // 失败返回
138
+ console.log('失败返回 ', 'code:' + data.code + ' message:' + data.message + ' request_id:' + data.request_id)
139
+ }
140
+ })
141
+ .catch((err) => {
142
+ // 发生异常
143
+ console.log(err.toString())
144
+ })
145
+
116
146
  // 查询日订单文件(支付和退款订单)
117
147
  dataService
118
148
  .GetDailyOrderFileV2({
@@ -77,6 +77,8 @@ invoice
77
77
  bank_name_account: '交通银行北京东大桥支行 12343456654321',
78
78
  goods_services_name: '*测试分类*test测试内容',
79
79
  remark: '',
80
+ receive_emails: ['username1@example.com'],
81
+ invoice_media: '1',
80
82
  })
81
83
  .then((data) => {
82
84
  if (data.code === '0000') {
@@ -146,7 +148,7 @@ invoice
146
148
  console.log(err.toString())
147
149
  })
148
150
 
149
- // 发送发票扫描件压缩包下载链接邮件
151
+ // 发送发票开具成功通知邮件
150
152
  invoice
151
153
  .SendReminderEmail({
152
154
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yunzhanghu/sdk-nodejs",
3
- "version": "1.0.11",
3
+ "version": "1.0.13",
4
4
  "description": "云账户 SDK for Node.js",
5
5
  "main": "yzh/index.js",
6
6
  "scripts": {
@@ -128,6 +128,80 @@ interface DealerOrderInfo {
128
128
  finished_time: string;
129
129
  }
130
130
 
131
+ /** ListDailyOrderV2Request 查询日订单数据(支付和退款订单)请求 */
132
+ interface ListDailyOrderV2Request {
133
+ /** 订单查询日期, yyyy-MM-dd 格式 */
134
+ order_date: string;
135
+ /** 偏移量 */
136
+ offset: number;
137
+ /** 每页返回条数 */
138
+ length: number;
139
+ /** 支付路径名,bankpay:银行卡 alipay:支付宝 wxpay:微信 */
140
+ channel: string;
141
+ /** 当且仅当参数值为 encryption 时,对返回的 data 进行加密 */
142
+ data_type: string;
143
+ }
144
+
145
+ /** ListDailyOrderV2Response 查询日订单数据(支付和退款订单)返回 */
146
+ interface ListDailyOrderV2Response {
147
+ /** 总条数 */
148
+ total_num: number;
149
+ /** 条目明细 */
150
+ list: DealerOrderInfoV2[];
151
+ }
152
+
153
+ /** DealerOrderInfoV2 平台企业支付订单信息(支付和退款订单) */
154
+ interface DealerOrderInfoV2 {
155
+ /** 综合服务主体 ID */
156
+ broker_id: string;
157
+ /** 平台企业 ID */
158
+ dealer_id: string;
159
+ /** 订单类型 */
160
+ order_type: string;
161
+ /** 平台企业订单号 */
162
+ order_id: string;
163
+ /** 综合服务平台流水号 */
164
+ ref: string;
165
+ /** 批次号 */
166
+ batch_id: string;
167
+ /** 姓名 */
168
+ real_name: string;
169
+ /** 收款账号 */
170
+ card_no: string;
171
+ /** 综合服务主体订单金额 */
172
+ broker_amount: string;
173
+ /** 综合服务主体加成服务费 */
174
+ broker_fee: string;
175
+ /** 支付路径流水号 */
176
+ bill: string;
177
+ /** 订单状态码 */
178
+ status: string;
179
+ /** 订单状态码描述 */
180
+ status_message: string;
181
+ /** 订单详情状态码 */
182
+ status_detail: string;
183
+ /** 订单详细状态码描述 */
184
+ status_detail_message: string;
185
+ /** 订单状态补充信息 */
186
+ supplemental_detail_message: string;
187
+ /** 短周期授信账单号 */
188
+ statement_id: string;
189
+ /** 加成服务费账单号 */
190
+ fee_statement_id: string;
191
+ /** 余额账单号 */
192
+ bal_statement_id: string;
193
+ /** 支付路径 */
194
+ channel: string;
195
+ /** 订单接收时间 */
196
+ created_at: string;
197
+ /** 订单完成时间 */
198
+ finished_time: string;
199
+ /** 退款类型 */
200
+ refund_type: string;
201
+ /** 原支付流水号 */
202
+ pay_ref: string;
203
+ }
204
+
131
205
  /** ListDailyBillRequest 查询日流水数据请求 */
132
206
  interface ListDailyBillRequest {
133
207
  /** 流水查询日期 */
@@ -274,6 +348,20 @@ export class DataServiceClient extends YZHclient {
274
348
  );
275
349
  }
276
350
 
351
+ // ListDailyOrderV2 查询日订单数据(支付和退款订单)
352
+ async ListDailyOrderV2(
353
+ req: ListDailyOrderV2Request,
354
+ cb?: (error: null | string, rep: ListDailyOrderV2Response) => void
355
+ ): Promise<ListDailyOrderV2Response> {
356
+ return this.request(
357
+ 'get',
358
+ '/api/dataservice/v2/orders',
359
+ req,
360
+ { encryption: req?.data_type === 'encryption' },
361
+ cb
362
+ );
363
+ }
364
+
277
365
  // GetDailyOrderFile 查询日订单文件
278
366
  async GetDailyOrderFile(
279
367
  req: GetDailyOrderFileRequest,
@@ -60,6 +60,10 @@ interface ApplyInvoiceRequest {
60
60
  goods_services_name: string;
61
61
  /** 发票备注 */
62
62
  remark: string;
63
+ /** 发票接收邮箱 */
64
+ receive_emails: string[];
65
+ /** 发票介质 */
66
+ invoice_media: string;
63
67
  }
64
68
 
65
69
  /** ApplyInvoiceResponse 发票开具申请返回 */
@@ -108,6 +112,10 @@ interface GetInvoiceStatusResponse {
108
112
  post_type: string;
109
113
  /** 快递单号 */
110
114
  waybill_number: string[];
115
+ /** 驳回原因 */
116
+ reject_reason: string;
117
+ /** 发票介质 */
118
+ invoice_media: string;
111
119
  }
112
120
 
113
121
  /** GetInvoiceInformationRequest 查询发票信息请求 */
@@ -142,6 +150,8 @@ interface InformationDataInfo {
142
150
  price_tax_amount: string;
143
151
  /** 开票日期 */
144
152
  invoiced_date: string;
153
+ /** 发票状态 */
154
+ status: string;
145
155
  }
146
156
 
147
157
  /** BankNameAccount 系统支持的开户行及账号 */
@@ -176,7 +186,7 @@ interface GetInvoiceFileResponse {
176
186
  name: string;
177
187
  }
178
188
 
179
- /** SendReminderEmailRequest 发送发票扫描件压缩包下载链接邮件请求 */
189
+ /** SendReminderEmailRequest 发送发票开具成功通知邮件请求 */
180
190
  interface SendReminderEmailRequest {
181
191
  /** 发票申请编号 */
182
192
  invoice_apply_id: string;
@@ -184,7 +194,7 @@ interface SendReminderEmailRequest {
184
194
  application_id: string;
185
195
  }
186
196
 
187
- /** SendReminderEmailResponse 发送发票扫描件压缩包下载链接邮件返回 */
197
+ /** SendReminderEmailResponse 发送发票开具成功通知邮件返回 */
188
198
  interface SendReminderEmailResponse {}
189
199
 
190
200
  export class InvoiceClient extends YZHclient {
@@ -251,7 +261,7 @@ export class InvoiceClient extends YZHclient {
251
261
  return this.request('post', '/api/invoice/v2/invoice/invoice-pdf', req, { encryption: false }, cb);
252
262
  }
253
263
 
254
- // SendReminderEmail 发送发票扫描件压缩包下载链接邮件
264
+ // SendReminderEmail 发送发票开具成功通知邮件
255
265
  async SendReminderEmail(
256
266
  req: SendReminderEmailRequest,
257
267
  cb?: (error: null | string, rep: SendReminderEmailResponse) => void
@@ -127,6 +127,80 @@ interface DealerOrderInfo {
127
127
  finished_time: string;
128
128
  }
129
129
 
130
+ /** ListDailyOrderV2Request 查询日订单数据(支付和退款订单)请求 */
131
+ interface ListDailyOrderV2Request {
132
+ /** 订单查询日期, yyyy-MM-dd 格式 */
133
+ order_date: string;
134
+ /** 偏移量 */
135
+ offset: number;
136
+ /** 每页返回条数 */
137
+ length: number;
138
+ /** 支付路径名,bankpay:银行卡 alipay:支付宝 wxpay:微信 */
139
+ channel: string;
140
+ /** 当且仅当参数值为 encryption 时,对返回的 data 进行加密 */
141
+ data_type: string;
142
+ }
143
+
144
+ /** ListDailyOrderV2Response 查询日订单数据(支付和退款订单)返回 */
145
+ interface ListDailyOrderV2Response {
146
+ /** 总条数 */
147
+ total_num: number;
148
+ /** 条目明细 */
149
+ list: DealerOrderInfoV2[];
150
+ }
151
+
152
+ /** DealerOrderInfoV2 平台企业支付订单信息(支付和退款订单) */
153
+ interface DealerOrderInfoV2 {
154
+ /** 综合服务主体 ID */
155
+ broker_id: string;
156
+ /** 平台企业 ID */
157
+ dealer_id: string;
158
+ /** 订单类型 */
159
+ order_type: string;
160
+ /** 平台企业订单号 */
161
+ order_id: string;
162
+ /** 综合服务平台流水号 */
163
+ ref: string;
164
+ /** 批次号 */
165
+ batch_id: string;
166
+ /** 姓名 */
167
+ real_name: string;
168
+ /** 收款账号 */
169
+ card_no: string;
170
+ /** 综合服务主体订单金额 */
171
+ broker_amount: string;
172
+ /** 综合服务主体加成服务费 */
173
+ broker_fee: string;
174
+ /** 支付路径流水号 */
175
+ bill: string;
176
+ /** 订单状态码 */
177
+ status: string;
178
+ /** 订单状态码描述 */
179
+ status_message: string;
180
+ /** 订单详情状态码 */
181
+ status_detail: string;
182
+ /** 订单详细状态码描述 */
183
+ status_detail_message: string;
184
+ /** 订单状态补充信息 */
185
+ supplemental_detail_message: string;
186
+ /** 短周期授信账单号 */
187
+ statement_id: string;
188
+ /** 加成服务费账单号 */
189
+ fee_statement_id: string;
190
+ /** 余额账单号 */
191
+ bal_statement_id: string;
192
+ /** 支付路径 */
193
+ channel: string;
194
+ /** 订单接收时间 */
195
+ created_at: string;
196
+ /** 订单完成时间 */
197
+ finished_time: string;
198
+ /** 退款类型 */
199
+ refund_type: string;
200
+ /** 原支付流水号 */
201
+ pay_ref: string;
202
+ }
203
+
130
204
  /** ListDailyBillRequest 查询日流水数据请求 */
131
205
  interface ListDailyBillRequest {
132
206
  /** 流水查询日期 */
@@ -259,6 +333,10 @@ export declare class DataServiceClient extends YZHclient {
259
333
  req: ListDailyOrderRequest,
260
334
  cb?: (error: null | string, rep: ListDailyOrderResponse) => void
261
335
  ): Promise<ListDailyOrderResponse>;
336
+ ListDailyOrderV2(
337
+ req: ListDailyOrderV2Request,
338
+ cb?: (error: null | string, rep: ListDailyOrderV2Response) => void
339
+ ): Promise<ListDailyOrderV2Response>;
262
340
  GetDailyOrderFile(
263
341
  req: GetDailyOrderFileRequest,
264
342
  cb?: (error: null | string, rep: GetDailyOrderFileResponse) => void
@@ -17,6 +17,16 @@ class DataServiceClient extends client_1.default {
17
17
  cb
18
18
  );
19
19
  }
20
+ // ListDailyOrderV2 查询日订单数据(支付和退款订单)
21
+ async ListDailyOrderV2(req, cb) {
22
+ return this.request(
23
+ 'get',
24
+ '/api/dataservice/v2/orders',
25
+ req,
26
+ { encryption: (req === null || req === void 0 ? void 0 : req.data_type) === 'encryption' },
27
+ cb
28
+ );
29
+ }
20
30
  // GetDailyOrderFile 查询日订单文件
21
31
  async GetDailyOrderFile(req, cb) {
22
32
  return this.request('get', '/api/dataservice/v1/order/downloadurl', req, { encryption: false }, cb);
@@ -59,6 +59,10 @@ interface ApplyInvoiceRequest {
59
59
  goods_services_name: string;
60
60
  /** 发票备注 */
61
61
  remark: string;
62
+ /** 发票接收邮箱 */
63
+ receive_emails: string[];
64
+ /** 发票介质 */
65
+ invoice_media: string;
62
66
  }
63
67
 
64
68
  /** ApplyInvoiceResponse 发票开具申请返回 */
@@ -107,6 +111,10 @@ interface GetInvoiceStatusResponse {
107
111
  post_type: string;
108
112
  /** 快递单号 */
109
113
  waybill_number: string[];
114
+ /** 驳回原因 */
115
+ reject_reason: string;
116
+ /** 发票介质 */
117
+ invoice_media: string;
110
118
  }
111
119
 
112
120
  /** GetInvoiceInformationRequest 查询发票信息请求 */
@@ -141,6 +149,8 @@ interface InformationDataInfo {
141
149
  price_tax_amount: string;
142
150
  /** 开票日期 */
143
151
  invoiced_date: string;
152
+ /** 发票状态 */
153
+ status: string;
144
154
  }
145
155
 
146
156
  /** BankNameAccount 系统支持的开户行及账号 */
@@ -175,7 +185,7 @@ interface GetInvoiceFileResponse {
175
185
  name: string;
176
186
  }
177
187
 
178
- /** SendReminderEmailRequest 发送发票扫描件压缩包下载链接邮件请求 */
188
+ /** SendReminderEmailRequest 发送发票开具成功通知邮件请求 */
179
189
  interface SendReminderEmailRequest {
180
190
  /** 发票申请编号 */
181
191
  invoice_apply_id: string;
@@ -183,7 +193,7 @@ interface SendReminderEmailRequest {
183
193
  application_id: string;
184
194
  }
185
195
 
186
- /** SendReminderEmailResponse 发送发票扫描件压缩包下载链接邮件返回 */
196
+ /** SendReminderEmailResponse 发送发票开具成功通知邮件返回 */
187
197
  interface SendReminderEmailResponse {}
188
198
 
189
199
  export declare class InvoiceClient extends YZHclient {
@@ -31,7 +31,7 @@ class InvoiceClient extends client_1.default {
31
31
  async GetInvoiceFile(req, cb) {
32
32
  return this.request('post', '/api/invoice/v2/invoice/invoice-pdf', req, { encryption: false }, cb);
33
33
  }
34
- // SendReminderEmail 发送发票扫描件压缩包下载链接邮件
34
+ // SendReminderEmail 发送发票开具成功通知邮件
35
35
  async SendReminderEmail(req, cb) {
36
36
  return this.request('post', '/api/invoice/v2/invoice/reminder/email', req, { encryption: false }, cb);
37
37
  }