@yunzhanghu/sdk-nodejs 1.0.3 → 1.0.5
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/README.md +6 -3
- package/example/apiUserSign.js +24 -12
- package/example/authentication.js +48 -24
- package/example/bizlicXjjH5.js +12 -6
- package/example/bizlicXjjH5Api.js +18 -9
- package/example/custom.js +53 -0
- package/example/dataService.js +42 -21
- package/example/h5UserSign.js +24 -12
- package/example/invoice.js +42 -21
- package/example/payment.js +93 -33
- package/example/tax.js +12 -6
- package/example/uploadusersign.js +12 -6
- package/package.json +2 -4
- package/src/common/client.ts +361 -371
- package/src/common/exception/yzhSDKHttpException.ts +26 -26
- package/src/common/http/index.ts +56 -58
- package/src/common/utils/index.ts +16 -16
- package/src/index.ts +1 -1
- package/src/services/apiusersign/index.ts +107 -107
- package/src/services/authentication/index.ts +162 -180
- package/src/services/bizlicxjjh5/index.ts +77 -77
- package/src/services/bizlicxjjh5api/index.ts +108 -126
- package/src/services/custom/index.ts +36 -0
- package/src/services/dataservice/index.ts +246 -270
- package/src/services/h5usersign/index.ts +93 -93
- package/src/services/index.ts +12 -11
- package/src/services/invoice/index.ts +184 -208
- package/src/services/payment/index.ts +493 -387
- package/src/services/tax/index.ts +53 -53
- package/src/services/uploadusersign/index.ts +67 -67
- package/src/typings.d.ts +1 -1
- package/yzh/common/client.d.ts +3 -3
- package/yzh/common/client.js +24 -31
- package/yzh/common/exception/yzhSDKHttpException.js +2 -2
- package/yzh/common/http/index.js +9 -9
- package/yzh/common/utils/index.d.ts +2 -2
- package/yzh/index.d.ts +1 -1
- package/yzh/services/custom/index.d.ts +28 -0
- package/yzh/services/custom/index.js +23 -0
- package/yzh/services/index.d.ts +12 -11
- package/yzh/services/index.js +3 -1
- package/yzh/services/payment/index.d.ts +106 -4
- package/yzh/services/payment/index.js +4 -0
|
@@ -1,484 +1,590 @@
|
|
|
1
|
-
import YZHclient from
|
|
1
|
+
import YZHclient from '../../common/client';
|
|
2
2
|
|
|
3
3
|
/** CreateBankpayOrderRequest 银行卡实时支付请求 */
|
|
4
4
|
interface CreateBankpayOrderRequest {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
5
|
+
/** 平台企业订单号 */
|
|
6
|
+
order_id: string;
|
|
7
|
+
/** 平台企业 ID */
|
|
8
|
+
dealer_id: string;
|
|
9
|
+
/** 综合服务主体 ID */
|
|
10
|
+
broker_id: string;
|
|
11
|
+
/** 姓名 */
|
|
12
|
+
real_name: string;
|
|
13
|
+
/** 银行卡号 */
|
|
14
|
+
card_no: string;
|
|
15
|
+
/** 身份证号码 */
|
|
16
|
+
id_card: string;
|
|
17
|
+
/** 手机号 */
|
|
18
|
+
phone_no: string;
|
|
19
|
+
/** 订单金额 */
|
|
20
|
+
pay: string;
|
|
21
|
+
/** 订单备注 */
|
|
22
|
+
pay_remark: string;
|
|
23
|
+
/** 回调地址 */
|
|
24
|
+
notify_url: string;
|
|
25
|
+
/** 项目标识 */
|
|
26
|
+
project_id: string;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
/** CreateBankpayOrderResponse 银行卡实时支付返回 */
|
|
30
30
|
interface CreateBankpayOrderResponse {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
31
|
+
/** 平台企业订单号 */
|
|
32
|
+
order_id: string;
|
|
33
|
+
/** 综合服务平台流水号 */
|
|
34
|
+
ref: string;
|
|
35
|
+
/** 订单金额 */
|
|
36
|
+
pay: string;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
/** CreateAlipayOrderRequest 支付宝实时支付请求 */
|
|
40
40
|
interface CreateAlipayOrderRequest {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
41
|
+
/** 平台企业订单号 */
|
|
42
|
+
order_id: string;
|
|
43
|
+
/** 平台企业 ID */
|
|
44
|
+
dealer_id: string;
|
|
45
|
+
/** 综合服务主体 ID */
|
|
46
|
+
broker_id: string;
|
|
47
|
+
/** 姓名 */
|
|
48
|
+
real_name: string;
|
|
49
|
+
/** 支付宝账户 */
|
|
50
|
+
card_no: string;
|
|
51
|
+
/** 身份证号码 */
|
|
52
|
+
id_card: string;
|
|
53
|
+
/** 手机号 */
|
|
54
|
+
phone_no: string;
|
|
55
|
+
/** 订单金额 */
|
|
56
|
+
pay: string;
|
|
57
|
+
/** 订单备注 */
|
|
58
|
+
pay_remark: string;
|
|
59
|
+
/** 回调地址 */
|
|
60
|
+
notify_url: string;
|
|
61
|
+
/** 项目标识 */
|
|
62
|
+
project_id: string;
|
|
63
|
+
/** 校验支付宝账户姓名,固定值:Check */
|
|
64
|
+
check_name: string;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
/** CreateAlipayOrderResponse 支付宝实时支付返回 */
|
|
68
68
|
interface CreateAlipayOrderResponse {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
69
|
+
/** 平台企业订单号 */
|
|
70
|
+
order_id: string;
|
|
71
|
+
/** 综合服务平台流水号 */
|
|
72
|
+
ref: string;
|
|
73
|
+
/** 订单金额 */
|
|
74
|
+
pay: string;
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
/** CreateWxpayOrderRequest 微信实时支付请求 */
|
|
78
78
|
interface CreateWxpayOrderRequest {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
79
|
+
/** 平台企业订单号 */
|
|
80
|
+
order_id: string;
|
|
81
|
+
/** 平台企业 ID */
|
|
82
|
+
dealer_id: string;
|
|
83
|
+
/** 综合服务主体 ID */
|
|
84
|
+
broker_id: string;
|
|
85
|
+
/** 姓名 */
|
|
86
|
+
real_name: string;
|
|
87
|
+
/** 微信用户 openid */
|
|
88
|
+
openid: string;
|
|
89
|
+
/** 身份证号码 */
|
|
90
|
+
id_card: string;
|
|
91
|
+
/** 手机号 */
|
|
92
|
+
phone_no: string;
|
|
93
|
+
/** 订单金额 */
|
|
94
|
+
pay: string;
|
|
95
|
+
/** 订单备注 */
|
|
96
|
+
pay_remark: string;
|
|
97
|
+
/** 回调地址 */
|
|
98
|
+
notify_url: string;
|
|
99
|
+
/** 平台企业微信 AppID */
|
|
100
|
+
wx_app_id: string;
|
|
101
|
+
/** 微信支付模式,固定值:transfer */
|
|
102
|
+
wxpay_mode: string;
|
|
103
|
+
/** 项目标识 */
|
|
104
|
+
project_id: string;
|
|
105
|
+
/** 描述信息,该字段已废弃 */
|
|
106
|
+
notes: string;
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
/** CreateWxpayOrderResponse 微信实时支付返回 */
|
|
110
110
|
interface CreateWxpayOrderResponse {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
111
|
+
/** 平台企业订单号 */
|
|
112
|
+
order_id: string;
|
|
113
|
+
/** 综合服务平台流水号,唯一 */
|
|
114
|
+
ref: string;
|
|
115
|
+
/** 订单金额 */
|
|
116
|
+
pay: string;
|
|
117
117
|
}
|
|
118
118
|
|
|
119
119
|
/** GetOrderRequest 查询单笔订单信息请求 */
|
|
120
120
|
interface GetOrderRequest {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
121
|
+
/** 平台企业订单号 */
|
|
122
|
+
order_id: string;
|
|
123
|
+
/** 支付路径名,银行卡(默认)、支付宝、微信 */
|
|
124
|
+
channel: string;
|
|
125
|
+
/** 数据类型,如果为 encryption,则对返回的 data 进行加密 */
|
|
126
|
+
data_type: string;
|
|
127
127
|
}
|
|
128
128
|
|
|
129
129
|
/** GetOrderResponse 查询单笔订单信息返回 */
|
|
130
130
|
interface GetOrderResponse {
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
131
|
+
/** 平台企业订单号 */
|
|
132
|
+
order_id: string;
|
|
133
|
+
/** 订单金额 */
|
|
134
|
+
pay: string;
|
|
135
|
+
/** 综合服务主体 ID */
|
|
136
|
+
broker_id: string;
|
|
137
|
+
/** 平台企业 ID */
|
|
138
|
+
dealer_id: string;
|
|
139
|
+
/** 姓名 */
|
|
140
|
+
real_name: string;
|
|
141
|
+
/** 收款人账号 */
|
|
142
|
+
card_no: string;
|
|
143
|
+
/** 身份证号码 */
|
|
144
|
+
id_card: string;
|
|
145
|
+
/** 手机号 */
|
|
146
|
+
phone_no: string;
|
|
147
|
+
/** 订单状态码 */
|
|
148
|
+
status: string;
|
|
149
|
+
/** 订单详细状态码 */
|
|
150
|
+
status_detail: string;
|
|
151
|
+
/** 订单状态码描述 */
|
|
152
|
+
status_message: string;
|
|
153
|
+
/** 订单详细状态码描述 */
|
|
154
|
+
status_detail_message: string;
|
|
155
|
+
/** 综合服务主体支付金额 */
|
|
156
|
+
broker_amount: string;
|
|
157
|
+
/** 综合服务平台流水号 */
|
|
158
|
+
ref: string;
|
|
159
|
+
/** 支付交易流水号 */
|
|
160
|
+
broker_bank_bill: string;
|
|
161
|
+
/** 支付路径 */
|
|
162
|
+
withdraw_platform: string;
|
|
163
|
+
/** 订单接收时间,精确到秒 */
|
|
164
|
+
created_at: string;
|
|
165
|
+
/** 订单完成时间,精确到秒 */
|
|
166
|
+
finished_time: string;
|
|
167
|
+
/** 综合服务主体加成服务费 */
|
|
168
|
+
broker_fee: string;
|
|
169
|
+
/** 余额账户支出加成服务费 */
|
|
170
|
+
broker_real_fee: string;
|
|
171
|
+
/** 抵扣账户支出加成服务费 */
|
|
172
|
+
broker_deduct_fee: string;
|
|
173
|
+
/** 订单备注 */
|
|
174
|
+
pay_remark: string;
|
|
175
|
+
/** 用户加成服务费 */
|
|
176
|
+
user_fee: string;
|
|
177
|
+
/** 银行名称 */
|
|
178
|
+
bank_name: string;
|
|
179
|
+
/** 项目标识 */
|
|
180
|
+
project_id: string;
|
|
181
|
+
/** 新就业形态劳动者 ID,该字段已废弃 */
|
|
182
|
+
anchor_id: string;
|
|
183
|
+
/** 描述信息,该字段已废弃 */
|
|
184
|
+
notes: string;
|
|
185
|
+
/** 系统支付金额,该字段已废弃 */
|
|
186
|
+
sys_amount: string;
|
|
187
|
+
/** 税费,该字段已废弃 */
|
|
188
|
+
tax: string;
|
|
189
|
+
/** 系统支付费用,该字段已废弃 */
|
|
190
|
+
sys_fee: string;
|
|
191
191
|
}
|
|
192
192
|
|
|
193
193
|
/** GetDealerVARechargeAccountRequest 查询平台企业汇款信息请求 */
|
|
194
194
|
interface GetDealerVARechargeAccountRequest {
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
195
|
+
/** 综合服务主体 ID */
|
|
196
|
+
broker_id: string;
|
|
197
|
+
/** 平台企业 ID */
|
|
198
|
+
dealer_id: string;
|
|
199
199
|
}
|
|
200
200
|
|
|
201
201
|
/** GetDealerVARechargeAccountResponse 查询平台企业汇款信息返回 */
|
|
202
202
|
interface GetDealerVARechargeAccountResponse {
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
203
|
+
/** 账户名称 */
|
|
204
|
+
acct_name: string;
|
|
205
|
+
/** 专属账户 */
|
|
206
|
+
acct_no: string;
|
|
207
|
+
/** 银行名称 */
|
|
208
|
+
bank_name: string;
|
|
209
|
+
/** 付款账户 */
|
|
210
|
+
dealer_acct_name: string;
|
|
211
211
|
}
|
|
212
212
|
|
|
213
213
|
/** CancelOrderRequest 取消待支付订单请求 */
|
|
214
214
|
interface CancelOrderRequest {
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
215
|
+
/** 平台企业 ID */
|
|
216
|
+
dealer_id: string;
|
|
217
|
+
/** 平台企业订单号 */
|
|
218
|
+
order_id: string;
|
|
219
|
+
/** 综合服务平台流水号 */
|
|
220
|
+
ref: string;
|
|
221
|
+
/** 支付路径名,银行卡(默认)、支付宝、微信 */
|
|
222
|
+
channel: string;
|
|
223
223
|
}
|
|
224
224
|
|
|
225
225
|
/** CancelOrderResponse 取消待支付订单返回 */
|
|
226
226
|
interface CancelOrderResponse {
|
|
227
|
-
|
|
227
|
+
ok: string;
|
|
228
228
|
}
|
|
229
229
|
|
|
230
230
|
/** ListAccountRequest 查询平台企业余额请求 */
|
|
231
231
|
interface ListAccountRequest {
|
|
232
|
-
|
|
233
|
-
|
|
232
|
+
/** 平台企业 ID */
|
|
233
|
+
dealer_id: string;
|
|
234
234
|
}
|
|
235
235
|
|
|
236
236
|
/** ListAccountResponse 查询平台企业余额返回 */
|
|
237
237
|
interface ListAccountResponse {
|
|
238
|
-
|
|
238
|
+
dealer_infos: AccountInfo[];
|
|
239
239
|
}
|
|
240
240
|
|
|
241
241
|
/** AccountInfo 账户信息 */
|
|
242
242
|
interface AccountInfo {
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
243
|
+
/** 综合服务主体 ID */
|
|
244
|
+
broker_id: string;
|
|
245
|
+
/** 银行卡余额 */
|
|
246
|
+
bank_card_balance: string;
|
|
247
|
+
/** 是否开通银行卡支付路径 */
|
|
248
|
+
is_bank_card: boolean;
|
|
249
|
+
/** 支付宝余额 */
|
|
250
|
+
alipay_balance: string;
|
|
251
|
+
/** 是否开通支付宝支付路径 */
|
|
252
|
+
is_alipay: boolean;
|
|
253
|
+
/** 微信余额 */
|
|
254
|
+
wxpay_balance: string;
|
|
255
|
+
/** 是否开通微信支付路径 */
|
|
256
|
+
is_wxpay: boolean;
|
|
257
|
+
/** 加成服务费返点余额 */
|
|
258
|
+
rebate_fee_balance: string;
|
|
259
|
+
/** 业务服务费余额 */
|
|
260
|
+
acct_balance: string;
|
|
261
|
+
/** 总余额 */
|
|
262
|
+
total_balance: string;
|
|
263
263
|
}
|
|
264
264
|
|
|
265
265
|
/** GetEleReceiptFileRequest 查询电子回单请求 */
|
|
266
266
|
interface GetEleReceiptFileRequest {
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
267
|
+
/** 平台企业订单号 */
|
|
268
|
+
order_id: string;
|
|
269
|
+
/** 综合服务平台流水号 */
|
|
270
|
+
ref: string;
|
|
271
271
|
}
|
|
272
272
|
|
|
273
273
|
/** GetEleReceiptFileResponse 查询电子回单返回 */
|
|
274
274
|
interface GetEleReceiptFileResponse {
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
275
|
+
/** 链接失效时间 */
|
|
276
|
+
expire_time: string;
|
|
277
|
+
/** 回单名 */
|
|
278
|
+
file_name: string;
|
|
279
|
+
/** 下载链接 */
|
|
280
|
+
url: string;
|
|
281
281
|
}
|
|
282
282
|
|
|
283
|
-
/** CreateBatchOrderRequest
|
|
283
|
+
/** CreateBatchOrderRequest 批次下单请求 */
|
|
284
284
|
interface CreateBatchOrderRequest {
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
285
|
+
/** 平台企业批次号 */
|
|
286
|
+
batch_id: string;
|
|
287
|
+
/** 平台企业 ID */
|
|
288
|
+
dealer_id: string;
|
|
289
|
+
/** 综合服务主体 ID */
|
|
290
|
+
broker_id: string;
|
|
291
|
+
/** 支付路径 */
|
|
292
|
+
channel: string;
|
|
293
|
+
/** 平台企业的微信 AppID */
|
|
294
|
+
wx_app_id: string;
|
|
295
|
+
/** 订单总金额 */
|
|
296
|
+
total_pay: string;
|
|
297
|
+
/** 总笔数 */
|
|
298
|
+
total_count: string;
|
|
299
|
+
/** 支付模式 */
|
|
300
|
+
mode: string;
|
|
301
|
+
/** 订单列表 */
|
|
302
|
+
order_list: BatchOrderInfo[];
|
|
303
303
|
}
|
|
304
304
|
|
|
305
|
-
/** BatchOrderInfo
|
|
305
|
+
/** BatchOrderInfo 批次下单订单信息 */
|
|
306
306
|
interface BatchOrderInfo {
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
307
|
+
/** 平台企业订单号 */
|
|
308
|
+
order_id: string;
|
|
309
|
+
/** 姓名 */
|
|
310
|
+
real_name: string;
|
|
311
|
+
/** 身份证号码 */
|
|
312
|
+
id_card: string;
|
|
313
|
+
/** 收款账号 */
|
|
314
|
+
card_no: string;
|
|
315
|
+
/** 微信用户 openid */
|
|
316
|
+
openid: string;
|
|
317
|
+
/** 手机号 */
|
|
318
|
+
phone_no: string;
|
|
319
|
+
/** 项目标识 */
|
|
320
|
+
project_id: string;
|
|
321
|
+
/** 订单金额 */
|
|
322
|
+
pay: string;
|
|
323
|
+
/** 订单备注 */
|
|
324
|
+
pay_remark: string;
|
|
325
|
+
/** 回调地址 */
|
|
326
|
+
notify_url: string;
|
|
327
327
|
}
|
|
328
328
|
|
|
329
|
-
/** CreateBatchOrderResponse
|
|
329
|
+
/** CreateBatchOrderResponse 批次下单返回 */
|
|
330
330
|
interface CreateBatchOrderResponse {
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
331
|
+
/** 平台企业批次号 */
|
|
332
|
+
batch_id: string;
|
|
333
|
+
/** 订单结果列表 */
|
|
334
|
+
result_list: BatchOrderResult[];
|
|
335
335
|
}
|
|
336
336
|
|
|
337
|
-
/** BatchOrderResult
|
|
337
|
+
/** BatchOrderResult 批次下单返回订单信息 */
|
|
338
338
|
interface BatchOrderResult {
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
339
|
+
/** 平台企业订单号 */
|
|
340
|
+
order_id: string;
|
|
341
|
+
/** 综合服务平台流水号 */
|
|
342
|
+
ref: string;
|
|
343
|
+
/** 订单金额 */
|
|
344
|
+
pay: string;
|
|
345
|
+
/** 下单状态 */
|
|
346
|
+
status: string;
|
|
347
|
+
/** 下单失败原因 */
|
|
348
|
+
error_reasons: BatchOrderErrorReasons[];
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
/** BatchOrderErrorReasons 下单失败原因信息 */
|
|
352
|
+
interface BatchOrderErrorReasons {
|
|
353
|
+
/** 不允许下单原因码 */
|
|
354
|
+
error_code: string;
|
|
355
|
+
/** 不允许下单原因描述 */
|
|
356
|
+
error_message: string;
|
|
345
357
|
}
|
|
346
358
|
|
|
347
359
|
/** ConfirmBatchOrderRequest 批次确认请求 */
|
|
348
360
|
interface ConfirmBatchOrderRequest {
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
361
|
+
/** 平台企业批次号 */
|
|
362
|
+
batch_id: string;
|
|
363
|
+
/** 平台企业 ID */
|
|
364
|
+
dealer_id: string;
|
|
365
|
+
/** 综合服务主体 ID */
|
|
366
|
+
broker_id: string;
|
|
367
|
+
/** 支付路径 */
|
|
368
|
+
channel: string;
|
|
357
369
|
}
|
|
358
370
|
|
|
359
371
|
/** ConfirmBatchOrderResponse 批次确认返回 */
|
|
360
372
|
interface ConfirmBatchOrderResponse {}
|
|
361
373
|
|
|
374
|
+
/** QueryBatchOrderRequest 查询批次订单信息请求 */
|
|
375
|
+
interface QueryBatchOrderRequest {
|
|
376
|
+
/** 平台企业批次号 */
|
|
377
|
+
batch_id: string;
|
|
378
|
+
/** 平台企业 ID */
|
|
379
|
+
dealer_id: string;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
/** QueryBatchOrderResponse 查询批次订单信息返回 */
|
|
383
|
+
interface QueryBatchOrderResponse {
|
|
384
|
+
/** 综合服务主体 ID */
|
|
385
|
+
broker_id: string;
|
|
386
|
+
/** 平台企业 ID */
|
|
387
|
+
dealer_id: string;
|
|
388
|
+
/** 平台企业批次号 */
|
|
389
|
+
batch_id: string;
|
|
390
|
+
/** 总笔数 */
|
|
391
|
+
total_count: string;
|
|
392
|
+
/** 订单总金额 */
|
|
393
|
+
total_pay: string;
|
|
394
|
+
/** 支付路径 */
|
|
395
|
+
channel: string;
|
|
396
|
+
/** 批次状态码 */
|
|
397
|
+
batch_status: string;
|
|
398
|
+
/** 批次状态码描述 */
|
|
399
|
+
batch_status_message: string;
|
|
400
|
+
/** 批次接收时间 */
|
|
401
|
+
batch_received_time: string;
|
|
402
|
+
/** 批次订单列表 */
|
|
403
|
+
order_list: QueryBatchOrderInfo[];
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
/** QueryBatchOrderInfo 查询批次订单信息订单详情 */
|
|
407
|
+
interface QueryBatchOrderInfo {
|
|
408
|
+
/** 平台企业订单号 */
|
|
409
|
+
order_id: string;
|
|
410
|
+
/** 订单金额 */
|
|
411
|
+
pay: string;
|
|
412
|
+
/** 综合服务主体 ID */
|
|
413
|
+
broker_id: string;
|
|
414
|
+
/** 平台企业 ID */
|
|
415
|
+
dealer_id: string;
|
|
416
|
+
/** 姓名 */
|
|
417
|
+
real_name: string;
|
|
418
|
+
/** 收款人账号 */
|
|
419
|
+
card_no: string;
|
|
420
|
+
/** 身份证号码 */
|
|
421
|
+
id_card: string;
|
|
422
|
+
/** 手机号 */
|
|
423
|
+
phone_no: string;
|
|
424
|
+
/** 订单状态码 */
|
|
425
|
+
status: string;
|
|
426
|
+
/** 订单详情状态码 */
|
|
427
|
+
status_detail: string;
|
|
428
|
+
/** 订单状态码描述 */
|
|
429
|
+
status_message: string;
|
|
430
|
+
/** 订单详情状态码描述 */
|
|
431
|
+
status_detail_message: string;
|
|
432
|
+
/** 综合服务主体支付金额 */
|
|
433
|
+
broker_amount: string;
|
|
434
|
+
/** 综合服务平台流水号 */
|
|
435
|
+
ref: string;
|
|
436
|
+
/** 支付交易流水号 */
|
|
437
|
+
broker_bank_bill: string;
|
|
438
|
+
/** 支付路径 */
|
|
439
|
+
withdraw_platform: string;
|
|
440
|
+
/** 订单接收时间 */
|
|
441
|
+
created_at: string;
|
|
442
|
+
/** 订单完成时间 */
|
|
443
|
+
finished_time: string;
|
|
444
|
+
/** 综合服务主体加成服务费 */
|
|
445
|
+
broker_fee: string;
|
|
446
|
+
/** 余额账户支出加成服务费 */
|
|
447
|
+
broker_real_fee: string;
|
|
448
|
+
/** 加成服务费抵扣金额 */
|
|
449
|
+
broker_deduct_fee: string;
|
|
450
|
+
/** 订单备注 */
|
|
451
|
+
pay_remark: string;
|
|
452
|
+
/** 用户加成服务费 */
|
|
453
|
+
user_fee: string;
|
|
454
|
+
/** 银行名称 */
|
|
455
|
+
bank_name: string;
|
|
456
|
+
/** 业务线标识 */
|
|
457
|
+
project_id: string;
|
|
458
|
+
}
|
|
459
|
+
|
|
362
460
|
/** CancelBatchOrderRequest 批次撤销请求 */
|
|
363
461
|
interface CancelBatchOrderRequest {
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
462
|
+
/** 平台企业批次号 */
|
|
463
|
+
batch_id: string;
|
|
464
|
+
/** 平台企业 ID */
|
|
465
|
+
dealer_id: string;
|
|
466
|
+
/** 综合服务主体 ID */
|
|
467
|
+
broker_id: string;
|
|
370
468
|
}
|
|
371
469
|
|
|
372
470
|
/** CancelBatchOrderResponse 批次撤销返回 */
|
|
373
471
|
interface CancelBatchOrderResponse {}
|
|
374
472
|
|
|
375
473
|
export class PaymentClient extends YZHclient {
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
474
|
+
// eslint-disable-next-line no-useless-constructor
|
|
475
|
+
constructor(conf: {
|
|
476
|
+
dealer_id: string;
|
|
477
|
+
broker_id: string;
|
|
478
|
+
app_key: string;
|
|
479
|
+
des3_key: string;
|
|
480
|
+
private_key: string;
|
|
481
|
+
yzh_public_key: string;
|
|
482
|
+
sign_type: 'rsa' | 'sha256';
|
|
483
|
+
base_url?: string;
|
|
484
|
+
timeout?: number;
|
|
485
|
+
}) {
|
|
486
|
+
super(conf);
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
// CreateBankpayOrder 银行卡实时支付
|
|
490
|
+
async CreateBankpayOrder(
|
|
491
|
+
req: CreateBankpayOrderRequest,
|
|
492
|
+
cb?: (error: null | string, rep: CreateBankpayOrderResponse) => void
|
|
493
|
+
): Promise<CreateBankpayOrderResponse> {
|
|
494
|
+
return this.request('post', '/api/payment/v1/order-bankpay', req, { encryption: false }, cb);
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
// CreateAlipayOrder 支付宝实时支付
|
|
498
|
+
async CreateAlipayOrder(
|
|
499
|
+
req: CreateAlipayOrderRequest,
|
|
500
|
+
cb?: (error: null | string, rep: CreateAlipayOrderResponse) => void
|
|
501
|
+
): Promise<CreateAlipayOrderResponse> {
|
|
502
|
+
return this.request('post', '/api/payment/v1/order-alipay', req, { encryption: false }, cb);
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
// CreateWxpayOrder 微信实时支付
|
|
506
|
+
async CreateWxpayOrder(
|
|
507
|
+
req: CreateWxpayOrderRequest,
|
|
508
|
+
cb?: (error: null | string, rep: CreateWxpayOrderResponse) => void
|
|
509
|
+
): Promise<CreateWxpayOrderResponse> {
|
|
510
|
+
return this.request('post', '/api/payment/v1/order-wxpay', req, { encryption: false }, cb);
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
// GetOrder 查询单笔订单信息
|
|
514
|
+
async GetOrder(
|
|
515
|
+
req: GetOrderRequest,
|
|
516
|
+
cb?: (error: null | string, rep: GetOrderResponse) => void
|
|
517
|
+
): Promise<GetOrderResponse> {
|
|
518
|
+
return this.request(
|
|
519
|
+
'get',
|
|
520
|
+
'/api/payment/v1/query-order',
|
|
521
|
+
req,
|
|
522
|
+
{ encryption: req?.data_type === 'encryption' },
|
|
523
|
+
cb
|
|
524
|
+
);
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
// GetDealerVARechargeAccount 查询平台企业汇款信息
|
|
528
|
+
async GetDealerVARechargeAccount(
|
|
529
|
+
req: GetDealerVARechargeAccountRequest,
|
|
530
|
+
cb?: (error: null | string, rep: GetDealerVARechargeAccountResponse) => void
|
|
531
|
+
): Promise<GetDealerVARechargeAccountResponse> {
|
|
532
|
+
return this.request('get', '/api/payment/v1/va-account', req, { encryption: false }, cb);
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
// ListAccount 查询平台企业余额
|
|
536
|
+
async ListAccount(
|
|
537
|
+
req: ListAccountRequest,
|
|
538
|
+
cb?: (error: null | string, rep: ListAccountResponse) => void
|
|
539
|
+
): Promise<ListAccountResponse> {
|
|
540
|
+
return this.request('get', '/api/payment/v1/query-accounts', req, { encryption: false }, cb);
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
// GetEleReceiptFile 查询电子回单
|
|
544
|
+
async GetEleReceiptFile(
|
|
545
|
+
req: GetEleReceiptFileRequest,
|
|
546
|
+
cb?: (error: null | string, rep: GetEleReceiptFileResponse) => void
|
|
547
|
+
): Promise<GetEleReceiptFileResponse> {
|
|
548
|
+
return this.request('get', '/api/payment/v1/receipt/file', req, { encryption: false }, cb);
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
// CancelOrder 取消待支付订单
|
|
552
|
+
async CancelOrder(
|
|
553
|
+
req: CancelOrderRequest,
|
|
554
|
+
cb?: (error: null | string, rep: CancelOrderResponse) => void
|
|
555
|
+
): Promise<CancelOrderResponse> {
|
|
556
|
+
return this.request('post', '/api/payment/v1/order/fail', req, { encryption: false }, cb);
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
// CreateBatchOrder 批次下单
|
|
560
|
+
async CreateBatchOrder(
|
|
561
|
+
req: CreateBatchOrderRequest,
|
|
562
|
+
cb?: (error: null | string, rep: CreateBatchOrderResponse) => void
|
|
563
|
+
): Promise<CreateBatchOrderResponse> {
|
|
564
|
+
return this.request('post', '/api/payment/v1/order-batch', req, { encryption: false }, cb);
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
// ConfirmBatchOrder 批次确认
|
|
568
|
+
async ConfirmBatchOrder(
|
|
569
|
+
req: ConfirmBatchOrderRequest,
|
|
570
|
+
cb?: (error: null | string, rep: ConfirmBatchOrderResponse) => void
|
|
571
|
+
): Promise<ConfirmBatchOrderResponse> {
|
|
572
|
+
return this.request('post', '/api/payment/v1/confirm-batch', req, { encryption: false }, cb);
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
// QueryBatchOrder 查询批次订单信息
|
|
576
|
+
async QueryBatchOrder(
|
|
577
|
+
req: QueryBatchOrderRequest,
|
|
578
|
+
cb?: (error: null | string, rep: QueryBatchOrderResponse) => void
|
|
579
|
+
): Promise<QueryBatchOrderResponse> {
|
|
580
|
+
return this.request('get', '/api/payment/v1/query-batch', req, { encryption: false }, cb);
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
// CancelBatchOrder 批次撤销
|
|
584
|
+
async CancelBatchOrder(
|
|
585
|
+
req: CancelBatchOrderRequest,
|
|
586
|
+
cb?: (error: null | string, rep: CancelBatchOrderResponse) => void
|
|
587
|
+
): Promise<CancelBatchOrderResponse> {
|
|
588
|
+
return this.request('post', '/api/payment/v1/cancel-batch', req, { encryption: false }, cb);
|
|
589
|
+
}
|
|
484
590
|
}
|