forked from go-pay/gopay
-
Notifications
You must be signed in to change notification settings - Fork 0
/
member_api.go
494 lines (471 loc) · 20.2 KB
/
member_api.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
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
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
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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
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
484
485
486
487
488
489
490
491
492
493
494
package alipay
import (
"encoding/json"
"errors"
"fmt"
"github.com/cedarwu/gopay"
"github.com/cedarwu/gopay/pkg/util"
)
// alipay.user.info.share(支付宝会员授权信息查询接口)
// body:此接口无需body参数
// 文档地址:https://opendocs.alipay.com/apis/api_2/alipay.user.info.share
func (a *Client) UserInfoShare(authToken string) (aliRsp *UserInfoShareResponse, err error) {
if authToken == "" {
return nil, errors.New("auth_token can not be null")
}
var bs []byte
if bs, err = a.doAliPay(nil, "alipay.user.info.share", authToken); err != nil {
return nil, err
}
aliRsp = new(UserInfoShareResponse)
if err = json.Unmarshal(bs, aliRsp); err != nil {
return nil, err
}
if aliRsp.Response != nil && aliRsp.Response.Code != "10000" {
info := aliRsp.Response
return aliRsp, fmt.Errorf(`{"code":"%s","msg":"%s","sub_code":"%s","sub_msg":"%s"}`, info.Code, info.Msg, info.SubCode, info.SubMsg)
}
signData, signDataErr := a.getSignData(bs, aliRsp.AlipayCertSn)
aliRsp.SignData = signData
return aliRsp, a.autoVerifySignByCert(aliRsp.Sign, signData, signDataErr)
}
// alipay.user.certify.open.initialize(身份认证初始化服务)
// 文档地址:https://opendocs.alipay.com/apis/api_2/alipay.user.certify.open.initialize
func (a *Client) UserCertifyOpenInit(bm gopay.BodyMap) (aliRsp *UserCertifyOpenInitResponse, err error) {
err = bm.CheckEmptyError("outer_order_no", "biz_code", "identity_param", "merchant_config")
if err != nil {
return nil, err
}
var bs []byte
if bs, err = a.doAliPay(bm, "alipay.user.certify.open.initialize"); err != nil {
return nil, err
}
aliRsp = new(UserCertifyOpenInitResponse)
if err = json.Unmarshal(bs, aliRsp); err != nil {
return nil, err
}
if aliRsp.Response != nil && aliRsp.Response.Code != "10000" {
info := aliRsp.Response
return aliRsp, fmt.Errorf(`{"code":"%s","msg":"%s","sub_code":"%s","sub_msg":"%s"}`, info.Code, info.Msg, info.SubCode, info.SubMsg)
}
signData, signDataErr := a.getSignData(bs, aliRsp.AlipayCertSn)
aliRsp.SignData = signData
return aliRsp, a.autoVerifySignByCert(aliRsp.Sign, signData, signDataErr)
}
// alipay.user.certify.open.certify(身份认证开始认证)
// API文档地址:https://opendocs.alipay.com/apis/api_2/alipay.user.certify.open.certify
// 产品文档地址:https://opendocs.alipay.com/open/20181012100420932508/quickstart
func (a *Client) UserCertifyOpenCertify(bm gopay.BodyMap) (certifyUrl string, err error) {
err = bm.CheckEmptyError("certify_id")
if err != nil {
return util.NULL, err
}
var bs []byte
if bs, err = a.doAliPay(bm, "alipay.user.certify.open.certify"); err != nil {
return util.NULL, err
}
certifyUrl = string(bs)
return certifyUrl, nil
}
// alipay.user.certify.open.query(身份认证记录查询)
// 文档地址:https://opendocs.alipay.com/apis/api_2/alipay.user.certify.open.query
func (a *Client) UserCertifyOpenQuery(bm gopay.BodyMap) (aliRsp *UserCertifyOpenQueryResponse, err error) {
err = bm.CheckEmptyError("certify_id")
if err != nil {
return nil, err
}
var bs []byte
if bs, err = a.doAliPay(bm, "alipay.user.certify.open.query"); err != nil {
return nil, err
}
aliRsp = new(UserCertifyOpenQueryResponse)
if err = json.Unmarshal(bs, aliRsp); err != nil {
return nil, err
}
if aliRsp.Response != nil && aliRsp.Response.Code != "10000" {
info := aliRsp.Response
return aliRsp, fmt.Errorf(`{"code":"%s","msg":"%s","sub_code":"%s","sub_msg":"%s"}`, info.Code, info.Msg, info.SubCode, info.SubMsg)
}
signData, signDataErr := a.getSignData(bs, aliRsp.AlipayCertSn)
aliRsp.SignData = signData
return aliRsp, a.autoVerifySignByCert(aliRsp.Sign, signData, signDataErr)
}
// alipay.user.agreement.page.sign(支付宝个人协议页面签约接口)
// 文档地址:https://opendocs.alipay.com/apis/api_2/alipay.user.agreement.page.sign
func (a *Client) UserAgreementPageSign(bm gopay.BodyMap) (aliRsp *UserAgreementPageSignRsp, err error) {
err = bm.CheckEmptyError("personal_product_code")
if err != nil {
return nil, err
}
var bs []byte
if bs, err = a.doAliPay(bm, "alipay.user.agreement.page.sign"); err != nil {
return nil, err
}
aliRsp = new(UserAgreementPageSignRsp)
if err = json.Unmarshal(bs, aliRsp); err != nil {
return nil, err
}
if aliRsp.Response != nil && aliRsp.Response.Code != "10000" {
info := aliRsp.Response
return aliRsp, fmt.Errorf(`{"code":"%s","msg":"%s","sub_code":"%s","sub_msg":"%s"}`, info.Code, info.Msg, info.SubCode, info.SubMsg)
}
signData, signDataErr := a.getSignData(bs, aliRsp.AlipayCertSn)
aliRsp.SignData = signData
return aliRsp, a.autoVerifySignByCert(aliRsp.Sign, signData, signDataErr)
}
// alipay.user.agreement.unsign(支付宝个人代扣协议解约接口)
// 文档地址:https://opendocs.alipay.com/apis/api_2/alipay.user.agreement.page.unsign
func (a *Client) UserAgreementPageUnSign(bm gopay.BodyMap) (aliRsp *UserAgreementPageUnSignRsp, err error) {
var bs []byte
if bs, err = a.doAliPay(bm, "alipay.user.agreement.unsign"); err != nil {
return nil, err
}
aliRsp = new(UserAgreementPageUnSignRsp)
if err = json.Unmarshal(bs, aliRsp); err != nil {
return nil, err
}
if aliRsp.Response != nil && aliRsp.Response.Code != "10000" {
info := aliRsp.Response
return aliRsp, fmt.Errorf(`{"code":"%s","msg":"%s","sub_code":"%s","sub_msg":"%s"}`, info.Code, info.Msg, info.SubCode, info.SubMsg)
}
signData, signDataErr := a.getSignData(bs, aliRsp.AlipayCertSn)
aliRsp.SignData = signData
return aliRsp, a.autoVerifySignByCert(aliRsp.Sign, signData, signDataErr)
}
// alipay.user.agreement.query(支付宝个人代扣协议查询接口)
// 文档地址:https://opendocs.alipay.com/apis/api_2/alipay.user.agreement.query
func (a *Client) UserAgreementQuery(bm gopay.BodyMap) (aliRsp *UserAgreementQueryRsp, err error) {
var bs []byte
if bs, err = a.doAliPay(bm, "alipay.user.agreement.query"); err != nil {
return nil, err
}
aliRsp = new(UserAgreementQueryRsp)
if err = json.Unmarshal(bs, aliRsp); err != nil {
return nil, err
}
if aliRsp.Response != nil && aliRsp.Response.Code != "10000" {
info := aliRsp.Response
return aliRsp, fmt.Errorf(`{"code":"%s","msg":"%s","sub_code":"%s","sub_msg":"%s"}`, info.Code, info.Msg, info.SubCode, info.SubMsg)
}
signData, signDataErr := a.getSignData(bs, aliRsp.AlipayCertSn)
aliRsp.SignData = signData
return aliRsp, a.autoVerifySignByCert(aliRsp.Sign, signData, signDataErr)
}
// alipay.user.agreement.executionplan.modify(周期性扣款协议执行计划修改接口)
// 文档地址:https://opendocs.alipay.com/apis/api_2/alipay.user.agreement.executionplan.modify
func (a *Client) UserAgreementExecutionplanModify(bm gopay.BodyMap) (aliRsp *UserAgreementExecutionplanModifyRsp, err error) {
err = bm.CheckEmptyError("agreement_no", "deduct_time")
if err != nil {
return nil, err
}
var bs []byte
if bs, err = a.doAliPay(bm, "alipay.user.agreement.executionplan.modify"); err != nil {
return nil, err
}
aliRsp = new(UserAgreementExecutionplanModifyRsp)
if err = json.Unmarshal(bs, aliRsp); err != nil {
return nil, err
}
if aliRsp.Response != nil && aliRsp.Response.Code != "10000" {
info := aliRsp.Response
return aliRsp, fmt.Errorf(`{"code":"%s","msg":"%s","sub_code":"%s","sub_msg":"%s"}`, info.Code, info.Msg, info.SubCode, info.SubMsg)
}
signData, signDataErr := a.getSignData(bs, aliRsp.AlipayCertSn)
aliRsp.SignData = signData
return aliRsp, a.autoVerifySignByCert(aliRsp.Sign, signData, signDataErr)
}
// alipay.user.agreement.transfer(协议由普通通用代扣协议产品转移到周期扣协议产品)
// 文档地址:https://opendocs.alipay.com/apis/api_2/alipay.user.agreement.transfer
func (a *Client) UserAgreementTransfer(bm gopay.BodyMap) (aliRsp *UserAgreementTransferRsp, err error) {
err = bm.CheckEmptyError("agreement_no", "target_product_code", "period_rule_params")
if err != nil {
return nil, err
}
var bs []byte
if bs, err = a.doAliPay(bm, "alipay.user.agreement.transfer"); err != nil {
return nil, err
}
aliRsp = new(UserAgreementTransferRsp)
if err = json.Unmarshal(bs, aliRsp); err != nil {
return nil, err
}
if aliRsp.Response != nil && aliRsp.Response.Code != "10000" {
info := aliRsp.Response
return aliRsp, fmt.Errorf(`{"code":"%s","msg":"%s","sub_code":"%s","sub_msg":"%s"}`, info.Code, info.Msg, info.SubCode, info.SubMsg)
}
signData, signDataErr := a.getSignData(bs, aliRsp.AlipayCertSn)
aliRsp.SignData = signData
return aliRsp, a.autoVerifySignByCert(aliRsp.Sign, signData, signDataErr)
}
// alipay.user.twostage.common.use(通用当面付二阶段接口)
// 文档地址:https://opendocs.alipay.com/apis/api_2/alipay.user.twostage.common.use
func (a *Client) UserTwostageCommonUse(bm gopay.BodyMap) (aliRsp *UserTwostageCommonUseRsp, err error) {
err = bm.CheckEmptyError("dynamic_id", "sence_no", "pay_pid")
if err != nil {
return nil, err
}
var bs []byte
if bs, err = a.doAliPay(bm, "alipay.user.twostage.common.use"); err != nil {
return nil, err
}
aliRsp = new(UserTwostageCommonUseRsp)
if err = json.Unmarshal(bs, aliRsp); err != nil {
return nil, err
}
if aliRsp.Response != nil && aliRsp.Response.Code != "10000" {
info := aliRsp.Response
return aliRsp, fmt.Errorf(`{"code":"%s","msg":"%s","sub_code":"%s","sub_msg":"%s"}`, info.Code, info.Msg, info.SubCode, info.SubMsg)
}
signData, signDataErr := a.getSignData(bs, aliRsp.AlipayCertSn)
aliRsp.SignData = signData
return aliRsp, a.autoVerifySignByCert(aliRsp.Sign, signData, signDataErr)
}
// alipay.user.auth.zhimaorg.identity.apply(芝麻企业征信基于身份的协议授权)
// 文档地址:https://opendocs.alipay.com/apis/api_2/alipay.user.auth.zhimaorg.identity.apply
func (a *Client) UserAuthZhimaorgIdentityApply(bm gopay.BodyMap) (aliRsp *UserAuthZhimaorgIdentityApplyRsp, err error) {
err = bm.CheckEmptyError("cert_type", "cert_no", "name")
if err != nil {
return nil, err
}
var bs []byte
if bs, err = a.doAliPay(bm, "alipay.user.auth.zhimaorg.identity.apply"); err != nil {
return nil, err
}
aliRsp = new(UserAuthZhimaorgIdentityApplyRsp)
if err = json.Unmarshal(bs, aliRsp); err != nil {
return nil, err
}
if aliRsp.Response != nil && aliRsp.Response.Code != "10000" {
info := aliRsp.Response
return aliRsp, fmt.Errorf(`{"code":"%s","msg":"%s","sub_code":"%s","sub_msg":"%s"}`, info.Code, info.Msg, info.SubCode, info.SubMsg)
}
signData, signDataErr := a.getSignData(bs, aliRsp.AlipayCertSn)
aliRsp.SignData = signData
return aliRsp, a.autoVerifySignByCert(aliRsp.Sign, signData, signDataErr)
}
// alipay.user.charity.recordexist.query(查询是否在支付宝公益捐赠的接口)
// 文档地址:https://opendocs.alipay.com/apis/api_2/alipay.user.charity.recordexist.query
func (a *Client) UserCharityRecordexistQuery(bm gopay.BodyMap) (aliRsp *UserCharityRecordexistQueryRsp, err error) {
err = bm.CheckEmptyError("partner_id", "user_id")
if err != nil {
return nil, err
}
var bs []byte
if bs, err = a.doAliPay(bm, "alipay.user.charity.recordexist.query"); err != nil {
return nil, err
}
aliRsp = new(UserCharityRecordexistQueryRsp)
if err = json.Unmarshal(bs, aliRsp); err != nil {
return nil, err
}
if aliRsp.Response != nil && aliRsp.Response.Code != "10000" {
info := aliRsp.Response
return aliRsp, fmt.Errorf(`{"code":"%s","msg":"%s","sub_code":"%s","sub_msg":"%s"}`, info.Code, info.Msg, info.SubCode, info.SubMsg)
}
signData, signDataErr := a.getSignData(bs, aliRsp.AlipayCertSn)
aliRsp.SignData = signData
return aliRsp, a.autoVerifySignByCert(aliRsp.Sign, signData, signDataErr)
}
// alipay.user.alipaypoint.send(集分宝发放接口)
// 文档地址:https://opendocs.alipay.com/apis/api_2/alipay.user.alipaypoint.send
func (a *Client) UserAlipaypointSend(bm gopay.BodyMap) (aliRsp *UserAlipaypointSendRsp, err error) {
err = bm.CheckEmptyError("budget_code", "partner_biz_no", "point_amount")
if err != nil {
return nil, err
}
var bs []byte
if bs, err = a.doAliPay(bm, "alipay.user.alipaypoint.send"); err != nil {
return nil, err
}
aliRsp = new(UserAlipaypointSendRsp)
if err = json.Unmarshal(bs, aliRsp); err != nil {
return nil, err
}
if aliRsp.Response != nil && aliRsp.Response.Code != "10000" {
info := aliRsp.Response
return aliRsp, fmt.Errorf(`{"code":"%s","msg":"%s","sub_code":"%s","sub_msg":"%s"}`, info.Code, info.Msg, info.SubCode, info.SubMsg)
}
signData, signDataErr := a.getSignData(bs, aliRsp.AlipayCertSn)
aliRsp.SignData = signData
return aliRsp, a.autoVerifySignByCert(aliRsp.Sign, signData, signDataErr)
}
// koubei.member.data.isv.create(isv 会员CRM数据回流)
// 文档地址:https://opendocs.alipay.com/apis/api_2/koubei.member.data.isv.create
func (a *Client) MemberDataIsvCreate(bm gopay.BodyMap) (aliRsp *MemberDataIsvCreateRsp, err error) {
err = bm.CheckEmptyError("member_card_id", "member_source", "member_status", "gmt_merber_card_create", "parter_id")
if err != nil {
return nil, err
}
var bs []byte
if bs, err = a.doAliPay(bm, "koubei.member.data.isv.create"); err != nil {
return nil, err
}
aliRsp = new(MemberDataIsvCreateRsp)
if err = json.Unmarshal(bs, aliRsp); err != nil {
return nil, err
}
if aliRsp.Response != nil && aliRsp.Response.Code != "10000" {
info := aliRsp.Response
return aliRsp, fmt.Errorf(`{"code":"%s","msg":"%s","sub_code":"%s","sub_msg":"%s"}`, info.Code, info.Msg, info.SubCode, info.SubMsg)
}
signData, signDataErr := a.getSignData(bs, aliRsp.AlipayCertSn)
aliRsp.SignData = signData
return aliRsp, a.autoVerifySignByCert(aliRsp.Sign, signData, signDataErr)
}
// alipay.user.family.archive.query(查询家人信息档案(选人授权)组件已选的家人档案信息)
// 文档地址:https://opendocs.alipay.com/apis/api_2/alipay.user.family.archive.query
func (a *Client) UserFamilyArchiveQuery(bm gopay.BodyMap) (aliRsp *UserFamilyArchiveQueryRsp, err error) {
err = bm.CheckEmptyError("archive_token")
if err != nil {
return nil, err
}
var bs []byte
if bs, err = a.doAliPay(bm, "alipay.user.family.archive.query"); err != nil {
return nil, err
}
aliRsp = new(UserFamilyArchiveQueryRsp)
if err = json.Unmarshal(bs, aliRsp); err != nil {
return nil, err
}
if aliRsp.Response != nil && aliRsp.Response.Code != "10000" {
info := aliRsp.Response
return aliRsp, fmt.Errorf(`{"code":"%s","msg":"%s","sub_code":"%s","sub_msg":"%s"}`, info.Code, info.Msg, info.SubCode, info.SubMsg)
}
signData, signDataErr := a.getSignData(bs, aliRsp.AlipayCertSn)
aliRsp.SignData = signData
return aliRsp, a.autoVerifySignByCert(aliRsp.Sign, signData, signDataErr)
}
// alipay.user.family.archive.initialize(初始化家人信息档案(选人授权)组件)
// 文档地址:https://opendocs.alipay.com/apis/api_2/alipay.user.family.archive.initialize
func (a *Client) UserFamilyArchiveInitialize(bm gopay.BodyMap) (aliRsp *UserFamilyArchiveInitializeRsp, err error) {
err = bm.CheckEmptyError("out_biz_no", "template_id", "redirect_uri")
if err != nil {
return nil, err
}
var bs []byte
if bs, err = a.doAliPay(bm, "alipay.user.family.archive.initialize"); err != nil {
return nil, err
}
aliRsp = new(UserFamilyArchiveInitializeRsp)
if err = json.Unmarshal(bs, aliRsp); err != nil {
return nil, err
}
if aliRsp.Response != nil && aliRsp.Response.Code != "10000" {
info := aliRsp.Response
return aliRsp, fmt.Errorf(`{"code":"%s","msg":"%s","sub_code":"%s","sub_msg":"%s"}`, info.Code, info.Msg, info.SubCode, info.SubMsg)
}
signData, signDataErr := a.getSignData(bs, aliRsp.AlipayCertSn)
aliRsp.SignData = signData
return aliRsp, a.autoVerifySignByCert(aliRsp.Sign, signData, signDataErr)
}
// alipay.user.certdoc.certverify.preconsult(实名证件信息比对验证预咨询)
// 文档地址:https://opendocs.alipay.com/apis/api_2/alipay.user.certdoc.certverify.preconsult
func (a *Client) UserCertdocCertverifyPreconsult(bm gopay.BodyMap) (aliRsp *UserCertdocCertverifyPreconsultRsp, err error) {
err = bm.CheckEmptyError("user_name", "cert_type", "cert_no")
if err != nil {
return nil, err
}
var bs []byte
if bs, err = a.doAliPay(bm, "alipay.user.certdoc.certverify.preconsult"); err != nil {
return nil, err
}
aliRsp = new(UserCertdocCertverifyPreconsultRsp)
if err = json.Unmarshal(bs, aliRsp); err != nil {
return nil, err
}
if aliRsp.Response != nil && aliRsp.Response.Code != "10000" {
info := aliRsp.Response
return aliRsp, fmt.Errorf(`{"code":"%s","msg":"%s","sub_code":"%s","sub_msg":"%s"}`, info.Code, info.Msg, info.SubCode, info.SubMsg)
}
signData, signDataErr := a.getSignData(bs, aliRsp.AlipayCertSn)
aliRsp.SignData = signData
return aliRsp, a.autoVerifySignByCert(aliRsp.Sign, signData, signDataErr)
}
// alipay.user.certdoc.certverify.consult(实名证件信息比对验证咨询)
// 文档地址:https://opendocs.alipay.com/apis/api_2/alipay.user.certdoc.certverify.consult
func (a *Client) UserCertdocCertverifyConsult(bm gopay.BodyMap) (aliRsp *UserCertdocCertverifyConsultRsp, err error) {
var bs []byte
if bs, err = a.doAliPay(bm, "alipay.user.certdoc.certverify.consult"); err != nil {
return nil, err
}
aliRsp = new(UserCertdocCertverifyConsultRsp)
if err = json.Unmarshal(bs, aliRsp); err != nil {
return nil, err
}
if aliRsp.Response != nil && aliRsp.Response.Code != "10000" {
info := aliRsp.Response
return aliRsp, fmt.Errorf(`{"code":"%s","msg":"%s","sub_code":"%s","sub_msg":"%s"}`, info.Code, info.Msg, info.SubCode, info.SubMsg)
}
signData, signDataErr := a.getSignData(bs, aliRsp.AlipayCertSn)
aliRsp.SignData = signData
return aliRsp, a.autoVerifySignByCert(aliRsp.Sign, signData, signDataErr)
}
// alipay.user.family.share.zmgo.initialize(初始化家庭芝麻GO共享组件)
// 文档地址:https://opendocs.alipay.com/apis/01n4yx
func (a *Client) UserFamilyShareZmgoInitialize(bm gopay.BodyMap) (aliRsp *UserFamilyShareZmgoInitializeRsp, err error) {
err = bm.CheckEmptyError("user_id", "scene_id", "template_id", "out_request_no")
if err != nil {
return nil, err
}
var bs []byte
if bs, err = a.doAliPay(bm, "alipay.user.family.share.zmgo.initialize"); err != nil {
return nil, err
}
aliRsp = new(UserFamilyShareZmgoInitializeRsp)
if err = json.Unmarshal(bs, aliRsp); err != nil {
return nil, err
}
if aliRsp.Response != nil && aliRsp.Response.Code != "10000" {
info := aliRsp.Response
return aliRsp, fmt.Errorf(`{"code":"%s","msg":"%s","sub_code":"%s","sub_msg":"%s"}`, info.Code, info.Msg, info.SubCode, info.SubMsg)
}
signData, signDataErr := a.getSignData(bs, aliRsp.AlipayCertSn)
aliRsp.SignData = signData
return aliRsp, a.autoVerifySignByCert(aliRsp.Sign, signData, signDataErr)
}
// alipay.user.dtbank.qrcodedata.query(数字分行银行码明细数据查询)
// 文档地址:https://opendocs.alipay.com/apis/01ozks
func (a *Client) UserDtbankQrcodedataQuery(bm gopay.BodyMap) (aliRsp *UserDtbankQrcodedataQueryRsp, err error) {
err = bm.CheckEmptyError("data_date", "qrcode_id", "qrcode_out_id")
if err != nil {
return nil, err
}
var bs []byte
if bs, err = a.doAliPay(bm, "alipay.user.dtbank.qrcodedata.query"); err != nil {
return nil, err
}
aliRsp = new(UserDtbankQrcodedataQueryRsp)
if err = json.Unmarshal(bs, aliRsp); err != nil {
return nil, err
}
if aliRsp.Response != nil && aliRsp.Response.Code != "10000" {
info := aliRsp.Response
return aliRsp, fmt.Errorf(`{"code":"%s","msg":"%s","sub_code":"%s","sub_msg":"%s"}`, info.Code, info.Msg, info.SubCode, info.SubMsg)
}
signData, signDataErr := a.getSignData(bs, aliRsp.AlipayCertSn)
aliRsp.SignData = signData
return aliRsp, a.autoVerifySignByCert(aliRsp.Sign, signData, signDataErr)
}
// alipay.user.alipaypoint.budgetlib.query(查询集分宝预算库详情)
// 文档地址:https://opendocs.alipay.com/apis/01zrby
func (a *Client) UserAlipaypointBudgetlibQuery(bm gopay.BodyMap) (aliRsp *UserAlipaypointBudgetlibQueryRsp, err error) {
err = bm.CheckEmptyError("budget_code")
if err != nil {
return nil, err
}
var bs []byte
if bs, err = a.doAliPay(bm, "alipay.user.alipaypoint.budgetlib.query"); err != nil {
return nil, err
}
aliRsp = new(UserAlipaypointBudgetlibQueryRsp)
if err = json.Unmarshal(bs, aliRsp); err != nil {
return nil, err
}
if aliRsp.Response != nil && aliRsp.Response.Code != "10000" {
info := aliRsp.Response
return aliRsp, fmt.Errorf(`{"code":"%s","msg":"%s","sub_code":"%s","sub_msg":"%s"}`, info.Code, info.Msg, info.SubCode, info.SubMsg)
}
signData, signDataErr := a.getSignData(bs, aliRsp.AlipayCertSn)
aliRsp.SignData = signData
return aliRsp, a.autoVerifySignByCert(aliRsp.Sign, signData, signDataErr)
}