-
Notifications
You must be signed in to change notification settings - Fork 149
/
models.go
1497 lines (1228 loc) · 45.1 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
//
// * 场景及业务流程: 商户可通过该产品实现同时向多个用户微信零钱进行转账的操作,可用于发放奖金补贴、佣金货款结算、员工报销等场景。 [https://pay.weixin.qq.com/index.php/public/product/detail?pid=108&productType=0](https://pay.weixin.qq.com/index.php/public/product/detail?pid=108&productType=0) * 接入步骤: * 商户在微信支付商户平台开通“批量转账到零钱”产品权限,并勾选“使用API方式发起转账”。 * 调用批量转账接口,对多个用户微信零钱发起转账。 * 调用查询批次接口,可获取到转账批次详情及当前状态。 * 调用查询明细接口,可获取到单条转账明细详情及当前状态。
//
// API version: 1.0.5
// Code generated by WechatPay APIv3 Generator based on [OpenAPI Generator](https://openapi-generator.tech); DO NOT EDIT.
package transferbatch
import (
"encoding/json"
"fmt"
"time"
)
// CloseReasonType
type CloseReasonType string
func (e CloseReasonType) Ptr() *CloseReasonType {
return &e
}
// Enums of CloseReasonType
const (
CLOSEREASONTYPE_OVERDUE_CLOSE CloseReasonType = "OVERDUE_CLOSE"
CLOSEREASONTYPE_TRANSFER_SCENE_INVALID CloseReasonType = "TRANSFER_SCENE_INVALID"
)
// FailReasonType
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_OTHER_FAIL_REASON_TYPE FailReasonType = "OTHER_FAIL_REASON_TYPE"
FAILREASONTYPE_REALNAME_ACCOUNT_RECEIVED_QUOTA_EXCEED FailReasonType = "REALNAME_ACCOUNT_RECEIVED_QUOTA_EXCEED"
FAILREASONTYPE_RECEIVE_ACCOUNT_NOT_PERMMIT FailReasonType = "RECEIVE_ACCOUNT_NOT_PERMMIT"
FAILREASONTYPE_PAYEE_ACCOUNT_ABNORMAL FailReasonType = "PAYEE_ACCOUNT_ABNORMAL"
FAILREASONTYPE_PAYER_ACCOUNT_ABNORMAL FailReasonType = "PAYER_ACCOUNT_ABNORMAL"
FAILREASONTYPE_TRANSFER_SCENE_UNAVAILABLE FailReasonType = "TRANSFER_SCENE_UNAVAILABLE"
FAILREASONTYPE_TRANSFER_SCENE_INVALID FailReasonType = "TRANSFER_SCENE_INVALID"
FAILREASONTYPE_TRANSFER_REMARK_SET_FAIL FailReasonType = "TRANSFER_REMARK_SET_FAIL"
FAILREASONTYPE_RECEIVE_ACCOUNT_NOT_CONFIGURE FailReasonType = "RECEIVE_ACCOUNT_NOT_CONFIGURE"
FAILREASONTYPE_BLOCK_B2_C_USERLIMITAMOUNT_BSRULE_MONTH FailReasonType = "BLOCK_B2C_USERLIMITAMOUNT_BSRULE_MONTH"
FAILREASONTYPE_BLOCK_B2_C_USERLIMITAMOUNT_MONTH FailReasonType = "BLOCK_B2C_USERLIMITAMOUNT_MONTH"
FAILREASONTYPE_MERCHANT_REJECT FailReasonType = "MERCHANT_REJECT"
FAILREASONTYPE_MERCHANT_NOT_CONFIRM FailReasonType = "MERCHANT_NOT_CONFIRM"
)
// 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"`
// WAIT_PAY: 待确认。待商户确认, 符合免密条件时, 系统会自动扭转为转账中 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"`
// WAIT_PAY: 待确认。待商户确认, 符合免密条件时, 系统会自动扭转为转账中 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 {
// 商户系统内部区分转账批次单下不同转账明细单的唯一标识
OutDetailNo *string `json:"out_detail_no"`
// 商户系统内部的商家批次单号,在商户系统内部唯一
OutBatchNo *string `json:"out_batch_no"`
}
func (o GetTransferDetailByOutNoRequest) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.OutDetailNo == nil {
return nil, fmt.Errorf("field `OutDetailNo` is required and must be specified in GetTransferDetailByOutNoRequest")
}
toSerialize["out_detail_no"] = o.OutDetailNo
if o.OutBatchNo == nil {
return nil, fmt.Errorf("field `OutBatchNo` is required and must be specified in GetTransferDetailByOutNoRequest")
}
toSerialize["out_batch_no"] = o.OutBatchNo
return json.Marshal(toSerialize)
}
func (o GetTransferDetailByOutNoRequest) String() string {
var ret string
if o.OutDetailNo == nil {
ret += "OutDetailNo:<nil>, "
} else {
ret += fmt.Sprintf("OutDetailNo:%v, ", *o.OutDetailNo)
}
if o.OutBatchNo == nil {
ret += "OutBatchNo:<nil>"
} else {
ret += fmt.Sprintf("OutBatchNo:%v", *o.OutBatchNo)
}
return fmt.Sprintf("GetTransferDetailByOutNoRequest{%s}", ret)
}
func (o GetTransferDetailByOutNoRequest) Clone() *GetTransferDetailByOutNoRequest {
ret := GetTransferDetailByOutNoRequest{}
if o.OutDetailNo != nil {
ret.OutDetailNo = new(string)
*ret.OutDetailNo = *o.OutDetailNo
}
if o.OutBatchNo != nil {
ret.OutBatchNo = new(string)
*ret.OutBatchNo = *o.OutBatchNo
}
return &ret
}
// InitiateBatchTransferRequest
type InitiateBatchTransferRequest struct {
// 申请商户号的appid或商户号绑定的appid(企业号corpid即为此appid)
Appid *string `json:"appid"`
// 商户系统内部的商家批次单号,要求此参数只能由数字、大小写字母组成,在商户系统内部唯一
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"`
// 该批次转账使用的转账场景,如不填写则使用商家的默认场景,如无默认场景可为空,可前往“商家转账到零钱-前往功能”中申请。 如:1001-现金营销
TransferSceneId *string `json:"transfer_scene_id,omitempty"`
// 商户接收批次结果通知的URL,必须支持https,且只能是直接可访问的URL,不允许携带查询参数
NotifyUrl *string `json:"notify_url,omitempty"`
}
func (o InitiateBatchTransferRequest) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Appid == nil {
return nil, fmt.Errorf("field `Appid` is required and must be specified in InitiateBatchTransferRequest")
}
toSerialize["appid"] = o.Appid
if o.OutBatchNo == nil {
return nil, fmt.Errorf("field `OutBatchNo` is required and must be specified in InitiateBatchTransferRequest")
}
toSerialize["out_batch_no"] = o.OutBatchNo
if o.BatchName == nil {
return nil, fmt.Errorf("field `BatchName` is required and must be specified in InitiateBatchTransferRequest")
}
toSerialize["batch_name"] = o.BatchName
if o.BatchRemark == nil {
return nil, fmt.Errorf("field `BatchRemark` is required and must be specified in InitiateBatchTransferRequest")
}
toSerialize["batch_remark"] = o.BatchRemark
if o.TotalAmount == nil {
return nil, fmt.Errorf("field `TotalAmount` is required and must be specified in InitiateBatchTransferRequest")
}
toSerialize["total_amount"] = o.TotalAmount
if o.TotalNum == nil {
return nil, fmt.Errorf("field `TotalNum` is required and must be specified in InitiateBatchTransferRequest")
}
toSerialize["total_num"] = o.TotalNum
if o.TransferDetailList == nil {
return nil, fmt.Errorf("field `TransferDetailList` is required and must be specified in InitiateBatchTransferRequest")
}
toSerialize["transfer_detail_list"] = o.TransferDetailList
if o.TransferSceneId != nil {
toSerialize["transfer_scene_id"] = o.TransferSceneId
}
if o.NotifyUrl != nil {
toSerialize["notify_url"] = o.NotifyUrl
}
return json.Marshal(toSerialize)
}
func (o InitiateBatchTransferRequest) String() string {
var ret string
if o.Appid == nil {
ret += "Appid:<nil>, "
} else {
ret += fmt.Sprintf("Appid:%v, ", *o.Appid)
}
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.TransferSceneId == nil {
ret += "TransferSceneId:<nil>"
} else {
ret += fmt.Sprintf("TransferSceneId:%v", *o.TransferSceneId)
}
if o.NotifyUrl == nil {
ret += "NotifyUrl:<nil>"
} else {
ret += fmt.Sprintf("NotifyUrl:%v", *o.NotifyUrl)
}
return fmt.Sprintf("InitiateBatchTransferRequest{%s}", ret)
}
func (o InitiateBatchTransferRequest) Clone() *InitiateBatchTransferRequest {
ret := InitiateBatchTransferRequest{}
if o.Appid != nil {
ret.Appid = new(string)
*ret.Appid = *o.Appid
}
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.TransferSceneId != nil {
ret.TransferSceneId = new(string)
*ret.TransferSceneId = *o.TransferSceneId
}
if o.NotifyUrl != nil {
ret.NotifyUrl = new(string)
*ret.NotifyUrl = *o.NotifyUrl
}
return &ret
}
// InitiateBatchTransferResponse
type InitiateBatchTransferResponse 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"`
// ACCEPTED:已受理。批次已受理成功,若发起批量转账的30分钟后,转账批次单仍处于该状态,可能原因是商户账户余额不足等。商户可查询账户资金流水,若该笔转账批次单的扣款已经发生,则表示批次已经进入转账中,请再次查单确认 PROCESSING:转账中。已开始处理批次内的转账明细单 FINISHED:已完成。批次内的所有转账明细单都已处理完成 CLOSED:已关闭。可查询具体的批次关闭原因确认
BatchStatus *string `json:"batch_status,omitempty"`
}
func (o InitiateBatchTransferResponse) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.OutBatchNo == nil {
return nil, fmt.Errorf("field `OutBatchNo` is required and must be specified in InitiateBatchTransferResponse")
}
toSerialize["out_batch_no"] = o.OutBatchNo
if o.BatchId == nil {
return nil, fmt.Errorf("field `BatchId` is required and must be specified in InitiateBatchTransferResponse")
}
toSerialize["batch_id"] = o.BatchId
if o.CreateTime == nil {
return nil, fmt.Errorf("field `CreateTime` is required and must be specified in InitiateBatchTransferResponse")
}
toSerialize["create_time"] = o.CreateTime.Format(time.RFC3339)
if o.BatchStatus != nil {
toSerialize["batch_status"] = o.BatchStatus
}
return json.Marshal(toSerialize)
}
func (o InitiateBatchTransferResponse) 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)
}
if o.BatchStatus == nil {
ret += "BatchStatus:<nil>"
} else {
ret += fmt.Sprintf("BatchStatus:%v", *o.BatchStatus)
}
return fmt.Sprintf("InitiateBatchTransferResponse{%s}", ret)
}
func (o InitiateBatchTransferResponse) Clone() *InitiateBatchTransferResponse {
ret := InitiateBatchTransferResponse{}
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
}
if o.BatchStatus != nil {
ret.BatchStatus = new(string)
*ret.BatchStatus = *o.BatchStatus
}
return &ret
}
// TransferBatchEntity
type TransferBatchEntity struct {
// 转账批次单基本信息
TransferBatch *TransferBatchGet `json:"transfer_batch"`
// 当批次状态为“FINISHED”(已完成),且成功查询到转账明细单时返回。包括微信明细单号、明细状态信息
TransferDetailList []TransferDetailCompact `json:"transfer_detail_list,omitempty"`
}
func (o TransferBatchEntity) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.TransferBatch == nil {
return nil, fmt.Errorf("field `TransferBatch` is required and must be specified in TransferBatchEntity")
}
toSerialize["transfer_batch"] = o.TransferBatch
if o.TransferDetailList != nil {
toSerialize["transfer_detail_list"] = o.TransferDetailList
}
return json.Marshal(toSerialize)
}
func (o TransferBatchEntity) String() string {
var ret string
ret += fmt.Sprintf("TransferBatch:%v, ", o.TransferBatch)
ret += fmt.Sprintf("TransferDetailList:%v", o.TransferDetailList)
return fmt.Sprintf("TransferBatchEntity{%s}", ret)
}
func (o TransferBatchEntity) Clone() *TransferBatchEntity {
ret := TransferBatchEntity{}
if o.TransferBatch != nil {
ret.TransferBatch = o.TransferBatch.Clone()
}
if o.TransferDetailList != nil {
ret.TransferDetailList = make([]TransferDetailCompact, len(o.TransferDetailList))
for i, item := range o.TransferDetailList {
ret.TransferDetailList[i] = *item.Clone()
}
}
return &ret
}
// TransferBatchGet
type TransferBatchGet struct {
// 微信支付分配的商户号
Mchid *string `json:"mchid"`
// 商户系统内部的商家批次单号,在商户系统内部唯一
OutBatchNo *string `json:"out_batch_no"`
// 微信批次单号,微信商家转账系统返回的唯一标识
BatchId *string `json:"batch_id"`
// 申请商户号的appid或商户号绑定的appid(企业号corpid即为此appid)
Appid *string `json:"appid"`
// WAIT_PAY: 待付款确认。需要付款出资商户在商家助手小程序或服务商助手小程序进行付款确认 ACCEPTED:已受理。批次已受理成功,若发起批量转账的30分钟后,转账批次单仍处于该状态,可能原因是商户账户余额不足等。商户可查询账户资金流水,若该笔转账批次单的扣款已经发生,则表示批次已经进入转账中,请再次查单确认 PROCESSING:转账中。已开始处理批次内的转账明细单 FINISHED:已完成。批次内的所有转账明细单都已处理完成 CLOSED:已关闭。可查询具体的批次关闭原因确认
BatchStatus *string `json:"batch_status"`
// API:API方式发起 WEB:页面方式发起
BatchType *string `json:"batch_type"`
// 该笔批量转账的名称
BatchName *string `json:"batch_name"`
// 转账说明,UTF8编码,最多允许32个字符
BatchRemark *string `json:"batch_remark"`
// 如果批次单状态为“CLOSED”(已关闭),则有关闭原因
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"`
// 指定的转账场景ID
TransferSceneId *string `json:"transfer_scene_id,omitempty"`
}
func (o TransferBatchGet) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Mchid == nil {
return nil, fmt.Errorf("field `Mchid` is required and must be specified in TransferBatchGet")
}
toSerialize["mchid"] = o.Mchid
if o.OutBatchNo == nil {
return nil, fmt.Errorf("field `OutBatchNo` is required and must be specified in TransferBatchGet")
}
toSerialize["out_batch_no"] = o.OutBatchNo
if o.BatchId == nil {
return nil, fmt.Errorf("field `BatchId` is required and must be specified in TransferBatchGet")
}
toSerialize["batch_id"] = o.BatchId
if o.Appid == nil {
return nil, fmt.Errorf("field `Appid` is required and must be specified in TransferBatchGet")
}
toSerialize["appid"] = o.Appid
if o.BatchStatus == nil {
return nil, fmt.Errorf("field `BatchStatus` is required and must be specified in TransferBatchGet")
}
toSerialize["batch_status"] = o.BatchStatus
if o.BatchType == nil {
return nil, fmt.Errorf("field `BatchType` is required and must be specified in TransferBatchGet")
}
toSerialize["batch_type"] = o.BatchType
if o.BatchName == nil {
return nil, fmt.Errorf("field `BatchName` is required and must be specified in TransferBatchGet")
}
toSerialize["batch_name"] = o.BatchName
if o.BatchRemark == nil {
return nil, fmt.Errorf("field `BatchRemark` is required and must be specified in TransferBatchGet")
}
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 TransferBatchGet")
}
toSerialize["total_amount"] = o.TotalAmount
if o.TotalNum == nil {
return nil, fmt.Errorf("field `TotalNum` is required and must be specified in TransferBatchGet")
}
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.TransferSceneId != nil {
toSerialize["transfer_scene_id"] = o.TransferSceneId
}
return json.Marshal(toSerialize)
}
func (o TransferBatchGet) String() string {
var ret string
if o.Mchid == nil {
ret += "Mchid:<nil>, "
} else {
ret += fmt.Sprintf("Mchid:%v, ", *o.Mchid)
}
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.Appid == nil {
ret += "Appid:<nil>, "
} else {
ret += fmt.Sprintf("Appid:%v, ", *o.Appid)
}
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.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)
}
if o.TransferSceneId == nil {
ret += "TransferSceneId:<nil>"
} else {
ret += fmt.Sprintf("TransferSceneId:%v", *o.TransferSceneId)
}
return fmt.Sprintf("TransferBatchGet{%s}", ret)
}
func (o TransferBatchGet) Clone() *TransferBatchGet {
ret := TransferBatchGet{}
if o.Mchid != nil {
ret.Mchid = new(string)
*ret.Mchid = *o.Mchid
}
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.Appid != nil {
ret.Appid = new(string)
*ret.Appid = *o.Appid
}
if o.BatchStatus != nil {
ret.BatchStatus = new(string)
*ret.BatchStatus = *o.BatchStatus
}
if o.BatchType != nil {
ret.BatchType = new(string)
*ret.BatchType = *o.BatchType
}
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.CloseReason != nil {
ret.CloseReason = new(CloseReasonType)
*ret.CloseReason = *o.CloseReason
}
if o.TotalAmount != nil {
ret.TotalAmount = new(int64)
*ret.TotalAmount = *o.TotalAmount