@yunzhanghu/sdk-nodejs 1.0.2 → 1.0.4
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/.editorconfig +8 -0
- package/.eslintrc.js +16 -0
- package/.prettierrc.js +3 -0
- package/README.md +23 -6
- package/example/apiUserSign.js +66 -12
- package/example/authentication.js +136 -25
- package/example/bizlicXjjH5.js +33 -7
- package/example/bizlicXjjH5Api.js +50 -10
- package/example/conf/config.js +2 -0
- package/example/dataService.js +105 -8
- package/example/h5UserSign.js +65 -10
- package/example/invoice.js +111 -14
- package/example/notify.js +0 -1
- package/example/payment.js +208 -26
- package/example/tax.js +31 -3
- package/example/uploadusersign.js +66 -0
- package/package.json +50 -45
- package/src/common/client.ts +364 -355
- package/src/common/exception/yzhSDKHttpException.ts +29 -26
- package/src/common/http/index.ts +62 -53
- package/src/common/utils/index.ts +16 -14
- package/src/index.ts +1 -1
- package/src/services/apiusersign/index.ts +107 -105
- package/src/services/authentication/index.ts +162 -196
- package/src/services/bizlicxjjh5/index.ts +77 -107
- package/src/services/bizlicxjjh5api/index.ts +108 -156
- package/src/services/dataservice/index.ts +246 -268
- package/src/services/h5usersign/index.ts +93 -105
- package/src/services/index.ts +11 -10
- package/src/services/invoice/index.ts +184 -244
- package/src/services/payment/index.ts +501 -435
- package/src/services/tax/index.ts +53 -51
- package/src/services/uploadusersign/index.ts +88 -0
- package/src/typings.d.ts +1 -1
- package/tdsformat.js +22 -0
- package/tsconfig.json +2 -1
- package/yzh/common/client.d.ts +3 -0
- package/yzh/common/client.js +9 -3
- package/yzh/common/http/index.d.ts +1 -0
- package/yzh/common/http/index.js +18 -8
- package/yzh/common/utils/index.d.ts +1 -0
- package/yzh/common/utils/index.js +1 -0
- package/yzh/services/apiusersign/index.d.ts +34 -7
- package/yzh/services/apiusersign/index.js +9 -8
- package/yzh/services/authentication/index.d.ts +57 -19
- package/yzh/services/authentication/index.js +12 -11
- package/yzh/services/bizlicxjjh5/index.d.ts +16 -4
- package/yzh/services/bizlicxjjh5/index.js +6 -5
- package/yzh/services/bizlicxjjh5api/index.d.ts +22 -5
- package/yzh/services/bizlicxjjh5api/index.js +7 -6
- package/yzh/services/dataservice/index.d.ts +52 -11
- package/yzh/services/dataservice/index.js +23 -10
- package/yzh/services/h5usersign/index.d.ts +28 -6
- package/yzh/services/h5usersign/index.js +8 -7
- package/yzh/services/index.d.ts +3 -2
- package/yzh/services/index.js +7 -5
- package/yzh/services/invoice/index.d.ts +51 -12
- package/yzh/services/invoice/index.js +11 -10
- package/yzh/services/payment/index.d.ts +194 -18
- package/yzh/services/payment/index.js +28 -13
- package/yzh/services/tax/index.d.ts +17 -4
- package/yzh/services/tax/index.js +6 -5
- package/yzh/services/uploadusersign/index.d.ts +78 -0
- package/yzh/services/uploadusersign/index.js +19 -0
- package/.eslintrc.json +0 -19
- package/prettier.config.js +0 -32
|
@@ -1,524 +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
|
-
|
|
31
|
+
/** 平台企业订单号 */
|
|
32
|
+
order_id: string;
|
|
33
|
+
/** 综合服务平台流水号 */
|
|
34
|
+
ref: string;
|
|
35
|
+
/** 订单金额 */
|
|
36
|
+
pay: string;
|
|
36
37
|
}
|
|
37
38
|
|
|
38
39
|
/** CreateAlipayOrderRequest 支付宝实时支付请求 */
|
|
39
40
|
interface CreateAlipayOrderRequest {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
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;
|
|
64
65
|
}
|
|
65
66
|
|
|
66
67
|
/** CreateAlipayOrderResponse 支付宝实时支付返回 */
|
|
67
68
|
interface CreateAlipayOrderResponse {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
69
|
+
/** 平台企业订单号 */
|
|
70
|
+
order_id: string;
|
|
71
|
+
/** 综合服务平台流水号 */
|
|
72
|
+
ref: string;
|
|
73
|
+
/** 订单金额 */
|
|
74
|
+
pay: string;
|
|
74
75
|
}
|
|
75
76
|
|
|
76
77
|
/** CreateWxpayOrderRequest 微信实时支付请求 */
|
|
77
78
|
interface CreateWxpayOrderRequest {
|
|
78
|
-
|
|
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
|
-
|
|
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;
|
|
106
107
|
}
|
|
107
108
|
|
|
108
109
|
/** CreateWxpayOrderResponse 微信实时支付返回 */
|
|
109
110
|
interface CreateWxpayOrderResponse {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
111
|
+
/** 平台企业订单号 */
|
|
112
|
+
order_id: string;
|
|
113
|
+
/** 综合服务平台流水号,唯一 */
|
|
114
|
+
ref: string;
|
|
115
|
+
/** 订单金额 */
|
|
116
|
+
pay: string;
|
|
116
117
|
}
|
|
117
118
|
|
|
118
119
|
/** GetOrderRequest 查询单笔订单信息请求 */
|
|
119
120
|
interface GetOrderRequest {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
121
|
+
/** 平台企业订单号 */
|
|
122
|
+
order_id: string;
|
|
123
|
+
/** 支付路径名,银行卡(默认)、支付宝、微信 */
|
|
124
|
+
channel: string;
|
|
125
|
+
/** 数据类型,如果为 encryption,则对返回的 data 进行加密 */
|
|
126
|
+
data_type: string;
|
|
126
127
|
}
|
|
127
128
|
|
|
128
129
|
/** GetOrderResponse 查询单笔订单信息返回 */
|
|
129
130
|
interface GetOrderResponse {
|
|
130
|
-
|
|
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
|
-
|
|
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;
|
|
190
191
|
}
|
|
191
192
|
|
|
192
193
|
/** GetDealerVARechargeAccountRequest 查询平台企业汇款信息请求 */
|
|
193
194
|
interface GetDealerVARechargeAccountRequest {
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
195
|
+
/** 综合服务主体 ID */
|
|
196
|
+
broker_id: string;
|
|
197
|
+
/** 平台企业 ID */
|
|
198
|
+
dealer_id: string;
|
|
198
199
|
}
|
|
199
200
|
|
|
200
201
|
/** GetDealerVARechargeAccountResponse 查询平台企业汇款信息返回 */
|
|
201
202
|
interface GetDealerVARechargeAccountResponse {
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
203
|
+
/** 账户名称 */
|
|
204
|
+
acct_name: string;
|
|
205
|
+
/** 专属账户 */
|
|
206
|
+
acct_no: string;
|
|
207
|
+
/** 银行名称 */
|
|
208
|
+
bank_name: string;
|
|
209
|
+
/** 付款账户 */
|
|
210
|
+
dealer_acct_name: string;
|
|
210
211
|
}
|
|
211
212
|
|
|
212
213
|
/** CancelOrderRequest 取消待支付订单请求 */
|
|
213
214
|
interface CancelOrderRequest {
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
215
|
+
/** 平台企业 ID */
|
|
216
|
+
dealer_id: string;
|
|
217
|
+
/** 平台企业订单号 */
|
|
218
|
+
order_id: string;
|
|
219
|
+
/** 综合服务平台流水号 */
|
|
220
|
+
ref: string;
|
|
221
|
+
/** 支付路径名,银行卡(默认)、支付宝、微信 */
|
|
222
|
+
channel: string;
|
|
222
223
|
}
|
|
223
224
|
|
|
224
225
|
/** CancelOrderResponse 取消待支付订单返回 */
|
|
225
226
|
interface CancelOrderResponse {
|
|
226
|
-
|
|
227
|
+
ok: string;
|
|
227
228
|
}
|
|
228
229
|
|
|
229
230
|
/** ListAccountRequest 查询平台企业余额请求 */
|
|
230
231
|
interface ListAccountRequest {
|
|
231
|
-
|
|
232
|
-
|
|
232
|
+
/** 平台企业 ID */
|
|
233
|
+
dealer_id: string;
|
|
233
234
|
}
|
|
234
235
|
|
|
235
236
|
/** ListAccountResponse 查询平台企业余额返回 */
|
|
236
237
|
interface ListAccountResponse {
|
|
237
|
-
|
|
238
|
+
dealer_infos: AccountInfo[];
|
|
238
239
|
}
|
|
239
240
|
|
|
240
241
|
/** AccountInfo 账户信息 */
|
|
241
242
|
interface AccountInfo {
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
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;
|
|
262
263
|
}
|
|
263
264
|
|
|
264
265
|
/** GetEleReceiptFileRequest 查询电子回单请求 */
|
|
265
266
|
interface GetEleReceiptFileRequest {
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
267
|
+
/** 平台企业订单号 */
|
|
268
|
+
order_id: string;
|
|
269
|
+
/** 综合服务平台流水号 */
|
|
270
|
+
ref: string;
|
|
270
271
|
}
|
|
271
272
|
|
|
272
273
|
/** GetEleReceiptFileResponse 查询电子回单返回 */
|
|
273
274
|
interface GetEleReceiptFileResponse {
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
275
|
+
/** 链接失效时间 */
|
|
276
|
+
expire_time: string;
|
|
277
|
+
/** 回单名 */
|
|
278
|
+
file_name: string;
|
|
279
|
+
/** 下载链接 */
|
|
280
|
+
url: string;
|
|
280
281
|
}
|
|
281
282
|
|
|
282
|
-
/**
|
|
283
|
-
interface NotifyOrderRequest {
|
|
284
|
-
/** 通知 ID */
|
|
285
|
-
notify_id: string
|
|
286
|
-
/** 通知时间 */
|
|
287
|
-
notify_time: string
|
|
288
|
-
/** 返回数据 */
|
|
289
|
-
data: NotifyOrderData
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
/** NotifyOrderData 订单支付状态回调通知数据 */
|
|
293
|
-
interface NotifyOrderData {
|
|
294
|
-
/** 平台企业订单号 */
|
|
295
|
-
order_id: string
|
|
296
|
-
/** 订单金额 */
|
|
297
|
-
pay: string
|
|
298
|
-
/** 综合服务主体 ID */
|
|
299
|
-
broker_id: string
|
|
300
|
-
/** 平台企业 ID */
|
|
301
|
-
dealer_id: string
|
|
302
|
-
/** 姓名 */
|
|
303
|
-
real_name: string
|
|
304
|
-
/** 收款人账号 */
|
|
305
|
-
card_no: string
|
|
306
|
-
/** 身份证号码 */
|
|
307
|
-
id_card: string
|
|
308
|
-
/** 手机号 */
|
|
309
|
-
phone_no: string
|
|
310
|
-
/** 订单状态码 */
|
|
311
|
-
status: string
|
|
312
|
-
/** 订单详细状态码 */
|
|
313
|
-
status_detail: string
|
|
314
|
-
/** 订单状态码描述 */
|
|
315
|
-
status_message: string
|
|
316
|
-
/** 订单详细状态码描述 */
|
|
317
|
-
status_detail_message: string
|
|
318
|
-
/** 综合服务主体支付金额 */
|
|
319
|
-
broker_amount: string
|
|
320
|
-
/** 综合服务平台流水号 */
|
|
321
|
-
ref: string
|
|
322
|
-
/** 支付交易流水号 */
|
|
323
|
-
broker_bank_bill: string
|
|
324
|
-
/** 支付路径 */
|
|
325
|
-
withdraw_platform: string
|
|
326
|
-
/** 订单接收时间,精确到秒 */
|
|
327
|
-
created_at: string
|
|
328
|
-
/** 订单完成时间,精确到秒 */
|
|
329
|
-
finished_time: string
|
|
330
|
-
/** 综合服务主体加成服务费 */
|
|
331
|
-
broker_fee: string
|
|
332
|
-
/** 余额账户支出加成服务费 */
|
|
333
|
-
broker_real_fee: string
|
|
334
|
-
/** 抵扣账户支出加成服务费 */
|
|
335
|
-
broker_deduct_fee: string
|
|
336
|
-
/** 订单备注 */
|
|
337
|
-
pay_remark: string
|
|
338
|
-
/** 用户加成服务费 */
|
|
339
|
-
user_fee: string
|
|
340
|
-
/** 银行名称 */
|
|
341
|
-
bank_name: string
|
|
342
|
-
/** 项目标识 */
|
|
343
|
-
project_id: string
|
|
344
|
-
/** 平台企业用户 ID */
|
|
345
|
-
user_id: string
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
/** CreateBatchOrderRequest 批量下单请求 */
|
|
283
|
+
/** CreateBatchOrderRequest 批次下单请求 */
|
|
349
284
|
interface CreateBatchOrderRequest {
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
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[];
|
|
366
303
|
}
|
|
367
304
|
|
|
368
|
-
/** BatchOrderInfo
|
|
305
|
+
/** BatchOrderInfo 批次下单订单信息 */
|
|
369
306
|
interface BatchOrderInfo {
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
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;
|
|
390
327
|
}
|
|
391
328
|
|
|
392
|
-
/** CreateBatchOrderResponse
|
|
329
|
+
/** CreateBatchOrderResponse 批次下单返回 */
|
|
393
330
|
interface CreateBatchOrderResponse {
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
331
|
+
/** 平台企业批次号 */
|
|
332
|
+
batch_id: string;
|
|
333
|
+
/** 订单结果列表 */
|
|
334
|
+
result_list: BatchOrderResult[];
|
|
398
335
|
}
|
|
399
336
|
|
|
400
|
-
/** BatchOrderResult
|
|
337
|
+
/** BatchOrderResult 批次下单返回订单信息 */
|
|
401
338
|
interface BatchOrderResult {
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
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;
|
|
408
357
|
}
|
|
409
358
|
|
|
410
359
|
/** ConfirmBatchOrderRequest 批次确认请求 */
|
|
411
360
|
interface ConfirmBatchOrderRequest {
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
361
|
+
/** 平台企业批次号 */
|
|
362
|
+
batch_id: string;
|
|
363
|
+
/** 平台企业 ID */
|
|
364
|
+
dealer_id: string;
|
|
365
|
+
/** 综合服务主体 ID */
|
|
366
|
+
broker_id: string;
|
|
367
|
+
/** 支付路径 */
|
|
368
|
+
channel: string;
|
|
420
369
|
}
|
|
421
370
|
|
|
422
|
-
/** ConfirmBatchOrderResponse
|
|
371
|
+
/** ConfirmBatchOrderResponse 批次确认返回 */
|
|
423
372
|
interface ConfirmBatchOrderResponse {}
|
|
424
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
|
+
|
|
460
|
+
/** CancelBatchOrderRequest 批次撤销请求 */
|
|
461
|
+
interface CancelBatchOrderRequest {
|
|
462
|
+
/** 平台企业批次号 */
|
|
463
|
+
batch_id: string;
|
|
464
|
+
/** 平台企业 ID */
|
|
465
|
+
dealer_id: string;
|
|
466
|
+
/** 综合服务主体 ID */
|
|
467
|
+
broker_id: string;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
/** CancelBatchOrderResponse 批次撤销返回 */
|
|
471
|
+
interface CancelBatchOrderResponse {}
|
|
472
|
+
|
|
425
473
|
export class PaymentClient extends YZHclient {
|
|
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
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
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
|
+
}
|
|
524
590
|
}
|