@yunzhanghu/sdk-nodejs 1.0.21 → 1.0.23
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 +2 -1
- package/example/calculatelabor.js +61 -2
- package/example/customerLink.js +5 -5
- package/example/payment.js +42 -27
- package/example/realName.js +149 -0
- package/package.json +1 -1
- package/src/services/calculatelabor/index.ts +227 -100
- package/src/services/dataservice/index.ts +608 -431
- package/src/services/payment/index.ts +812 -638
- package/src/services/realname/index.ts +123 -0
- package/yzh/services/calculatelabor/index.d.ts +157 -70
- package/yzh/services/calculatelabor/index.js +8 -0
- package/yzh/services/dataservice/index.d.ts +453 -318
- package/yzh/services/index.d.ts +1 -0
- package/yzh/services/index.js +4 -1
- package/yzh/services/payment/index.d.ts +587 -492
- package/yzh/services/realname/index.d.ts +123 -0
- package/yzh/services/realname/index.js +20 -0
|
@@ -2,135 +2,262 @@ import YZHclient from '../../common/client';
|
|
|
2
2
|
|
|
3
3
|
/** LaborCaculatorRequest 连续劳务税费试算(计算器)请求 */
|
|
4
4
|
interface LaborCaculatorRequest {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
/** 平台企业 ID */
|
|
6
|
+
dealer_id: string;
|
|
7
|
+
/** 综合服务主体 ID */
|
|
8
|
+
broker_id: string;
|
|
9
|
+
/** 月度收入列表 */
|
|
10
|
+
month_settlement_list: MonthSettlement[];
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
/** MonthSettlement 月度收入 */
|
|
14
14
|
interface MonthSettlement {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
/** 月份 */
|
|
16
|
+
month: number;
|
|
17
|
+
/** 月度收入 */
|
|
18
|
+
month_pre_tax_amount: string;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
/** LaborCaculatorResponse 连续劳务税费试算(计算器)返回 */
|
|
22
22
|
interface LaborCaculatorResponse {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
/** 综合所得汇算清缴 */
|
|
24
|
+
year_tax_info: YearTaxInfo;
|
|
25
|
+
/** 月度税务信息列表 */
|
|
26
|
+
month_tax_list: MontTax[];
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
/** YearTaxInfo 综合所得汇算清缴信息 */
|
|
30
30
|
interface YearTaxInfo {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
31
|
+
/** 连续劳务年度个税 */
|
|
32
|
+
continuous_month_personal_tax: string;
|
|
33
|
+
/** 综合所得汇算清缴年度个税 */
|
|
34
|
+
personal_tax: string;
|
|
35
|
+
/** 年度扣除费用 */
|
|
36
|
+
deduct_cost: string;
|
|
37
|
+
/** 个税税率 */
|
|
38
|
+
personal_tax_rate: string;
|
|
39
|
+
/** 速算扣除数 */
|
|
40
|
+
deduct_tax: string;
|
|
41
|
+
/** 税负率 */
|
|
42
|
+
total_tax_rate: string;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
/** MontTax 月度税务信息 */
|
|
46
46
|
interface MontTax {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
47
|
+
/** 月份 */
|
|
48
|
+
month: number;
|
|
49
|
+
/** 含增值税收入 */
|
|
50
|
+
pre_tax_amount: string;
|
|
51
|
+
/** 不含增值税收入 */
|
|
52
|
+
excluding_vat_amount: string;
|
|
53
|
+
/** 增值税 */
|
|
54
|
+
value_added_tax: string;
|
|
55
|
+
/** 附加税 */
|
|
56
|
+
additional_tax: string;
|
|
57
|
+
/** 个税 */
|
|
58
|
+
personal_tax: string;
|
|
59
|
+
/** 个税税率 */
|
|
60
|
+
personal_tax_rate: string;
|
|
61
|
+
/** 速算扣除数 */
|
|
62
|
+
deduct_tax: string;
|
|
63
|
+
/** 税后金额 */
|
|
64
|
+
post_tax_amount: string;
|
|
65
|
+
/** 税负率 */
|
|
66
|
+
total_tax_rate: string;
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
/** CalcTaxRequest 订单税费试算请求 */
|
|
70
70
|
interface CalcTaxRequest {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
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
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
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;
|
|
113
|
+
/** 用户实收金额(未扣除追缴的增附税) */
|
|
114
|
+
user_real_excluding_vat_amount: string;
|
|
115
|
+
/** 用户还未缴清的增附税 */
|
|
116
|
+
user_remaining_repayment_amount: string;
|
|
117
|
+
/** 已追缴增附税(本笔订单) */
|
|
118
|
+
user_recover_tax_amount: string;
|
|
119
|
+
/** 待追缴增附税总金额 */
|
|
120
|
+
user_total_recover_tax_amount: string;
|
|
93
121
|
}
|
|
94
122
|
|
|
95
123
|
/** CalcTaxDetail 税费明细 */
|
|
96
124
|
interface CalcTaxDetail {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
125
|
+
/** 预扣个税 */
|
|
126
|
+
personal_tax: string;
|
|
127
|
+
/** 预扣增值税 */
|
|
128
|
+
value_added_tax: string;
|
|
129
|
+
/** 预扣附加税费 */
|
|
130
|
+
additional_tax: string;
|
|
131
|
+
/** 用户预扣个税 */
|
|
132
|
+
user_personal_tax: string;
|
|
133
|
+
/** 平台企业预扣个税 */
|
|
134
|
+
dealer_personal_tax: string;
|
|
135
|
+
/** 云账户预扣个税 */
|
|
136
|
+
broker_personal_tax: string;
|
|
137
|
+
/** 用户预扣增值税 */
|
|
138
|
+
user_value_added_tax: string;
|
|
139
|
+
/** 平台企业预扣增值税 */
|
|
140
|
+
dealer_value_added_tax: string;
|
|
141
|
+
/** 云账户预扣增值税 */
|
|
142
|
+
broker_value_added_tax: string;
|
|
143
|
+
/** 用户预扣附加税费 */
|
|
144
|
+
user_additional_tax: string;
|
|
145
|
+
/** 平台企业预扣附加税费 */
|
|
146
|
+
dealer_additional_tax: string;
|
|
147
|
+
/** 云账户预扣附加税费 */
|
|
148
|
+
broker_additional_tax: string;
|
|
149
|
+
/** 预扣个税税率 */
|
|
150
|
+
personal_tax_rate: string;
|
|
151
|
+
/** 预扣个税速算扣除数 */
|
|
152
|
+
deduct_tax: string;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/** CalculationYearH5UrlRequest 连续劳务年度税费测算-H5 请求 */
|
|
156
|
+
interface CalculationYearH5UrlRequest {
|
|
157
|
+
/** 平台企业 ID */
|
|
158
|
+
dealer_id: string;
|
|
159
|
+
/** 综合服务主体 ID */
|
|
160
|
+
broker_id: string;
|
|
161
|
+
/** 主题颜色 */
|
|
162
|
+
color: string;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/** CalculationYearH5UrlResponse 连续劳务年度税费测算-H5 返回 */
|
|
166
|
+
interface CalculationYearH5UrlResponse {
|
|
167
|
+
/** 年度劳务测算 H5 页面 URL */
|
|
168
|
+
url: string;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/** CalculationH5UrlRequest 连续劳务单笔结算税费测算-H5 请求 */
|
|
172
|
+
interface CalculationH5UrlRequest {
|
|
173
|
+
/** 平台企业 ID */
|
|
174
|
+
dealer_id: string;
|
|
175
|
+
/** 综合服务主体 ID */
|
|
176
|
+
broker_id: string;
|
|
177
|
+
/** 姓名 */
|
|
178
|
+
real_name: string;
|
|
179
|
+
/** 证件号 */
|
|
180
|
+
id_card: string;
|
|
181
|
+
/** 主题颜色 */
|
|
182
|
+
color: string;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/** CalculationH5UrlResponse 连续劳务单笔结算税费测算-H5 返回 */
|
|
186
|
+
interface CalculationH5UrlResponse {
|
|
187
|
+
/** 连续劳务单笔结算税费测算 H5 页面 URL */
|
|
188
|
+
url: string;
|
|
103
189
|
}
|
|
104
190
|
|
|
105
191
|
export class CalculateLaborServiceClient extends YZHclient {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
192
|
+
// eslint-disable-next-line no-useless-constructor
|
|
193
|
+
constructor(conf: {
|
|
194
|
+
dealer_id: string;
|
|
195
|
+
broker_id: string;
|
|
196
|
+
app_key: string;
|
|
197
|
+
des3_key: string;
|
|
198
|
+
private_key: string;
|
|
199
|
+
yzh_public_key: string;
|
|
200
|
+
sign_type: 'rsa' | 'sha256';
|
|
201
|
+
base_url?: string;
|
|
202
|
+
timeout?: number;
|
|
203
|
+
}) {
|
|
204
|
+
super(conf);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
// LaborCaculator 连续劳务税费试算(计算器)
|
|
208
|
+
async LaborCaculator(
|
|
209
|
+
req: LaborCaculatorRequest,
|
|
210
|
+
cb?: (error: null | string,rep: LaborCaculatorResponse)=>void
|
|
211
|
+
): Promise<LaborCaculatorResponse> {
|
|
212
|
+
return this.request(
|
|
213
|
+
'post',
|
|
214
|
+
'/api/tax/v1/labor-caculator',
|
|
215
|
+
req,
|
|
216
|
+
{encryption: false },
|
|
217
|
+
cb
|
|
218
|
+
);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
// CalcTax 订单税费试算
|
|
222
|
+
async CalcTax(
|
|
223
|
+
req: CalcTaxRequest,
|
|
224
|
+
cb?: (error: null | string,rep: CalcTaxResponse)=>void
|
|
225
|
+
): Promise<CalcTaxResponse> {
|
|
226
|
+
return this.request(
|
|
227
|
+
'post',
|
|
228
|
+
'/api/payment/v1/calc-tax',
|
|
229
|
+
req,
|
|
230
|
+
{encryption: false },
|
|
231
|
+
cb
|
|
232
|
+
);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
// CalculationYearH5Url 连续劳务年度税费测算-H5
|
|
236
|
+
async CalculationYearH5Url(
|
|
237
|
+
req: CalculationYearH5UrlRequest,
|
|
238
|
+
cb?: (error: null | string,rep: CalculationYearH5UrlResponse)=>void
|
|
239
|
+
): Promise<CalculationYearH5UrlResponse> {
|
|
240
|
+
return this.request(
|
|
241
|
+
'get',
|
|
242
|
+
'/api/labor/service/calculation/year/h5url',
|
|
243
|
+
req,
|
|
244
|
+
{encryption: false },
|
|
245
|
+
cb
|
|
246
|
+
);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
// CalculationH5Url 连续劳务单笔结算税费测算-H5
|
|
250
|
+
async CalculationH5Url(
|
|
251
|
+
req: CalculationH5UrlRequest,
|
|
252
|
+
cb?: (error: null | string,rep: CalculationH5UrlResponse)=>void
|
|
253
|
+
): Promise<CalculationH5UrlResponse> {
|
|
254
|
+
return this.request(
|
|
255
|
+
'get',
|
|
256
|
+
'/api/labor/service/calculation/h5url',
|
|
257
|
+
req,
|
|
258
|
+
{encryption: false },
|
|
259
|
+
cb
|
|
260
|
+
);
|
|
261
|
+
}
|
|
262
|
+
|
|
136
263
|
}
|