@yunzhanghu/sdk-nodejs 1.0.21 → 1.0.22

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/.eslintignore CHANGED
@@ -2,4 +2,5 @@ node_modules
2
2
  package.json
3
3
  .eslintrc.json
4
4
  yzh
5
- example
5
+ example
6
+ exampleTest
@@ -32,7 +32,7 @@ caculatorLabor
32
32
  } else {
33
33
  // 失败返回
34
34
  console.log('失败返回 ', 'code:' + data.code + ' message:' + data.message + ' request_id:' + data.request_id)
35
- }
35
+ }
36
36
  })
37
37
  .catch((err) => {
38
38
  // 发生异常
@@ -54,6 +54,7 @@ caculatorLabor
54
54
  real_name: "张三",
55
55
  id_card: "11010519491231002X",
56
56
  pay: "99",
57
+ tax_type: "before_tax",
57
58
  })
58
59
  .then((data) => {
59
60
  if (data.code === '0000') {
@@ -62,7 +63,7 @@ caculatorLabor
62
63
  } else {
63
64
  // 失败返回
64
65
  console.log('失败返回 ', 'code:' + data.code + ' message:' + data.message + ' request_id:' + data.request_id)
65
- }
66
+ }
66
67
  })
67
68
  .catch((err) => {
68
69
  // 发生异常
@@ -1,9 +1,9 @@
1
- const config = require('./conf/config.js');
1
+ const config = require('./conf/config.js')
2
2
 
3
- const yunzhanghu = require('../yzh/index.js');
3
+ const yunzhanghu = require('../yzh/index.js')
4
4
 
5
- const util = new yunzhanghu.Util(config);
5
+ const util = new yunzhanghu.Util(config)
6
6
 
7
- const url = util.getCustomerLink('https://www.example.com', 'testmemberid');
7
+ const url = util.getCustomerLink('https://www.example.com', 'testmemberid')
8
8
 
9
- console.log('生成最终客服链接:', url);
9
+ console.log('生成最终客服链接:', url)
@@ -7,7 +7,7 @@ const payment = new yzhAPI.PaymentClient(config)
7
7
  // 银行卡实时支付
8
8
  payment
9
9
  .CreateBankpayOrder({
10
-
10
+
11
11
  /**
12
12
  * @param {string} request-id:请求 ID,请求的唯一标识
13
13
  * 建议平台企业自定义 request-id,并记录在日志中,便于问题发现及排查
@@ -25,6 +25,9 @@ payment
25
25
  pay_remark: 'test',
26
26
  notify_url: 'https://www.example.com',
27
27
  project_id: '',
28
+ dealer_platform_name: '互联网平台名称test',
29
+ dealer_user_nickname: 'usernickname',
30
+ dealer_user_id: 'userId1234567890',
28
31
  })
29
32
  .then((data) => {
30
33
  if (data.code === '0000') {
@@ -33,7 +36,7 @@ payment
33
36
  } else {
34
37
  // 失败返回
35
38
  console.log('失败返回 ', 'code:' + data.code + ' message:' + data.message + ' request_id:' + data.request_id)
36
- }
39
+ }
37
40
  })
38
41
  .catch((err) => {
39
42
  // 发生异常
@@ -43,7 +46,7 @@ payment
43
46
  // 支付宝实时支付
44
47
  payment
45
48
  .CreateAlipayOrder({
46
-
49
+
47
50
  /**
48
51
  * @param {string} request-id:请求 ID,请求的唯一标识
49
52
  * 建议平台企业自定义 request-id,并记录在日志中,便于问题发现及排查
@@ -62,6 +65,9 @@ payment
62
65
  pay_remark: 'test',
63
66
  notify_url: 'https://www.example.com',
64
67
  project_id: '',
68
+ dealer_platform_name: '互联网平台名称test',
69
+ dealer_user_nickname: 'usernickname',
70
+ dealer_user_id: 'userId1234567890',
65
71
  })
66
72
  .then((data) => {
67
73
  if (data.code === '0000') {
@@ -70,7 +76,7 @@ payment
70
76
  } else {
71
77
  // 失败返回
72
78
  console.log('失败返回 ', 'code:' + data.code + ' message:' + data.message + ' request_id:' + data.request_id)
73
- }
79
+ }
74
80
  })
75
81
  .catch((err) => {
76
82
  // 发生异常
@@ -80,7 +86,7 @@ payment
80
86
  // 微信实时支付
81
87
  payment
82
88
  .CreateWxpayOrder({
83
-
89
+
84
90
  /**
85
91
  * @param {string} request-id:请求 ID,请求的唯一标识
86
92
  * 建议平台企业自定义 request-id,并记录在日志中,便于问题发现及排查
@@ -99,6 +105,9 @@ payment
99
105
  pay_remark: 'test',
100
106
  notify_url: 'https://www.example.com',
101
107
  project_id: '',
108
+ dealer_platform_name: '互联网平台名称test',
109
+ dealer_user_nickname: 'usernickname',
110
+ dealer_user_id: 'userId1234567890',
102
111
  })
103
112
  .then((data) => {
104
113
  if (data.code === '0000') {
@@ -107,7 +116,7 @@ payment
107
116
  } else {
108
117
  // 失败返回
109
118
  console.log('失败返回 ', 'code:' + data.code + ' message:' + data.message + ' request_id:' + data.request_id)
110
- }
119
+ }
111
120
  })
112
121
  .catch((err) => {
113
122
  // 发生异常
@@ -117,7 +126,7 @@ payment
117
126
  // 查询单笔订单信息
118
127
  payment
119
128
  .GetOrder({
120
-
129
+
121
130
  /**
122
131
  * @param {string} request-id:请求 ID,请求的唯一标识
123
132
  * 建议平台企业自定义 request-id,并记录在日志中,便于问题发现及排查
@@ -135,7 +144,7 @@ payment
135
144
  } else {
136
145
  // 失败返回
137
146
  console.log('失败返回 ', 'code:' + data.code + ' message:' + data.message + ' request_id:' + data.request_id)
138
- }
147
+ }
139
148
  })
140
149
  .catch((err) => {
141
150
  // 发生异常
@@ -145,7 +154,7 @@ payment
145
154
  // 查询平台企业余额
146
155
  payment
147
156
  .ListAccount({
148
-
157
+
149
158
  /**
150
159
  * @param {string} request-id:请求 ID,请求的唯一标识
151
160
  * 建议平台企业自定义 request-id,并记录在日志中,便于问题发现及排查
@@ -161,7 +170,7 @@ payment
161
170
  } else {
162
171
  // 失败返回
163
172
  console.log('失败返回 ', 'code:' + data.code + ' message:' + data.message + ' request_id:' + data.request_id)
164
- }
173
+ }
165
174
  })
166
175
  .catch((err) => {
167
176
  // 发生异常
@@ -171,7 +180,7 @@ payment
171
180
  // 查询电子回单
172
181
  payment
173
182
  .GetEleReceiptFile({
174
-
183
+
175
184
  /**
176
185
  * @param {string} request-id:请求 ID,请求的唯一标识
177
186
  * 建议平台企业自定义 request-id,并记录在日志中,便于问题发现及排查
@@ -188,7 +197,7 @@ payment
188
197
  } else {
189
198
  // 失败返回
190
199
  console.log('失败返回 ', 'code:' + data.code + ' message:' + data.message + ' request_id:' + data.request_id)
191
- }
200
+ }
192
201
  })
193
202
  .catch((err) => {
194
203
  // 发生异常
@@ -198,7 +207,7 @@ payment
198
207
  // 取消待支付订单
199
208
  payment
200
209
  .CancelOrder({
201
-
210
+
202
211
  /**
203
212
  * @param {string} request-id:请求 ID,请求的唯一标识
204
213
  * 建议平台企业自定义 request-id,并记录在日志中,便于问题发现及排查
@@ -218,7 +227,7 @@ payment
218
227
  // 重试挂起状态订单
219
228
  payment
220
229
  .RetryOrder({
221
-
230
+
222
231
  /**
223
232
  * @param {string} request-id:请求 ID,请求的唯一标识
224
233
  * 建议平台企业自定义 request-id,并记录在日志中,便于问题发现及排查
@@ -240,7 +249,7 @@ payment
240
249
  // 查询平台企业汇款信息
241
250
  payment
242
251
  .GetDealerVARechargeAccount({
243
-
252
+
244
253
  /**
245
254
  * @param {string} request-id:请求 ID,请求的唯一标识
246
255
  * 建议平台企业自定义 request-id,并记录在日志中,便于问题发现及排查
@@ -257,7 +266,7 @@ payment
257
266
  } else {
258
267
  // 失败返回
259
268
  console.log('失败返回 ', 'code:' + data.code + ' message:' + data.message + ' request_id:' + data.request_id)
260
- }
269
+ }
261
270
  })
262
271
  .catch((err) => {
263
272
  // 发生异常
@@ -267,7 +276,7 @@ payment
267
276
  // 用户结算金额校验
268
277
  payment
269
278
  .CheckUserAmount({
270
-
279
+
271
280
  /**
272
281
  * @param {string} request-id:请求 ID,请求的唯一标识
273
282
  * 建议平台企业自定义 request-id,并记录在日志中,便于问题发现及排查
@@ -286,7 +295,7 @@ payment
286
295
  } else {
287
296
  // 失败返回
288
297
  console.log('失败返回 ', 'code:' + data.code + ' message:' + data.message + ' request_id:' + data.request_id)
289
- }
298
+ }
290
299
  })
291
300
  .catch((err) => {
292
301
  // 发生异常
@@ -296,7 +305,7 @@ payment
296
305
  // 批次下单
297
306
  payment
298
307
  .CreateBatchOrder({
299
-
308
+
300
309
  /**
301
310
  * @param {string} request-id:请求 ID,请求的唯一标识
302
311
  * 建议平台企业自定义 request-id,并记录在日志中,便于问题发现及排查
@@ -319,6 +328,9 @@ payment
319
328
  pay: '0.01',
320
329
  pay_remark: '测试订单1',
321
330
  notify_url: 'https://www.example.com',
331
+ dealer_platform_name: '互联网平台名称test',
332
+ dealer_user_nickname: 'usernickname',
333
+ dealer_user_id: 'userId1234567890',
322
334
  },
323
335
  {
324
336
  order_id: '2013011802111',
@@ -329,6 +341,9 @@ payment
329
341
  pay: '0.01',
330
342
  pay_remark: '测试订单2',
331
343
  notify_url: 'https://www.example.com',
344
+ dealer_platform_name: '互联网平台名称test',
345
+ dealer_user_nickname: 'usernickname',
346
+ dealer_user_id: 'userId1234567890',
332
347
  },
333
348
  ],
334
349
  })
@@ -342,7 +357,7 @@ payment
342
357
  // 批次确认
343
358
  payment
344
359
  .ConfirmBatchOrder({
345
-
360
+
346
361
  /**
347
362
  * @param {string} request-id:请求 ID,请求的唯一标识
348
363
  * 建议平台企业自定义 request-id,并记录在日志中,便于问题发现及排查
@@ -361,7 +376,7 @@ payment
361
376
  } else {
362
377
  // 失败返回
363
378
  console.log('失败返回 ', 'code:' + data.code + ' message:' + data.message + ' request_id:' + data.request_id)
364
- }
379
+ }
365
380
  })
366
381
  .catch((err) => {
367
382
  // 发生异常
@@ -371,7 +386,7 @@ payment
371
386
  // 查询批次订单信息
372
387
  payment
373
388
  .QueryBatchOrder({
374
-
389
+
375
390
  /**
376
391
  * @param {string} request-id:请求 ID,请求的唯一标识
377
392
  * 建议平台企业自定义 request-id,并记录在日志中,便于问题发现及排查
@@ -388,7 +403,7 @@ payment
388
403
  } else {
389
404
  // 失败返回
390
405
  console.log('失败返回 ', 'code:' + data.code + ' message:' + data.message + ' request_id:' + data.request_id)
391
- }
406
+ }
392
407
  })
393
408
  .catch((err) => {
394
409
  // 发生异常
@@ -398,7 +413,7 @@ payment
398
413
  // 批次撤销
399
414
  payment
400
415
  .CancelBatchOrder({
401
-
416
+
402
417
  /**
403
418
  * @param {string} request-id:请求 ID,请求的唯一标识
404
419
  * 建议平台企业自定义 request-id,并记录在日志中,便于问题发现及排查
@@ -416,7 +431,7 @@ payment
416
431
  } else {
417
432
  // 失败返回
418
433
  console.log('失败返回 ', 'code:' + data.code + ' message:' + data.message + ' request_id:' + data.request_id)
419
- }
434
+ }
420
435
  })
421
436
  .catch((err) => {
422
437
  // 发生异常
@@ -427,7 +442,7 @@ payment
427
442
  // 查询劳务模式单笔订单信息
428
443
  payment
429
444
  .GetOrderLxlw({
430
-
445
+
431
446
  /**
432
447
  * @param {string} request-id:请求 ID,请求的唯一标识
433
448
  * 建议平台企业自定义 request-id,并记录在日志中,便于问题发现及排查
@@ -445,7 +460,7 @@ payment
445
460
  } else {
446
461
  // 失败返回
447
462
  console.log('失败返回 ', 'code:' + data.code + ' message:' + data.message + ' request_id:' + data.request_id)
448
- }
463
+ }
449
464
  })
450
465
  .catch((err) => {
451
466
  // 发生异常
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yunzhanghu/sdk-nodejs",
3
- "version": "1.0.21",
3
+ "version": "1.0.22",
4
4
  "description": "云账户 SDK for Node.js",
5
5
  "main": "yzh/index.js",
6
6
  "scripts": {
@@ -68,38 +68,80 @@ interface MontTax {
68
68
 
69
69
  /** CalcTaxRequest 订单税费试算请求 */
70
70
  interface CalcTaxRequest {
71
- /** 平台企业 ID */
72
- dealer_id: string;
73
- /** 综合服务主体 ID */
74
- broker_id: string;
75
- /** 姓名 */
76
- real_name: string;
77
- /** 证件号 */
78
- id_card: string;
79
- /** 订单金额 */
80
- pay: string;
71
+ /** 平台企业 ID */
72
+ dealer_id: string;
73
+ /** 综合服务主体 ID */
74
+ broker_id: string;
75
+ /** 姓名 */
76
+ real_name: string;
77
+ /** 证件号 */
78
+ id_card: string;
79
+ /** 测算金额 */
80
+ pay: string;
81
+ /** 测算类型 */
82
+ tax_type: string;
81
83
  }
82
84
 
83
85
  /** CalcTaxResponse 订单税费试算返回 */
84
86
  interface CalcTaxResponse {
85
- /** 订单金额 */
86
- pay: string;
87
- /** 税费总额 */
88
- tax: string;
89
- /** 税后金额 */
90
- after_tax_amount: string;
91
- /** 税费明细 */
92
- tax_detail: CalcTaxDetail;
87
+ /** 测算金额 */
88
+ pay: string;
89
+ /** 税费总额 */
90
+ tax: string;
91
+ /** 税后结算金额 */
92
+ after_tax_amount: string;
93
+ /** 缴税明细 */
94
+ tax_detail: CalcTaxDetail;
95
+ /** 税前订单金额 */
96
+ before_tax_amount: string;
97
+ /** 用户税费总额 */
98
+ user_tax: string;
99
+ /** 平台企业税费总额 */
100
+ dealer_tax: string;
101
+ /** 云账户税费总额 */
102
+ broker_tax: string;
103
+ /** 用户服务费 */
104
+ user_fee: string;
105
+ /** 结果 */
106
+ status: string;
107
+ /** 结果详细状态码 */
108
+ status_detail: string;
109
+ /** 结果说明 */
110
+ status_message: string;
111
+ /** 结果详细状态码描述 */
112
+ status_detail_message: string;
93
113
  }
94
114
 
95
115
  /** CalcTaxDetail 税费明细 */
96
116
  interface CalcTaxDetail {
97
- /** 应纳个税 */
98
- personal_tax: string;
99
- /** 应纳增值税 */
100
- value_added_tax: string;
101
- /** 应纳附加税费 */
102
- additional_tax: string;
117
+ /** 预扣个税 */
118
+ personal_tax: string;
119
+ /** 预扣增值税 */
120
+ value_added_tax: string;
121
+ /** 预扣附加税费 */
122
+ additional_tax: string;
123
+ /** 用户预扣个税 */
124
+ user_personal_tax: string;
125
+ /** 平台企业预扣个税 */
126
+ dealer_personal_tax: string;
127
+ /** 云账户预扣个税 */
128
+ broker_personal_tax: string;
129
+ /** 用户预扣增值税 */
130
+ user_value_added_tax: string;
131
+ /** 平台企业预扣增值税 */
132
+ dealer_value_added_tax: string;
133
+ /** 云账户预扣增值税 */
134
+ broker_value_added_tax: string;
135
+ /** 用户预扣附加税费 */
136
+ user_additional_tax: string;
137
+ /** 平台企业预扣附加税费 */
138
+ dealer_additional_tax: string;
139
+ /** 云账户预扣附加税费 */
140
+ broker_additional_tax: string;
141
+ /** 预扣个税税率 */
142
+ personal_tax_rate: string;
143
+ /** 预扣个税速算扣除数 */
144
+ deduct_tax: string;
103
145
  }
104
146
 
105
147
  export class CalculateLaborServiceClient extends YZHclient {