-
Notifications
You must be signed in to change notification settings - Fork 0
/
enums.go
1606 lines (1464 loc) · 44.6 KB
/
enums.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
package authorize_net
import (
"encoding/json"
"errors"
"fmt"
)
type TransactionTypeEnum uint
const (
AuthOnlyTransaction TransactionTypeEnum = 1
AuthCaptureTransaction TransactionTypeEnum = 2
CaptureOnlyTransaction TransactionTypeEnum = 3
RefundTransaction TransactionTypeEnum = 4
PriorAuthCaptureTransaction TransactionTypeEnum = 5
VoidTransaction TransactionTypeEnum = 6
GetDetailsTransaction TransactionTypeEnum = 7
AuthOnlyContinueTransaction TransactionTypeEnum = 8
AuthCaptureContinueTransaction TransactionTypeEnum = 9
)
func (t TransactionTypeEnum) MarshalJSON() ([]byte, error) {
switch t {
case AuthOnlyTransaction:
return json.Marshal("authOnlyTransaction")
case AuthCaptureTransaction:
return json.Marshal("authCaptureTransaction")
case CaptureOnlyTransaction:
return json.Marshal("captureOnlyTransaction")
case RefundTransaction:
return json.Marshal("refundTransaction")
case PriorAuthCaptureTransaction:
return json.Marshal("priorAuthCaptureTransaction")
case VoidTransaction:
return json.Marshal("voidTransaction")
case GetDetailsTransaction:
return json.Marshal("getDetailsTransaction")
case AuthOnlyContinueTransaction:
return json.Marshal("authOnlyContinueTransaction")
case AuthCaptureContinueTransaction:
return json.Marshal("authCaptureContinueTransaction")
default:
return json.Marshal("null")
}
}
func (t *TransactionTypeEnum) UnmarshalJSON(data []byte) error {
if len(data) == 0 {
return errors.New("invalid TransactionTypeEnum (empty)")
}
switch string(data[1 : len(data)-1]) {
case "authOnlyTransaction":
*t = AuthOnlyTransaction
case "authCaptureTransaction":
*t = AuthCaptureTransaction
case "captureOnlyTransaction":
*t = CaptureOnlyTransaction
case "refundTransaction":
*t = RefundTransaction
case "priorAuthCaptureTransaction":
*t = PriorAuthCaptureTransaction
case "voidTransaction":
*t = VoidTransaction
case "getDetailsTransaction":
*t = GetDetailsTransaction
case "authOnlyContinueTransaction":
*t = AuthOnlyContinueTransaction
case "authCaptureContinueTransaction":
*t = AuthCaptureContinueTransaction
default:
return fmt.Errorf("invalid TransactionTypeEnum : %q", string(data))
}
return nil
}
type BankAccountTypeEnum uint
const (
BankAccountTypeChecking BankAccountTypeEnum = 1
BankAccountTypeSavings BankAccountTypeEnum = 2
BankAccountTypeBusinessChecking BankAccountTypeEnum = 3
)
func (b BankAccountTypeEnum) MarshalJSON() ([]byte, error) {
switch b {
case BankAccountTypeChecking:
return json.Marshal("checking")
case BankAccountTypeSavings:
return json.Marshal("savings")
case BankAccountTypeBusinessChecking:
return json.Marshal("businessChecking")
default:
return json.Marshal("null")
}
}
func (b *BankAccountTypeEnum) UnmarshalJSON(data []byte) error {
if len(data) == 0 {
return errors.New("invalid BankAccountTypeEnum (empty)")
}
switch string(data[1 : len(data)-1]) {
case "checking":
*b = BankAccountTypeChecking
case "savings":
*b = BankAccountTypeSavings
case "businessChecking":
*b = BankAccountTypeBusinessChecking
default:
return fmt.Errorf("invalid BankAccountTypeEnum : %q", string(data))
}
return nil
}
type EcheckTypeEnum uint
const (
EcheckPPD EcheckTypeEnum = 1
EcheckWEB EcheckTypeEnum = 2
EcheckCCD EcheckTypeEnum = 3
EcheckTEL EcheckTypeEnum = 4
EcheckARC EcheckTypeEnum = 5
EcheckBOC EcheckTypeEnum = 6
)
func (a EcheckTypeEnum) MarshalJSON() ([]byte, error) {
switch a {
case EcheckPPD:
return json.Marshal("PPD")
case EcheckWEB:
return json.Marshal("WEB")
case EcheckCCD:
return json.Marshal("CCD")
case EcheckTEL:
return json.Marshal("TEL")
case EcheckARC:
return json.Marshal("ARC")
case EcheckBOC:
return json.Marshal("BOC")
default:
return json.Marshal("null")
}
}
func (a *EcheckTypeEnum) UnmarshalJSON(data []byte) error {
if len(data) == 0 {
return errors.New("invalid EcheckTypeEnum (empty)")
}
switch string(data[1 : len(data)-1]) {
case "PPD":
*a = EcheckPPD
case "WEB":
*a = EcheckWEB
case "CCD":
*a = EcheckCCD
case "TEL":
*a = EcheckTEL
case "ARC":
*a = EcheckARC
case "BOC":
*a = EcheckBOC
default:
return fmt.Errorf("invalid EcheckTypeEnum : %q", string(data))
}
return nil
}
type PaymentMethodsTypeEnum uint
const (
PaymentMethodVisa PaymentMethodsTypeEnum = 1
PaymentMethodMasterCard PaymentMethodsTypeEnum = 2
PaymentMethodAmericanExpress PaymentMethodsTypeEnum = 3
PaymentMethodDiscover PaymentMethodsTypeEnum = 4
PaymentMethodJCB PaymentMethodsTypeEnum = 5
PaymentMethodDinersClub PaymentMethodsTypeEnum = 6
PaymentMethodEnRoute PaymentMethodsTypeEnum = 7
PaymentMethodECheck PaymentMethodsTypeEnum = 8
PaymentMethodPaypal PaymentMethodsTypeEnum = 9
PaymentMethodVisaCheckout PaymentMethodsTypeEnum = 10
PaymentMethodApplePay PaymentMethodsTypeEnum = 11
PaymentMethodAndroidPay PaymentMethodsTypeEnum = 12
)
func (a PaymentMethodsTypeEnum) MarshalJSON() ([]byte, error) {
switch a {
case PaymentMethodVisa:
return json.Marshal("Visa")
case PaymentMethodMasterCard:
return json.Marshal("MasterCard")
case PaymentMethodAmericanExpress:
return json.Marshal("AmericanExpress")
case PaymentMethodDiscover:
return json.Marshal("Discover")
case PaymentMethodJCB:
return json.Marshal("JCB")
case PaymentMethodDinersClub:
return json.Marshal("DinersClub")
case PaymentMethodEnRoute:
return json.Marshal("EnRoute")
case PaymentMethodECheck:
return json.Marshal("eCheck")
case PaymentMethodPaypal:
return json.Marshal("Paypal")
case PaymentMethodVisaCheckout:
return json.Marshal("VisaCheckout")
case PaymentMethodApplePay:
return json.Marshal("ApplePay")
case PaymentMethodAndroidPay:
return json.Marshal("AndroidPay")
default:
return json.Marshal("null")
}
}
func (a *PaymentMethodsTypeEnum) UnmarshalJSON(data []byte) error {
if len(data) == 0 {
return errors.New("invalid PaymentMethodsTypeEnum (empty)")
}
switch string(data[1 : len(data)-1]) {
case "Visa":
*a = PaymentMethodVisa
case "MasterCard":
*a = PaymentMethodMasterCard
case "AmericanExpress":
*a = PaymentMethodAmericanExpress
case "Discover":
*a = PaymentMethodDiscover
case "JCB":
*a = PaymentMethodJCB
case "DinersClub":
*a = PaymentMethodDinersClub
case "EnRoute":
*a = PaymentMethodEnRoute
case "eCheck":
*a = PaymentMethodECheck
case "PayPal":
*a = PaymentMethodPaypal
case "VisaCheckout":
*a = PaymentMethodVisaCheckout
case "ApplePay":
*a = PaymentMethodApplePay
case "AndroidPay":
*a = PaymentMethodAndroidPay
default:
return fmt.Errorf("invalid PaymentMethodsTypeEnum : %q", string(data))
}
return nil
}
type CardTypeEnum uint
const (
CardVisa CardTypeEnum = 1
CardMasterCard CardTypeEnum = 2
CardAmericanExpress CardTypeEnum = 3
CardDiscover CardTypeEnum = 4
CardJCB CardTypeEnum = 5
CardDinersClub CardTypeEnum = 6
)
func (a CardTypeEnum) MarshalJSON() ([]byte, error) {
switch a {
case CardVisa:
return json.Marshal("Visa")
case CardMasterCard:
return json.Marshal("MasterCard")
case CardAmericanExpress:
return json.Marshal("AmericanExpress")
case CardDiscover:
return json.Marshal("Discover")
case CardJCB:
return json.Marshal("JCB")
case CardDinersClub:
return json.Marshal("DinersClub")
default:
return json.Marshal("null")
}
}
func (a *CardTypeEnum) UnmarshalJSON(data []byte) error {
if len(data) == 0 {
return errors.New("invalid CardTypeEnum (empty)")
}
switch string(data[1 : len(data)-1]) {
case "Visa":
*a = CardVisa
case "MasterCard":
*a = CardMasterCard
case "AmericanExpress":
*a = CardAmericanExpress
case "Discover":
*a = CardDiscover
case "JCB":
*a = CardJCB
case "DinersClub":
*a = CardDinersClub
default:
return fmt.Errorf("invalid CardTypeEnum : %q", string(data))
}
return nil
}
type AccountTypeEnum uint
const (
AccountTypeVisa AccountTypeEnum = 1
AccountTypeMasterCard AccountTypeEnum = 2
AccountTypeAmericanExpress AccountTypeEnum = 3
AccountTypeDiscover AccountTypeEnum = 4
AccountTypeJCB AccountTypeEnum = 5
AccountTypeDinersClub AccountTypeEnum = 6
AccountTypeECheck AccountTypeEnum = 7
)
func (a AccountTypeEnum) MarshalJSON() ([]byte, error) {
switch a {
case AccountTypeVisa:
return json.Marshal("Visa")
case AccountTypeMasterCard:
return json.Marshal("MasterCard")
case AccountTypeAmericanExpress:
return json.Marshal("AmericanExpress")
case AccountTypeDiscover:
return json.Marshal("Discover")
case AccountTypeJCB:
return json.Marshal("JCB")
case AccountTypeDinersClub:
return json.Marshal("DinersClub")
case AccountTypeECheck:
return json.Marshal("eCheck")
default:
return json.Marshal("null")
}
}
func (a *AccountTypeEnum) UnmarshalJSON(data []byte) error {
if len(data) == 0 {
return errors.New("invalid AccountTypeEnum (empty)")
}
switch string(data[1 : len(data)-1]) {
case "Visa":
*a = AccountTypeVisa
case "MasterCard":
*a = AccountTypeMasterCard
case "AmericanExpress":
*a = AccountTypeAmericanExpress
case "Discover":
*a = AccountTypeDiscover
case "JCB":
*a = AccountTypeJCB
case "DinersClub":
*a = AccountTypeDinersClub
case "eCheck":
*a = AccountTypeECheck
default:
return fmt.Errorf("invalid AccountTypeEnum : %q", string(data))
}
return nil
}
type CustomerProfileTypeEnum uint
const (
CustomerProfileRegular CustomerProfileTypeEnum = 1
CustomerProfileGuest CustomerProfileTypeEnum = 2
)
func (a CustomerProfileTypeEnum) MarshalJSON() ([]byte, error) {
switch a {
case CustomerProfileRegular:
return json.Marshal("regular")
case CustomerProfileGuest:
return json.Marshal("guest")
default:
return json.Marshal("null")
}
}
func (a *CustomerProfileTypeEnum) UnmarshalJSON(data []byte) error {
if len(data) == 0 {
return errors.New("invalid CustomerProfileTypeEnum (empty)")
}
switch string(data[1 : len(data)-1]) {
case "regular":
*a = CustomerProfileRegular
case "guest":
*a = CustomerProfileGuest
default:
return fmt.Errorf("invalid CustomerProfileTypeEnum : %q", string(data))
}
return nil
}
type MerchantInitTransReasonEnum uint
const (
ReasonResubmission MerchantInitTransReasonEnum = 1
ReasonDelayedCharg MerchantInitTransReasonEnum = 2
ReasonReauthorization MerchantInitTransReasonEnum = 3
ReasonNoShow MerchantInitTransReasonEnum = 4
)
func (a MerchantInitTransReasonEnum) MarshalJSON() ([]byte, error) {
switch a {
case ReasonResubmission:
return json.Marshal("resubmission")
case ReasonDelayedCharg:
return json.Marshal("delayedCharge")
case ReasonReauthorization:
return json.Marshal("reauthorization")
case ReasonNoShow:
return json.Marshal("noShow")
default:
return json.Marshal("null")
}
}
func (a *MerchantInitTransReasonEnum) UnmarshalJSON(data []byte) error {
if len(data) == 0 {
return errors.New("invalid MerchantInitTransReasonEnum (empty)")
}
switch string(data[1 : len(data)-1]) {
case "resubmission":
*a = ReasonResubmission
case "delayedCharge":
*a = ReasonDelayedCharg
case "reauthorization":
*a = ReasonReauthorization
case "noShow":
*a = ReasonNoShow
default:
return fmt.Errorf("invalid MerchantInitTransReasonEnum : %q", string(data))
}
return nil
}
type AfdsTransactionEnum uint
const (
AFSDApprove AfdsTransactionEnum = 1
ASFDDecline AfdsTransactionEnum = 2
)
func (a AfdsTransactionEnum) MarshalJSON() ([]byte, error) {
switch a {
case AFSDApprove:
return json.Marshal("approve")
case ASFDDecline:
return json.Marshal("decline")
default:
return json.Marshal("null")
}
}
func (a *AfdsTransactionEnum) UnmarshalJSON(data []byte) error {
if len(data) == 0 {
return errors.New("invalid AfdsTransactionEnum (empty)")
}
switch string(data[1 : len(data)-1]) {
case "approve":
*a = AFSDApprove
case "decline":
*a = ASFDDecline
default:
return fmt.Errorf("invalid AfdsTransactionEnum : %q", string(data))
}
return nil
}
type WebCheckOutTypeEnum uint
const (
WebCheckOutTypeEnumPAN WebCheckOutTypeEnum = 1
WebCheckOutTypeEnumTOKEN WebCheckOutTypeEnum = 2
)
func (a WebCheckOutTypeEnum) MarshalJSON() ([]byte, error) {
switch a {
case WebCheckOutTypeEnumPAN:
return json.Marshal("PAN")
case WebCheckOutTypeEnumTOKEN:
return json.Marshal("TOKEN")
default:
return json.Marshal("null")
}
}
func (a *WebCheckOutTypeEnum) UnmarshalJSON(data []byte) error {
if len(data) == 0 {
return errors.New("invalid WebCheckOutTypeEnum (empty)")
}
switch string(data[1 : len(data)-1]) {
case "PAN":
*a = WebCheckOutTypeEnumPAN
case "TOKEN":
*a = WebCheckOutTypeEnumTOKEN
default:
return fmt.Errorf("invalid WebCheckOutTypeEnum : %q", string(data))
}
return nil
}
type ARBSubscriptionStatusEnum uint
const (
ARBSubscriptionActive ARBSubscriptionStatusEnum = 1
ARBSubscriptionExpired ARBSubscriptionStatusEnum = 2
ARBSubscriptionSuspended ARBSubscriptionStatusEnum = 3
ARBSubscriptionCanceled ARBSubscriptionStatusEnum = 4
ARBSubscriptionTerminated ARBSubscriptionStatusEnum = 5
)
func (a ARBSubscriptionStatusEnum) MarshalJSON() ([]byte, error) {
switch a {
case ARBSubscriptionActive:
return json.Marshal("active")
case ARBSubscriptionExpired:
return json.Marshal("expired")
case ARBSubscriptionSuspended:
return json.Marshal("suspended")
case ARBSubscriptionCanceled:
return json.Marshal("canceled")
case ARBSubscriptionTerminated:
return json.Marshal("terminated")
default:
return json.Marshal("null")
}
}
func (a *ARBSubscriptionStatusEnum) UnmarshalJSON(data []byte) error {
if len(data) == 0 {
return errors.New("invalid ARBSubscriptionStatusEnum (empty)")
}
switch string(data[1 : len(data)-1]) {
case "active":
*a = ARBSubscriptionActive
case "expired":
*a = ARBSubscriptionExpired
case "suspended":
*a = ARBSubscriptionSuspended
case "canceled":
*a = ARBSubscriptionCanceled
case "terminated":
*a = ARBSubscriptionTerminated
default:
return fmt.Errorf("invalid ARBSubscriptionStatusEnum : %q", string(data))
}
return nil
}
type ValidationModeEnum uint
const (
ValidationModeNone ValidationModeEnum = 1
ValidationModeTestMode ValidationModeEnum = 2
ValidationModeLiveMode ValidationModeEnum = 3
ValidationModeOldLiveMode ValidationModeEnum = 4
)
func (a ValidationModeEnum) MarshalJSON() ([]byte, error) {
switch a {
case ValidationModeNone:
return json.Marshal("none")
case ValidationModeTestMode:
return json.Marshal("testMode")
case ValidationModeLiveMode:
return json.Marshal("liveMode")
case ValidationModeOldLiveMode:
return json.Marshal("oldLiveMode")
default:
return json.Marshal("null")
}
}
func (a *ValidationModeEnum) UnmarshalJSON(data []byte) error {
if len(data) == 0 {
return errors.New("invalid ValidationModeEnum (empty)")
}
switch string(data[1 : len(data)-1]) {
case "none":
*a = ValidationModeNone
case "testMode":
*a = ValidationModeTestMode
case "liveMode":
*a = ValidationModeLiveMode
case "oldLiveMode":
*a = ValidationModeOldLiveMode
default:
return fmt.Errorf("invalid ValidationModeEnum : %q", string(data))
}
return nil
}
type CustomerPaymentProfileSearchTypeEnum uint
const (
CardsExpiringInMonth CustomerPaymentProfileSearchTypeEnum = 1
)
func (a CustomerPaymentProfileSearchTypeEnum) MarshalJSON() ([]byte, error) {
switch a {
case CardsExpiringInMonth:
return json.Marshal("none")
default:
return json.Marshal("null")
}
}
func (a *CustomerPaymentProfileSearchTypeEnum) UnmarshalJSON(data []byte) error {
if len(data) == 0 {
return errors.New("invalid CustomerPaymentProfileSearchTypeEnum (empty)")
}
switch string(data[1 : len(data)-1]) {
case "none":
*a = CardsExpiringInMonth
default:
return fmt.Errorf("invalid CustomerPaymentProfileSearchTypeEnum : %q", string(data))
}
return nil
}
type SplitTenderStatusEnum uint
const (
SplitTenderCompleted SplitTenderStatusEnum = 1
SplitTenderHeld SplitTenderStatusEnum = 2
SplitTenderVoided SplitTenderStatusEnum = 3
)
func (a SplitTenderStatusEnum) MarshalJSON() ([]byte, error) {
switch a {
case SplitTenderCompleted:
return json.Marshal("completed")
case SplitTenderHeld:
return json.Marshal("held")
case SplitTenderVoided:
return json.Marshal("voided")
default:
return json.Marshal("null")
}
}
func (a *SplitTenderStatusEnum) UnmarshalJSON(data []byte) error {
if len(data) == 0 {
return errors.New("invalid SplitTenderStatusEnum (empty)")
}
switch string(data[1 : len(data)-1]) {
case "completed":
*a = SplitTenderCompleted
case "held":
*a = SplitTenderHeld
case "voided":
*a = SplitTenderVoided
default:
return fmt.Errorf("invalid SplitTenderStatusEnum : %q", string(data))
}
return nil
}
type SettingNameEnum uint
const (
SettingEmailCustomer SettingNameEnum = 1
SettingMerchantEmail SettingNameEnum = 2
SettingAllowPartialAuth SettingNameEnum = 3
SettingHeaderEmailReceipt SettingNameEnum = 4
SettingFooterEmailReceipt SettingNameEnum = 5
SettingRecurringBilling SettingNameEnum = 6
SettingDuplicateWindow SettingNameEnum = 7
SettingTestRequest SettingNameEnum = 8
SettingHostedProfileReturnUrl SettingNameEnum = 9
SettingHostedProfileReturnUrlText SettingNameEnum = 10
SettingHostedProfilePageBorderVisible SettingNameEnum = 11
SettingHostedProfileIFrameCommunicatorUrl SettingNameEnum = 12
SettingHostedProfileHeadingBgColor SettingNameEnum = 13
SettingHostedProfileValidationMode SettingNameEnum = 14
SettingHostedProfileBillingAddressRequired SettingNameEnum = 15
SettingHostedProfileCardCodeRequired SettingNameEnum = 16
SettingHostedProfileBillingAddressOptions SettingNameEnum = 17
SettingHostedProfileManageOptions SettingNameEnum = 18
SettingHostedPaymentIFrameCommunicatorUrl SettingNameEnum = 19
SettingHostedPaymentButtonOptions SettingNameEnum = 20
SettingHostedPaymentReturnOptions SettingNameEnum = 21
SettingHostedPaymentOrderOptions SettingNameEnum = 22
SettingHostedPaymentPaymentOptions SettingNameEnum = 23
SettingHostedPaymentBillingAddressOptions SettingNameEnum = 24
SettingHostedPaymentShippingAddressOptions SettingNameEnum = 25
SettingHostedPaymentSecurityOptions SettingNameEnum = 26
SettingHostedPaymentCustomerOptions SettingNameEnum = 27
SettingHostedPaymentStyleOptions SettingNameEnum = 28
SettingTypeEmailReceipt SettingNameEnum = 29
SettingHostedProfilePaymentOptions SettingNameEnum = 30
SettingHostedProfileSaveButtonText SettingNameEnum = 31
)
func (a SettingNameEnum) MarshalJSON() ([]byte, error) {
switch a {
case SettingEmailCustomer:
return json.Marshal("emailCustomer")
case SettingMerchantEmail:
return json.Marshal("merchantEmail")
case SettingAllowPartialAuth:
return json.Marshal("allowPartialAuth")
case SettingHeaderEmailReceipt:
return json.Marshal("headerEmailReceipt")
case SettingFooterEmailReceipt:
return json.Marshal("footerEmailReceipt")
case SettingRecurringBilling:
return json.Marshal("recurringBilling")
case SettingDuplicateWindow:
return json.Marshal("duplicateWindow")
case SettingTestRequest:
return json.Marshal("testRequest")
case SettingHostedProfileReturnUrl:
return json.Marshal("hostedProfileReturnUrl")
case SettingHostedProfileReturnUrlText:
return json.Marshal("hostedProfileReturnUrlText")
case SettingHostedProfilePageBorderVisible:
return json.Marshal("hostedProfilePageBorderVisible")
case SettingHostedProfileIFrameCommunicatorUrl:
return json.Marshal("hostedProfileIFrameCommunicatorUrl")
case SettingHostedProfileHeadingBgColor:
return json.Marshal("hostedProfileHeadingBgColor")
case SettingHostedProfileValidationMode:
return json.Marshal("hostedProfileValidationMode")
case SettingHostedProfileBillingAddressRequired:
return json.Marshal("hostedProfileBillingAddressRequired")
case SettingHostedProfileCardCodeRequired:
return json.Marshal("hostedProfileCardCodeRequired")
case SettingHostedProfileBillingAddressOptions:
return json.Marshal("hostedProfileBillingAddressOptions")
case SettingHostedProfileManageOptions:
return json.Marshal("hostedProfileManageOptions")
case SettingHostedPaymentIFrameCommunicatorUrl:
return json.Marshal("hostedPaymentIFrameCommunicatorUrl")
case SettingHostedPaymentButtonOptions:
return json.Marshal("hostedPaymentButtonOptions")
case SettingHostedPaymentReturnOptions:
return json.Marshal("hostedPaymentReturnOptions")
case SettingHostedPaymentOrderOptions:
return json.Marshal("hostedPaymentOrderOptions")
case SettingHostedPaymentPaymentOptions:
return json.Marshal("hostedPaymentPaymentOptions")
case SettingHostedPaymentBillingAddressOptions:
return json.Marshal("hostedPaymentBillingAddressOptions")
case SettingHostedPaymentShippingAddressOptions:
return json.Marshal("hostedPaymentShippingAddressOptions")
case SettingHostedPaymentSecurityOptions:
return json.Marshal("hostedPaymentSecurityOptions")
case SettingHostedPaymentCustomerOptions:
return json.Marshal("hostedPaymentCustomerOptions")
case SettingHostedPaymentStyleOptions:
return json.Marshal("hostedPaymentStyleOptions")
case SettingTypeEmailReceipt:
return json.Marshal("typeEmailReceipt")
case SettingHostedProfilePaymentOptions:
return json.Marshal("hostedProfilePaymentOptions")
case SettingHostedProfileSaveButtonText:
return json.Marshal("hostedProfileSaveButtonText")
default:
return json.Marshal("null")
}
}
func (a *SettingNameEnum) UnmarshalJSON(data []byte) error {
if len(data) == 0 {
return errors.New("invalid SettingNameEnum (empty)")
}
switch string(data[1 : len(data)-1]) {
case "emailCustomer":
*a = SettingEmailCustomer
case "merchantEmail":
*a = SettingMerchantEmail
case "allowPartialAuth":
*a = SettingAllowPartialAuth
case "headerEmailReceipt":
*a = SettingHeaderEmailReceipt
case "footerEmailReceipt":
*a = SettingFooterEmailReceipt
case "recurringBilling":
*a = SettingRecurringBilling
case "duplicateWindow":
*a = SettingDuplicateWindow
case "testRequest":
*a = SettingTestRequest
case "hostedProfileReturnUrl":
*a = SettingHostedProfileReturnUrl
case "hostedProfileReturnUrlText":
*a = SettingHostedProfileReturnUrlText
case "hostedProfilePageBorderVisible":
*a = SettingHostedProfilePageBorderVisible
case "hostedProfileIFrameCommunicatorUrl":
*a = SettingHostedProfileIFrameCommunicatorUrl
case "hostedProfileHeadingBgColor":
*a = SettingHostedProfileHeadingBgColor
case "hostedProfileValidationMode":
*a = SettingHostedProfileValidationMode
case "hostedProfileBillingAddressRequired":
*a = SettingHostedProfileBillingAddressRequired
case "hostedProfileCardCodeRequired":
*a = SettingHostedProfileCardCodeRequired
case "hostedProfileBillingAddressOptions":
*a = SettingHostedProfileBillingAddressOptions
case "hostedProfileManageOptions":
*a = SettingHostedProfileManageOptions
case "hostedPaymentIFrameCommunicatorUrl":
*a = SettingHostedPaymentIFrameCommunicatorUrl
case "hostedPaymentButtonOptions":
*a = SettingHostedPaymentButtonOptions
case "hostedPaymentReturnOptions":
*a = SettingHostedPaymentReturnOptions
case "hostedPaymentOrderOptions":
*a = SettingHostedPaymentOrderOptions
case "hostedPaymentPaymentOptions":
*a = SettingHostedPaymentPaymentOptions
case "hostedPaymentBillingAddressOptions":
*a = SettingHostedPaymentBillingAddressOptions
case "hostedPaymentShippingAddressOptions":
*a = SettingHostedPaymentShippingAddressOptions
case "hostedPaymentSecurityOptions":
*a = SettingHostedPaymentSecurityOptions
case "hostedPaymentCustomerOptions":
*a = SettingHostedPaymentCustomerOptions
case "hostedPaymentStyleOptions":
*a = SettingHostedPaymentStyleOptions
case "typeEmailReceipt":
*a = SettingTypeEmailReceipt
case "hostedProfilePaymentOptions":
*a = SettingHostedProfilePaymentOptions
case "hostedProfileSaveButtonText":
*a = SettingHostedProfileSaveButtonText
default:
return fmt.Errorf("invalid SettingNameEnum : %q", string(data))
}
return nil
}
type EncryptionAlgorithmType uint
const (
EncryptionAlgoTDES EncryptionAlgorithmType = 1
EncryptionAlgoAES EncryptionAlgorithmType = 2
EncryptionAlgoRSA EncryptionAlgorithmType = 3
)
func (a EncryptionAlgorithmType) MarshalJSON() ([]byte, error) {
switch a {
case EncryptionAlgoTDES:
return json.Marshal("TDES")
case EncryptionAlgoAES:
return json.Marshal("AES")
case EncryptionAlgoRSA:
return json.Marshal("RSA")
default:
return json.Marshal("null")
}
}
func (a *EncryptionAlgorithmType) UnmarshalJSON(data []byte) error {
if len(data) == 0 {
return errors.New("invalid EncryptionAlgorithmType (empty)")
}
switch string(data[1 : len(data)-1]) {
case "TDES":
*a = EncryptionAlgoTDES
case "AES":
*a = EncryptionAlgoAES
case "RSA":
*a = EncryptionAlgoRSA
default:
return fmt.Errorf("invalid EncryptionAlgorithmType : %q", string(data))
}
return nil
}
type FDSFilterActionEnum uint
const (
FDSFilterActionReject FDSFilterActionEnum = 1
FDSFilterActionDecline FDSFilterActionEnum = 2
FDSFilterActionHold FDSFilterActionEnum = 3
FDSFilterActionAuthAndHold FDSFilterActionEnum = 4
FDSFilterActionReport FDSFilterActionEnum = 5
)
func (a FDSFilterActionEnum) MarshalJSON() ([]byte, error) {
switch a {
case FDSFilterActionReject:
return json.Marshal("reject")
case FDSFilterActionDecline:
return json.Marshal("decline")
case FDSFilterActionHold:
return json.Marshal("hold")
case FDSFilterActionAuthAndHold:
return json.Marshal("authAndHold")
case FDSFilterActionReport:
return json.Marshal("report")
default:
return json.Marshal("null")
}
}
func (a *FDSFilterActionEnum) UnmarshalJSON(data []byte) error {
if len(data) == 0 {
return errors.New("invalid FDSFilterActionEnum (empty)")
}
switch string(data[1 : len(data)-1]) {
case "reject":
*a = FDSFilterActionReject
case "decline":
*a = FDSFilterActionDecline
case "hold":
*a = FDSFilterActionHold
case "authAndHold":
*a = FDSFilterActionAuthAndHold
case "report":
*a = FDSFilterActionReport
default:
return fmt.Errorf("invalid FDSFilterActionEnum : %q", string(data))
}
return nil
}
type PermissionsEnum uint
const (
PermissionAPIMerchantBasicReporting PermissionsEnum = 1
PermissionSubmitCharge PermissionsEnum = 2
PermissionSubmitRefund PermissionsEnum = 3
PermissionSubmitUpdate PermissionsEnum = 4
PermissionMobileAdmin PermissionsEnum = 5
)
func (a PermissionsEnum) MarshalJSON() ([]byte, error) {
switch a {
case PermissionAPIMerchantBasicReporting:
return json.Marshal("API_Merchant_BasicReporting")
case PermissionSubmitCharge:
return json.Marshal("Submit_Charge")
case PermissionSubmitRefund:
return json.Marshal("Submit_Refund")
case PermissionSubmitUpdate:
return json.Marshal("Submit_Update")
case PermissionMobileAdmin:
return json.Marshal("Mobile_Admin")
default:
return json.Marshal("null")
}
}
func (a *PermissionsEnum) UnmarshalJSON(data []byte) error {
if len(data) == 0 {
return errors.New("invalid PermissionsEnum (empty)")
}
switch string(data[1 : len(data)-1]) {
case "API_Merchant_BasicReporting":
*a = PermissionAPIMerchantBasicReporting
case "Submit_Charge":
*a = PermissionSubmitCharge
case "Submit_Refund":
*a = PermissionSubmitRefund
case "Submit_Update":
*a = PermissionSubmitUpdate
case "Mobile_Admin":
*a = PermissionMobileAdmin
default:
return fmt.Errorf("invalid PermissionsEnum : %q", string(data))
}
return nil
}
type OperationType uint
const (
OperationTypeDECRYPT OperationType = 1
)
func (a OperationType) MarshalJSON() ([]byte, error) {
switch a {
case OperationTypeDECRYPT:
return json.Marshal("DECRYPT")
default:
return json.Marshal("null")
}
}
func (a *OperationType) UnmarshalJSON(data []byte) error {
if len(data) == 0 {
return errors.New("invalid OperationType (empty)")
}
switch string(data[1 : len(data)-1]) {
case "DECRYPT":
*a = OperationTypeDECRYPT