-
Notifications
You must be signed in to change notification settings - Fork 149
/
models.go
1622 lines (1329 loc) · 50.5 KB
/
models.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
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
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Copyright 2021 Tencent Inc. All rights reserved.
//
// 服务商批量转账API
//
// No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
//
// API version: 0.0.2
// Code generated by WechatPay APIv3 Generator based on [OpenAPI Generator](https://openapi-generator.tech); DO NOT EDIT.
package partnertransferbatch
import (
"encoding/json"
"fmt"
"time"
)
// AuthType * `INFORMATION_AUTHORIZATION_TYPE` - 特约商户信息授权类型, 表示使用特约商户用户信息,出款方服务商 * `FUND_AUTHORIZATION_TYPE` - 特约商户资金授权类型, 表示使用特约商户的资金,出款方为特约商户,用户信息为服务商appid对应的openid * `INFORMATION_AND_FUND_AUTHORIZATION_TYPE` - 特约商户信息和资金授权类型, 表示使用特约商户的用户信息且出款方为特约商户
type AuthType string
func (e AuthType) Ptr() *AuthType {
return &e
}
// Enums of AuthType
const (
AUTHTYPE_INFORMATION_AUTHORIZATION_TYPE AuthType = "INFORMATION_AUTHORIZATION_TYPE"
AUTHTYPE_FUND_AUTHORIZATION_TYPE AuthType = "FUND_AUTHORIZATION_TYPE"
AUTHTYPE_INFORMATION_AND_FUND_AUTHORIZATION_TYPE AuthType = "INFORMATION_AND_FUND_AUTHORIZATION_TYPE"
)
// CloseReasonType * `MERCHANT_REVOCATION` - 商户主动撤销, 商户主动撤销(页面方式) * `OVERDUE_CLOSE` - 系统超时关闭, 系统超时关闭,可能原因账户余额不足或其他错误
type CloseReasonType string
func (e CloseReasonType) Ptr() *CloseReasonType {
return &e
}
// Enums of CloseReasonType
const (
CLOSEREASONTYPE_MERCHANT_REVOCATION CloseReasonType = "MERCHANT_REVOCATION"
CLOSEREASONTYPE_OVERDUE_CLOSE CloseReasonType = "OVERDUE_CLOSE"
)
// FailReasonType * `ACCOUNT_FROZEN` - 账户冻结, 该用户账户被冻结 * `REAL_NAME_CHECK_FAIL` - 用户未实名, 收款人未实名认证,需要用户完成微信实名认证 * `NAME_NOT_CORRECT` - 用户姓名校验失败, 收款人姓名校验不通过,请核实信息 * `OPENID_INVALID` - Openid校验失败, Openid格式错误或者不属于商家公众账号 * `TRANSFER_QUOTA_EXCEED` - 超过用户单笔收款额度, 超过用户单笔收款额度,核实产品设置是否准确 * `DAY_RECEIVED_QUOTA_EXCEED` - 超过用户单日收款额度, 超过用户单日收款额度,核实产品设置是否准确 * `MONTH_RECEIVED_QUOTA_EXCEED` - 超过用户单月收款额度, 超过用户单月收款额度,核实产品设置是否准确 * `DAY_RECEIVED_COUNT_EXCEED` - 超过用户单日收款次数, 超过用户单日收款次数,核实产品设置是否准确 * `PRODUCT_AUTH_CHECK_FAIL` - 产品权限校验失败, 未开通该权限或权限被冻结,请核实产品权限状态 * `OVERDUE_CLOSE` - 转账关闭, 超过系统重试期,系统自动关闭 * `ID_CARD_NOT_CORRECT` - 用户身份证校验失败, 收款人身份证校验不通过,请核实信息 * `ACCOUNT_NOT_EXIST` - 用户账户不存在, 该用户账户不存在 * `TRANSFER_RISK` - 转账存在风险, 该笔转账可能存在风险,已被微信拦截 * `PAY_ROLL_CARD_ALREADY_LOGOUT` - 用户薪工卡已注销, 该用户的薪工卡已经注销 * `PAY_ROLL_CARD_ALREADY_FROZEN` - 用户薪工卡已冻结, 该用户的薪工卡已经被冻结 * `PAY_ROLL_CARD_UNAUTHORIZED` - 用户薪工卡未授权该商户, 该用户的薪工卡未授权该商户 * `PAY_ROLL_CARD_USER_NOT_OPEN` - 用户未开通薪工卡, 该用户没有开通薪工卡
type FailReasonType string
func (e FailReasonType) Ptr() *FailReasonType {
return &e
}
// Enums of FailReasonType
const (
FAILREASONTYPE_ACCOUNT_FROZEN FailReasonType = "ACCOUNT_FROZEN"
FAILREASONTYPE_REAL_NAME_CHECK_FAIL FailReasonType = "REAL_NAME_CHECK_FAIL"
FAILREASONTYPE_NAME_NOT_CORRECT FailReasonType = "NAME_NOT_CORRECT"
FAILREASONTYPE_OPENID_INVALID FailReasonType = "OPENID_INVALID"
FAILREASONTYPE_TRANSFER_QUOTA_EXCEED FailReasonType = "TRANSFER_QUOTA_EXCEED"
FAILREASONTYPE_DAY_RECEIVED_QUOTA_EXCEED FailReasonType = "DAY_RECEIVED_QUOTA_EXCEED"
FAILREASONTYPE_MONTH_RECEIVED_QUOTA_EXCEED FailReasonType = "MONTH_RECEIVED_QUOTA_EXCEED"
FAILREASONTYPE_DAY_RECEIVED_COUNT_EXCEED FailReasonType = "DAY_RECEIVED_COUNT_EXCEED"
FAILREASONTYPE_PRODUCT_AUTH_CHECK_FAIL FailReasonType = "PRODUCT_AUTH_CHECK_FAIL"
FAILREASONTYPE_OVERDUE_CLOSE FailReasonType = "OVERDUE_CLOSE"
FAILREASONTYPE_ID_CARD_NOT_CORRECT FailReasonType = "ID_CARD_NOT_CORRECT"
FAILREASONTYPE_ACCOUNT_NOT_EXIST FailReasonType = "ACCOUNT_NOT_EXIST"
FAILREASONTYPE_TRANSFER_RISK FailReasonType = "TRANSFER_RISK"
FAILREASONTYPE_PAY_ROLL_CARD_ALREADY_LOGOUT FailReasonType = "PAY_ROLL_CARD_ALREADY_LOGOUT"
FAILREASONTYPE_PAY_ROLL_CARD_ALREADY_FROZEN FailReasonType = "PAY_ROLL_CARD_ALREADY_FROZEN"
FAILREASONTYPE_PAY_ROLL_CARD_UNAUTHORIZED FailReasonType = "PAY_ROLL_CARD_UNAUTHORIZED"
FAILREASONTYPE_PAY_ROLL_CARD_USER_NOT_OPEN FailReasonType = "PAY_ROLL_CARD_USER_NOT_OPEN"
)
// GetTransferBatchByNoRequest
type GetTransferBatchByNoRequest struct {
// 微信支付批次单号,微信商家转账系统返回的唯一标识
BatchId *string `json:"batch_id"`
// true-是;false-否,默认否。商户可选择是否查询指定状态的转账明细单,当转账批次单状态为“FINISHED”(已完成)时,才会返回满足条件的转账明细单
NeedQueryDetail *bool `json:"need_query_detail"`
// 该次请求资源的起始位置。返回的明细是按照设置的明细条数进行分页展示的,一次查询可能无法返回所有明细,我们使用该参数标识查询开始位置,默认值为0
Offset *int64 `json:"offset,omitempty"`
// 该次请求可返回的最大明细条数,最小20条,最大100条,不传则默认20条。不足20条按实际条数返回
Limit *int64 `json:"limit,omitempty"`
// 查询指定状态的转账明细单 ALL:全部。需要同时查询转账成功和转账失败的明细单 SUCCESS:转账成功。只查询转账成功的明细单 FAIL:转账失败。只查询转账失败的明细单
DetailStatus *string `json:"detail_status,omitempty"`
}
func (o GetTransferBatchByNoRequest) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.BatchId == nil {
return nil, fmt.Errorf("field `BatchId` is required and must be specified in GetTransferBatchByNoRequest")
}
toSerialize["batch_id"] = o.BatchId
if o.NeedQueryDetail == nil {
return nil, fmt.Errorf("field `NeedQueryDetail` is required and must be specified in GetTransferBatchByNoRequest")
}
toSerialize["need_query_detail"] = o.NeedQueryDetail
if o.Offset != nil {
toSerialize["offset"] = o.Offset
}
if o.Limit != nil {
toSerialize["limit"] = o.Limit
}
if o.DetailStatus != nil {
toSerialize["detail_status"] = o.DetailStatus
}
return json.Marshal(toSerialize)
}
func (o GetTransferBatchByNoRequest) String() string {
var ret string
if o.BatchId == nil {
ret += "BatchId:<nil>, "
} else {
ret += fmt.Sprintf("BatchId:%v, ", *o.BatchId)
}
if o.NeedQueryDetail == nil {
ret += "NeedQueryDetail:<nil>, "
} else {
ret += fmt.Sprintf("NeedQueryDetail:%v, ", *o.NeedQueryDetail)
}
if o.Offset == nil {
ret += "Offset:<nil>, "
} else {
ret += fmt.Sprintf("Offset:%v, ", *o.Offset)
}
if o.Limit == nil {
ret += "Limit:<nil>, "
} else {
ret += fmt.Sprintf("Limit:%v, ", *o.Limit)
}
if o.DetailStatus == nil {
ret += "DetailStatus:<nil>"
} else {
ret += fmt.Sprintf("DetailStatus:%v", *o.DetailStatus)
}
return fmt.Sprintf("GetTransferBatchByNoRequest{%s}", ret)
}
func (o GetTransferBatchByNoRequest) Clone() *GetTransferBatchByNoRequest {
ret := GetTransferBatchByNoRequest{}
if o.BatchId != nil {
ret.BatchId = new(string)
*ret.BatchId = *o.BatchId
}
if o.NeedQueryDetail != nil {
ret.NeedQueryDetail = new(bool)
*ret.NeedQueryDetail = *o.NeedQueryDetail
}
if o.Offset != nil {
ret.Offset = new(int64)
*ret.Offset = *o.Offset
}
if o.Limit != nil {
ret.Limit = new(int64)
*ret.Limit = *o.Limit
}
if o.DetailStatus != nil {
ret.DetailStatus = new(string)
*ret.DetailStatus = *o.DetailStatus
}
return &ret
}
// GetTransferBatchByOutNoRequest
type GetTransferBatchByOutNoRequest struct {
// 商户系统内部的商家批次单号,在商户系统内部唯一
OutBatchNo *string `json:"out_batch_no"`
// true-是;false-否,默认否。商户可选择是否查询指定状态的转账明细单,当转账批次单状态为“FINISHED”(已完成)时,才会返回满足条件的转账明细单
NeedQueryDetail *bool `json:"need_query_detail"`
// 该次请求资源(转账明细单)的起始位置,从0开始,默认值为0
Offset *int64 `json:"offset,omitempty"`
// 该次请求可返回的最大资源(转账明细单)条数,最小20条,最大100条,不传则默认20条。不足20条按实际条数返回
Limit *int64 `json:"limit,omitempty"`
// 查询指定状态的转账明细单 ALL:全部。需要同时查询转账成功和转账失败的明细单 SUCCESS:转账成功。只查询转账成功的明细单 FAIL:转账失败。只查询转账失败的明细单
DetailStatus *string `json:"detail_status,omitempty"`
}
func (o GetTransferBatchByOutNoRequest) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.OutBatchNo == nil {
return nil, fmt.Errorf("field `OutBatchNo` is required and must be specified in GetTransferBatchByOutNoRequest")
}
toSerialize["out_batch_no"] = o.OutBatchNo
if o.NeedQueryDetail == nil {
return nil, fmt.Errorf("field `NeedQueryDetail` is required and must be specified in GetTransferBatchByOutNoRequest")
}
toSerialize["need_query_detail"] = o.NeedQueryDetail
if o.Offset != nil {
toSerialize["offset"] = o.Offset
}
if o.Limit != nil {
toSerialize["limit"] = o.Limit
}
if o.DetailStatus != nil {
toSerialize["detail_status"] = o.DetailStatus
}
return json.Marshal(toSerialize)
}
func (o GetTransferBatchByOutNoRequest) String() string {
var ret string
if o.OutBatchNo == nil {
ret += "OutBatchNo:<nil>, "
} else {
ret += fmt.Sprintf("OutBatchNo:%v, ", *o.OutBatchNo)
}
if o.NeedQueryDetail == nil {
ret += "NeedQueryDetail:<nil>, "
} else {
ret += fmt.Sprintf("NeedQueryDetail:%v, ", *o.NeedQueryDetail)
}
if o.Offset == nil {
ret += "Offset:<nil>, "
} else {
ret += fmt.Sprintf("Offset:%v, ", *o.Offset)
}
if o.Limit == nil {
ret += "Limit:<nil>, "
} else {
ret += fmt.Sprintf("Limit:%v, ", *o.Limit)
}
if o.DetailStatus == nil {
ret += "DetailStatus:<nil>"
} else {
ret += fmt.Sprintf("DetailStatus:%v", *o.DetailStatus)
}
return fmt.Sprintf("GetTransferBatchByOutNoRequest{%s}", ret)
}
func (o GetTransferBatchByOutNoRequest) Clone() *GetTransferBatchByOutNoRequest {
ret := GetTransferBatchByOutNoRequest{}
if o.OutBatchNo != nil {
ret.OutBatchNo = new(string)
*ret.OutBatchNo = *o.OutBatchNo
}
if o.NeedQueryDetail != nil {
ret.NeedQueryDetail = new(bool)
*ret.NeedQueryDetail = *o.NeedQueryDetail
}
if o.Offset != nil {
ret.Offset = new(int64)
*ret.Offset = *o.Offset
}
if o.Limit != nil {
ret.Limit = new(int64)
*ret.Limit = *o.Limit
}
if o.DetailStatus != nil {
ret.DetailStatus = new(string)
*ret.DetailStatus = *o.DetailStatus
}
return &ret
}
// GetTransferDetailByNoRequest
type GetTransferDetailByNoRequest struct {
// 微信支付批次单号,微信商家转账系统返回的唯一标识
BatchId *string `json:"batch_id"`
// 微信支付系统内部区分转账批次单下不同转账明细单的唯一标识
DetailId *string `json:"detail_id"`
}
func (o GetTransferDetailByNoRequest) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.BatchId == nil {
return nil, fmt.Errorf("field `BatchId` is required and must be specified in GetTransferDetailByNoRequest")
}
toSerialize["batch_id"] = o.BatchId
if o.DetailId == nil {
return nil, fmt.Errorf("field `DetailId` is required and must be specified in GetTransferDetailByNoRequest")
}
toSerialize["detail_id"] = o.DetailId
return json.Marshal(toSerialize)
}
func (o GetTransferDetailByNoRequest) String() string {
var ret string
if o.BatchId == nil {
ret += "BatchId:<nil>, "
} else {
ret += fmt.Sprintf("BatchId:%v, ", *o.BatchId)
}
if o.DetailId == nil {
ret += "DetailId:<nil>"
} else {
ret += fmt.Sprintf("DetailId:%v", *o.DetailId)
}
return fmt.Sprintf("GetTransferDetailByNoRequest{%s}", ret)
}
func (o GetTransferDetailByNoRequest) Clone() *GetTransferDetailByNoRequest {
ret := GetTransferDetailByNoRequest{}
if o.BatchId != nil {
ret.BatchId = new(string)
*ret.BatchId = *o.BatchId
}
if o.DetailId != nil {
ret.DetailId = new(string)
*ret.DetailId = *o.DetailId
}
return &ret
}
// GetTransferDetailByOutNoRequest
type GetTransferDetailByOutNoRequest struct {
// 商户系统内部的商家批次单号,在商户系统内部唯一
OutBatchNo *string `json:"out_batch_no"`
// 商户系统内部区分转账批次单下不同转账明细单的唯一标识
OutDetailNo *string `json:"out_detail_no"`
}
func (o GetTransferDetailByOutNoRequest) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.OutBatchNo == nil {
return nil, fmt.Errorf("field `OutBatchNo` is required and must be specified in GetTransferDetailByOutNoRequest")
}
toSerialize["out_batch_no"] = o.OutBatchNo
if o.OutDetailNo == nil {
return nil, fmt.Errorf("field `OutDetailNo` is required and must be specified in GetTransferDetailByOutNoRequest")
}
toSerialize["out_detail_no"] = o.OutDetailNo
return json.Marshal(toSerialize)
}
func (o GetTransferDetailByOutNoRequest) String() string {
var ret string
if o.OutBatchNo == nil {
ret += "OutBatchNo:<nil>, "
} else {
ret += fmt.Sprintf("OutBatchNo:%v, ", *o.OutBatchNo)
}
if o.OutDetailNo == nil {
ret += "OutDetailNo:<nil>"
} else {
ret += fmt.Sprintf("OutDetailNo:%v", *o.OutDetailNo)
}
return fmt.Sprintf("GetTransferDetailByOutNoRequest{%s}", ret)
}
func (o GetTransferDetailByOutNoRequest) Clone() *GetTransferDetailByOutNoRequest {
ret := GetTransferDetailByOutNoRequest{}
if o.OutBatchNo != nil {
ret.OutBatchNo = new(string)
*ret.OutBatchNo = *o.OutBatchNo
}
if o.OutDetailNo != nil {
ret.OutDetailNo = new(string)
*ret.OutDetailNo = *o.OutDetailNo
}
return &ret
}
// InitiateTransferBatchRequest
type InitiateTransferBatchRequest struct {
// 特约商户号
SubMchid *string `json:"sub_mchid"`
// 微信分配的特约商户公众账号ID,特约商户授权类型为INFORMATION_AUTHORIZATION_TYPE和INFORMATION_AND_FUND_AUTHORIZATION_TYPE时 需要填写
SubAppid *string `json:"sub_appid,omitempty"`
// 特约商户授权类型 * `INFORMATION_AUTHORIZATION_TYPE` - 特约商户信息授权类型 * `FUND_AUTHORIZATION_TYPE` - 特约商户资金授权类型 * `INFORMATION_AND_FUND_AUTHORIZATION_TYPE` - 特约商户信息和资金授权类型
AuthorizationType *AuthType `json:"authorization_type"`
// 商户系统内部的商家批次单号,在商户系统内部唯一
OutBatchNo *string `json:"out_batch_no"`
// 该笔批量转账的名称
BatchName *string `json:"batch_name"`
// 转账说明,UTF8编码,最多允许32个字符
BatchRemark *string `json:"batch_remark"`
// 转账金额单位为“分”。转账总金额必须与批次内所有明细转账金额之和保持一致,否则无法发起转账操作
TotalAmount *int64 `json:"total_amount"`
// 一个转账批次单最多发起三千笔转账。转账总笔数必须与批次内所有明细之和保持一致,否则无法发起转账操作
TotalNum *int64 `json:"total_num"`
// 发起批量转账的明细列表,最多三千笔
TransferDetailList []TransferDetailInput `json:"transfer_detail_list,omitempty"`
// 微信分配的服务商商户公众账号ID,特约商户授权类型为FUND_AUTHORIZATION_TYPE时 需要填写
SpAppid *string `json:"sp_appid,omitempty"`
// 批量转账用途 * `GOODSPAYMENT` - 货款 * `COMMISSION` - 佣金 * `REFUND` - 退款 * `REIMBURSEMENT` - 报销 * `FREIGHT` - 运费 * `OTHERS` - 其他
TransferPurpose *TransferUseType `json:"transfer_purpose,omitempty"`
// 商户的转账场景 * `ORDINARY_TRANSFER` - 普通转账 * `PAYROLL_CARD_TRANSFER` - 薪工卡转账
TransferScene *TransferScene `json:"transfer_scene,omitempty"`
}
func (o InitiateTransferBatchRequest) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.SubMchid == nil {
return nil, fmt.Errorf("field `SubMchid` is required and must be specified in InitiateTransferBatchRequest")
}
toSerialize["sub_mchid"] = o.SubMchid
if o.SubAppid != nil {
toSerialize["sub_appid"] = o.SubAppid
}
if o.AuthorizationType == nil {
return nil, fmt.Errorf("field `AuthorizationType` is required and must be specified in InitiateTransferBatchRequest")
}
toSerialize["authorization_type"] = o.AuthorizationType
if o.OutBatchNo == nil {
return nil, fmt.Errorf("field `OutBatchNo` is required and must be specified in InitiateTransferBatchRequest")
}
toSerialize["out_batch_no"] = o.OutBatchNo
if o.BatchName == nil {
return nil, fmt.Errorf("field `BatchName` is required and must be specified in InitiateTransferBatchRequest")
}
toSerialize["batch_name"] = o.BatchName
if o.BatchRemark == nil {
return nil, fmt.Errorf("field `BatchRemark` is required and must be specified in InitiateTransferBatchRequest")
}
toSerialize["batch_remark"] = o.BatchRemark
if o.TotalAmount == nil {
return nil, fmt.Errorf("field `TotalAmount` is required and must be specified in InitiateTransferBatchRequest")
}
toSerialize["total_amount"] = o.TotalAmount
if o.TotalNum == nil {
return nil, fmt.Errorf("field `TotalNum` is required and must be specified in InitiateTransferBatchRequest")
}
toSerialize["total_num"] = o.TotalNum
if o.TransferDetailList != nil {
toSerialize["transfer_detail_list"] = o.TransferDetailList
}
if o.SpAppid != nil {
toSerialize["sp_appid"] = o.SpAppid
}
if o.TransferPurpose != nil {
toSerialize["transfer_purpose"] = o.TransferPurpose
}
if o.TransferScene != nil {
toSerialize["transfer_scene"] = o.TransferScene
}
return json.Marshal(toSerialize)
}
func (o InitiateTransferBatchRequest) String() string {
var ret string
if o.SubMchid == nil {
ret += "SubMchid:<nil>, "
} else {
ret += fmt.Sprintf("SubMchid:%v, ", *o.SubMchid)
}
if o.SubAppid == nil {
ret += "SubAppid:<nil>, "
} else {
ret += fmt.Sprintf("SubAppid:%v, ", *o.SubAppid)
}
if o.AuthorizationType == nil {
ret += "AuthorizationType:<nil>, "
} else {
ret += fmt.Sprintf("AuthorizationType:%v, ", *o.AuthorizationType)
}
if o.OutBatchNo == nil {
ret += "OutBatchNo:<nil>, "
} else {
ret += fmt.Sprintf("OutBatchNo:%v, ", *o.OutBatchNo)
}
if o.BatchName == nil {
ret += "BatchName:<nil>, "
} else {
ret += fmt.Sprintf("BatchName:%v, ", *o.BatchName)
}
if o.BatchRemark == nil {
ret += "BatchRemark:<nil>, "
} else {
ret += fmt.Sprintf("BatchRemark:%v, ", *o.BatchRemark)
}
if o.TotalAmount == nil {
ret += "TotalAmount:<nil>, "
} else {
ret += fmt.Sprintf("TotalAmount:%v, ", *o.TotalAmount)
}
if o.TotalNum == nil {
ret += "TotalNum:<nil>, "
} else {
ret += fmt.Sprintf("TotalNum:%v, ", *o.TotalNum)
}
ret += fmt.Sprintf("TransferDetailList:%v, ", o.TransferDetailList)
if o.SpAppid == nil {
ret += "SpAppid:<nil>, "
} else {
ret += fmt.Sprintf("SpAppid:%v, ", *o.SpAppid)
}
if o.TransferPurpose == nil {
ret += "TransferPurpose:<nil>, "
} else {
ret += fmt.Sprintf("TransferPurpose:%v, ", *o.TransferPurpose)
}
if o.TransferScene == nil {
ret += "TransferScene:<nil>"
} else {
ret += fmt.Sprintf("TransferScene:%v", *o.TransferScene)
}
return fmt.Sprintf("InitiateTransferBatchRequest{%s}", ret)
}
func (o InitiateTransferBatchRequest) Clone() *InitiateTransferBatchRequest {
ret := InitiateTransferBatchRequest{}
if o.SubMchid != nil {
ret.SubMchid = new(string)
*ret.SubMchid = *o.SubMchid
}
if o.SubAppid != nil {
ret.SubAppid = new(string)
*ret.SubAppid = *o.SubAppid
}
if o.AuthorizationType != nil {
ret.AuthorizationType = new(AuthType)
*ret.AuthorizationType = *o.AuthorizationType
}
if o.OutBatchNo != nil {
ret.OutBatchNo = new(string)
*ret.OutBatchNo = *o.OutBatchNo
}
if o.BatchName != nil {
ret.BatchName = new(string)
*ret.BatchName = *o.BatchName
}
if o.BatchRemark != nil {
ret.BatchRemark = new(string)
*ret.BatchRemark = *o.BatchRemark
}
if o.TotalAmount != nil {
ret.TotalAmount = new(int64)
*ret.TotalAmount = *o.TotalAmount
}
if o.TotalNum != nil {
ret.TotalNum = new(int64)
*ret.TotalNum = *o.TotalNum
}
if o.TransferDetailList != nil {
ret.TransferDetailList = make([]TransferDetailInput, len(o.TransferDetailList))
for i, item := range o.TransferDetailList {
ret.TransferDetailList[i] = *item.Clone()
}
}
if o.SpAppid != nil {
ret.SpAppid = new(string)
*ret.SpAppid = *o.SpAppid
}
if o.TransferPurpose != nil {
ret.TransferPurpose = new(TransferUseType)
*ret.TransferPurpose = *o.TransferPurpose
}
if o.TransferScene != nil {
ret.TransferScene = new(TransferScene)
*ret.TransferScene = *o.TransferScene
}
return &ret
}
// InitiateTransferBatchResponse
type InitiateTransferBatchResponse struct {
// 商户系统内部的商家批次单号,在商户系统内部唯一
OutBatchNo *string `json:"out_batch_no"`
// 微信支付批次单号,微信商家转账系统返回的唯一标识
BatchId *string `json:"batch_id"`
// 批次受理成功时返回,按照使用rfc3339所定义的格式,格式为YYYY-MM-DDThh:mm:ss+TIMEZONE
CreateTime *time.Time `json:"create_time"`
}
func (o InitiateTransferBatchResponse) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.OutBatchNo == nil {
return nil, fmt.Errorf("field `OutBatchNo` is required and must be specified in InitiateTransferBatchResponse")
}
toSerialize["out_batch_no"] = o.OutBatchNo
if o.BatchId == nil {
return nil, fmt.Errorf("field `BatchId` is required and must be specified in InitiateTransferBatchResponse")
}
toSerialize["batch_id"] = o.BatchId
if o.CreateTime == nil {
return nil, fmt.Errorf("field `CreateTime` is required and must be specified in InitiateTransferBatchResponse")
}
toSerialize["create_time"] = o.CreateTime.Format(time.RFC3339)
return json.Marshal(toSerialize)
}
func (o InitiateTransferBatchResponse) String() string {
var ret string
if o.OutBatchNo == nil {
ret += "OutBatchNo:<nil>, "
} else {
ret += fmt.Sprintf("OutBatchNo:%v, ", *o.OutBatchNo)
}
if o.BatchId == nil {
ret += "BatchId:<nil>, "
} else {
ret += fmt.Sprintf("BatchId:%v, ", *o.BatchId)
}
if o.CreateTime == nil {
ret += "CreateTime:<nil>"
} else {
ret += fmt.Sprintf("CreateTime:%v", *o.CreateTime)
}
return fmt.Sprintf("InitiateTransferBatchResponse{%s}", ret)
}
func (o InitiateTransferBatchResponse) Clone() *InitiateTransferBatchResponse {
ret := InitiateTransferBatchResponse{}
if o.OutBatchNo != nil {
ret.OutBatchNo = new(string)
*ret.OutBatchNo = *o.OutBatchNo
}
if o.BatchId != nil {
ret.BatchId = new(string)
*ret.BatchId = *o.BatchId
}
if o.CreateTime != nil {
ret.CreateTime = new(time.Time)
*ret.CreateTime = *o.CreateTime
}
return &ret
}
// TransferBatchEntity
type TransferBatchEntity struct {
// 微信支付分配的服务商商户号
SpMchid *string `json:"sp_mchid"`
// 微信支付分配的特约商户号
SubMchid *string `json:"sub_mchid"`
// 商户系统内部的商家批次单号,在商户系统内部唯一
OutBatchNo *string `json:"out_batch_no"`
// 微信支付批次单号,微信商家转账系统返回的唯一标识
BatchId *string `json:"batch_id"`
// 微信分配的特约商户公众账号ID。特约商户appid
SubAppid *string `json:"sub_appid,omitempty"`
// WAIT_PAY:待付款,商户员工确认付款阶段。ACCEPTED:已受理。批次已受理成功,若发起批量转账的30分钟后,转账批次单仍处于该状态,可能原因是商户账户余额不足等。商户可查询账户资金流水,若该笔转账批次单的扣款已经发生,则表示批次已经进入转账中,请再次查单确认 PROCESSING:转账中。已开始处理批次内的转账明细单 FINISHED:已完成。批次内的所有转账明细单都已处理完成 CLOSED:已关闭。可查询具体的批次关闭原因确认
BatchStatus *string `json:"batch_status"`
// API:API方式发起 WEB:页面方式发起
BatchType *string `json:"batch_type"`
// 特约商户授权类型 * `INFORMATION_AUTHORIZATION_TYPE` - 特约商户信息授权类型 * `FUND_AUTHORIZATION_TYPE` - 特约商户资金授权类型 * `INFORMATION_AND_FUND_AUTHORIZATION_TYPE` - 特约商户信息和资金授权类型
AuthorizationType *AuthType `json:"authorization_type"`
// 该笔批量转账的名称
BatchName *string `json:"batch_name"`
// 转账说明,UTF8编码,最多允许32个字符
BatchRemark *string `json:"batch_remark"`
// 如果批次单状态为“CLOSED”(已关闭),则有关闭原因 * `MERCHANT_REVOCATION` - 商户主动撤销 * `OVERDUE_CLOSE` - 系统超时关闭
CloseReason *CloseReasonType `json:"close_reason,omitempty"`
// 转账金额单位为“分”
TotalAmount *int64 `json:"total_amount"`
// 一个转账批次单最多发起三千笔转账
TotalNum *int64 `json:"total_num"`
// 批次受理成功时返回,按照使用rfc3339所定义的格式,格式为YYYY-MM-DDThh:mm:ss+TIMEZONE
CreateTime *time.Time `json:"create_time,omitempty"`
// 批次最近一次状态变更的时间,按照使用rfc3339所定义的格式,格式为YYYY-MM-DDThh:mm:ss+TIMEZONE
UpdateTime *time.Time `json:"update_time,omitempty"`
// 转账成功的金额,单位为“分”。当批次状态为“PROCESSING”(转账中)时,转账成功金额随时可能变化
SuccessAmount *int64 `json:"success_amount,omitempty"`
// 转账成功的笔数。当批次状态为“PROCESSING”(转账中)时,转账成功笔数随时可能变化
SuccessNum *int64 `json:"success_num,omitempty"`
// 转账失败的金额,单位为“分”
FailAmount *int64 `json:"fail_amount,omitempty"`
// 转账失败的笔数
FailNum *int64 `json:"fail_num,omitempty"`
// 当批次状态为“FINISHED”(已完成),且成功查询到转账明细单时返回。包括微信明细单号、明细状态信息
TransferDetailList []TransferDetailCompact `json:"transfer_detail_list,omitempty"`
// 微信分配的服务商商户公众账号ID,特约商户授权类型为FUND_AUTHORIZATION_TYPE时才有该字段
SpAppid *string `json:"sp_appid,omitempty"`
// 批量转账用途 * `GOODSPAYMENT` - 货款 * `COMMISSION` - 佣金 * `REFUND` - 退款 * `REIMBURSEMENT` - 报销 * `FREIGHT` - 运费 * `OTHERS` - 其他
TransferPurpose *TransferUseType `json:"transfer_purpose,omitempty"`
// 商户的转账场景 * `ORDINARY_TRANSFER` - 普通转账 * `PAYROLL_CARD_TRANSFER` - 薪工卡转账
TransferScene *TransferScene `json:"transfer_scene,omitempty"`
}
func (o TransferBatchEntity) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.SpMchid == nil {
return nil, fmt.Errorf("field `SpMchid` is required and must be specified in TransferBatchEntity")
}
toSerialize["sp_mchid"] = o.SpMchid
if o.SubMchid == nil {
return nil, fmt.Errorf("field `SubMchid` is required and must be specified in TransferBatchEntity")
}
toSerialize["sub_mchid"] = o.SubMchid
if o.OutBatchNo == nil {
return nil, fmt.Errorf("field `OutBatchNo` is required and must be specified in TransferBatchEntity")
}
toSerialize["out_batch_no"] = o.OutBatchNo
if o.BatchId == nil {
return nil, fmt.Errorf("field `BatchId` is required and must be specified in TransferBatchEntity")
}
toSerialize["batch_id"] = o.BatchId
if o.SubAppid != nil {
toSerialize["sub_appid"] = o.SubAppid
}
if o.BatchStatus == nil {
return nil, fmt.Errorf("field `BatchStatus` is required and must be specified in TransferBatchEntity")
}
toSerialize["batch_status"] = o.BatchStatus
if o.BatchType == nil {
return nil, fmt.Errorf("field `BatchType` is required and must be specified in TransferBatchEntity")
}
toSerialize["batch_type"] = o.BatchType
if o.AuthorizationType == nil {
return nil, fmt.Errorf("field `AuthorizationType` is required and must be specified in TransferBatchEntity")
}
toSerialize["authorization_type"] = o.AuthorizationType
if o.BatchName == nil {
return nil, fmt.Errorf("field `BatchName` is required and must be specified in TransferBatchEntity")
}
toSerialize["batch_name"] = o.BatchName
if o.BatchRemark == nil {
return nil, fmt.Errorf("field `BatchRemark` is required and must be specified in TransferBatchEntity")
}
toSerialize["batch_remark"] = o.BatchRemark
if o.CloseReason != nil {
toSerialize["close_reason"] = o.CloseReason
}
if o.TotalAmount == nil {
return nil, fmt.Errorf("field `TotalAmount` is required and must be specified in TransferBatchEntity")
}
toSerialize["total_amount"] = o.TotalAmount
if o.TotalNum == nil {
return nil, fmt.Errorf("field `TotalNum` is required and must be specified in TransferBatchEntity")
}
toSerialize["total_num"] = o.TotalNum
if o.CreateTime != nil {
toSerialize["create_time"] = o.CreateTime.Format(time.RFC3339)
}
if o.UpdateTime != nil {
toSerialize["update_time"] = o.UpdateTime.Format(time.RFC3339)
}
if o.SuccessAmount != nil {
toSerialize["success_amount"] = o.SuccessAmount
}
if o.SuccessNum != nil {
toSerialize["success_num"] = o.SuccessNum
}
if o.FailAmount != nil {
toSerialize["fail_amount"] = o.FailAmount
}
if o.FailNum != nil {
toSerialize["fail_num"] = o.FailNum
}
if o.TransferDetailList != nil {
toSerialize["transfer_detail_list"] = o.TransferDetailList
}
if o.SpAppid != nil {
toSerialize["sp_appid"] = o.SpAppid
}
if o.TransferPurpose != nil {
toSerialize["transfer_purpose"] = o.TransferPurpose
}
if o.TransferScene != nil {
toSerialize["transfer_scene"] = o.TransferScene
}
return json.Marshal(toSerialize)
}
func (o TransferBatchEntity) String() string {
var ret string
if o.SpMchid == nil {
ret += "SpMchid:<nil>, "
} else {
ret += fmt.Sprintf("SpMchid:%v, ", *o.SpMchid)
}
if o.SubMchid == nil {
ret += "SubMchid:<nil>, "
} else {
ret += fmt.Sprintf("SubMchid:%v, ", *o.SubMchid)
}
if o.OutBatchNo == nil {
ret += "OutBatchNo:<nil>, "
} else {
ret += fmt.Sprintf("OutBatchNo:%v, ", *o.OutBatchNo)
}
if o.BatchId == nil {
ret += "BatchId:<nil>, "
} else {
ret += fmt.Sprintf("BatchId:%v, ", *o.BatchId)
}
if o.SubAppid == nil {
ret += "SubAppid:<nil>, "
} else {
ret += fmt.Sprintf("SubAppid:%v, ", *o.SubAppid)
}
if o.BatchStatus == nil {
ret += "BatchStatus:<nil>, "
} else {
ret += fmt.Sprintf("BatchStatus:%v, ", *o.BatchStatus)
}
if o.BatchType == nil {
ret += "BatchType:<nil>, "
} else {
ret += fmt.Sprintf("BatchType:%v, ", *o.BatchType)
}
if o.AuthorizationType == nil {
ret += "AuthorizationType:<nil>, "
} else {
ret += fmt.Sprintf("AuthorizationType:%v, ", *o.AuthorizationType)
}
if o.BatchName == nil {
ret += "BatchName:<nil>, "
} else {
ret += fmt.Sprintf("BatchName:%v, ", *o.BatchName)
}
if o.BatchRemark == nil {
ret += "BatchRemark:<nil>, "
} else {
ret += fmt.Sprintf("BatchRemark:%v, ", *o.BatchRemark)
}
if o.CloseReason == nil {
ret += "CloseReason:<nil>, "
} else {
ret += fmt.Sprintf("CloseReason:%v, ", *o.CloseReason)
}
if o.TotalAmount == nil {
ret += "TotalAmount:<nil>, "
} else {
ret += fmt.Sprintf("TotalAmount:%v, ", *o.TotalAmount)
}
if o.TotalNum == nil {
ret += "TotalNum:<nil>, "
} else {
ret += fmt.Sprintf("TotalNum:%v, ", *o.TotalNum)
}
if o.CreateTime == nil {
ret += "CreateTime:<nil>, "
} else {
ret += fmt.Sprintf("CreateTime:%v, ", *o.CreateTime)
}
if o.UpdateTime == nil {
ret += "UpdateTime:<nil>, "
} else {
ret += fmt.Sprintf("UpdateTime:%v, ", *o.UpdateTime)
}
if o.SuccessAmount == nil {
ret += "SuccessAmount:<nil>, "
} else {
ret += fmt.Sprintf("SuccessAmount:%v, ", *o.SuccessAmount)
}
if o.SuccessNum == nil {
ret += "SuccessNum:<nil>, "
} else {
ret += fmt.Sprintf("SuccessNum:%v, ", *o.SuccessNum)
}
if o.FailAmount == nil {
ret += "FailAmount:<nil>, "
} else {
ret += fmt.Sprintf("FailAmount:%v, ", *o.FailAmount)
}
if o.FailNum == nil {
ret += "FailNum:<nil>, "
} else {
ret += fmt.Sprintf("FailNum:%v, ", *o.FailNum)
}
ret += fmt.Sprintf("TransferDetailList:%v, ", o.TransferDetailList)
if o.SpAppid == nil {
ret += "SpAppid:<nil>, "
} else {
ret += fmt.Sprintf("SpAppid:%v, ", *o.SpAppid)
}
if o.TransferPurpose == nil {
ret += "TransferPurpose:<nil>, "
} else {
ret += fmt.Sprintf("TransferPurpose:%v, ", *o.TransferPurpose)
}
if o.TransferScene == nil {
ret += "TransferScene:<nil>"
} else {
ret += fmt.Sprintf("TransferScene:%v", *o.TransferScene)
}
return fmt.Sprintf("TransferBatchEntity{%s}", ret)
}
func (o TransferBatchEntity) Clone() *TransferBatchEntity {