-
Notifications
You must be signed in to change notification settings - Fork 1
/
payouts.go
2417 lines (2140 loc) · 75.3 KB
/
payouts.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
// This file was auto-generated by Fern from our API Definition.
package square
import (
json "encoding/json"
fmt "fmt"
internal "github.com/square/square-go-sdk/internal"
)
type PayoutsListEntriesRequest struct {
// The ID of the payout to retrieve the information for.
PayoutID string `json:"-" url:"-"`
// The order in which payout entries are listed.
SortOrder *SortOrder `json:"-" url:"sort_order,omitempty"`
// A pagination cursor returned by a previous call to this endpoint.
// Provide this cursor to retrieve the next set of results for the original query.
// For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).
// If request parameters change between requests, subsequent results may contain duplicates or missing records.
Cursor *string `json:"-" url:"cursor,omitempty"`
// The maximum number of results to be returned in a single page.
// It is possible to receive fewer results than the specified limit on a given page.
// The default value of 100 is also the maximum allowed value. If the provided value is
// greater than 100, it is ignored and the default value is used instead.
// Default: `100`
Limit *int `json:"-" url:"limit,omitempty"`
}
type PayoutsGetRequest struct {
// The ID of the payout to retrieve the information for.
PayoutID string `json:"-" url:"-"`
}
type PayoutsListRequest struct {
// The ID of the location for which to list the payouts.
// By default, payouts are returned for the default (main) location associated with the seller.
LocationID *string `json:"-" url:"location_id,omitempty"`
// If provided, only payouts with the given status are returned.
Status *PayoutStatus `json:"-" url:"status,omitempty"`
// The timestamp for the beginning of the payout creation time, in RFC 3339 format.
// Inclusive. Default: The current time minus one year.
BeginTime *string `json:"-" url:"begin_time,omitempty"`
// The timestamp for the end of the payout creation time, in RFC 3339 format.
// Default: The current time.
EndTime *string `json:"-" url:"end_time,omitempty"`
// The order in which payouts are listed.
SortOrder *SortOrder `json:"-" url:"sort_order,omitempty"`
// A pagination cursor returned by a previous call to this endpoint.
// Provide this cursor to retrieve the next set of results for the original query.
// For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).
// If request parameters change between requests, subsequent results may contain duplicates or missing records.
Cursor *string `json:"-" url:"cursor,omitempty"`
// The maximum number of results to be returned in a single page.
// It is possible to receive fewer results than the specified limit on a given page.
// The default value of 100 is also the maximum allowed value. If the provided value is
// greater than 100, it is ignored and the default value is used instead.
// Default: `100`
Limit *int `json:"-" url:"limit,omitempty"`
}
type ActivityType string
const (
ActivityTypeAdjustment ActivityType = "ADJUSTMENT"
ActivityTypeAppFeeRefund ActivityType = "APP_FEE_REFUND"
ActivityTypeAppFeeRevenue ActivityType = "APP_FEE_REVENUE"
ActivityTypeAutomaticSavings ActivityType = "AUTOMATIC_SAVINGS"
ActivityTypeAutomaticSavingsReversed ActivityType = "AUTOMATIC_SAVINGS_REVERSED"
ActivityTypeCharge ActivityType = "CHARGE"
ActivityTypeDepositFee ActivityType = "DEPOSIT_FEE"
ActivityTypeDepositFeeReversed ActivityType = "DEPOSIT_FEE_REVERSED"
ActivityTypeDispute ActivityType = "DISPUTE"
ActivityTypeEscheatment ActivityType = "ESCHEATMENT"
ActivityTypeFee ActivityType = "FEE"
ActivityTypeFreeProcessing ActivityType = "FREE_PROCESSING"
ActivityTypeHoldAdjustment ActivityType = "HOLD_ADJUSTMENT"
ActivityTypeInitialBalanceChange ActivityType = "INITIAL_BALANCE_CHANGE"
ActivityTypeMoneyTransfer ActivityType = "MONEY_TRANSFER"
ActivityTypeMoneyTransferReversal ActivityType = "MONEY_TRANSFER_REVERSAL"
ActivityTypeOpenDispute ActivityType = "OPEN_DISPUTE"
ActivityTypeOther ActivityType = "OTHER"
ActivityTypeOtherAdjustment ActivityType = "OTHER_ADJUSTMENT"
ActivityTypePaidServiceFee ActivityType = "PAID_SERVICE_FEE"
ActivityTypePaidServiceFeeRefund ActivityType = "PAID_SERVICE_FEE_REFUND"
ActivityTypeRedemptionCode ActivityType = "REDEMPTION_CODE"
ActivityTypeRefund ActivityType = "REFUND"
ActivityTypeReleaseAdjustment ActivityType = "RELEASE_ADJUSTMENT"
ActivityTypeReserveHold ActivityType = "RESERVE_HOLD"
ActivityTypeReserveRelease ActivityType = "RESERVE_RELEASE"
ActivityTypeReturnedPayout ActivityType = "RETURNED_PAYOUT"
ActivityTypeSquareCapitalPayment ActivityType = "SQUARE_CAPITAL_PAYMENT"
ActivityTypeSquareCapitalReversedPayment ActivityType = "SQUARE_CAPITAL_REVERSED_PAYMENT"
ActivityTypeSubscriptionFee ActivityType = "SUBSCRIPTION_FEE"
ActivityTypeSubscriptionFeePaidRefund ActivityType = "SUBSCRIPTION_FEE_PAID_REFUND"
ActivityTypeSubscriptionFeeRefund ActivityType = "SUBSCRIPTION_FEE_REFUND"
ActivityTypeTaxOnFee ActivityType = "TAX_ON_FEE"
ActivityTypeThirdPartyFee ActivityType = "THIRD_PARTY_FEE"
ActivityTypeThirdPartyFeeRefund ActivityType = "THIRD_PARTY_FEE_REFUND"
ActivityTypePayout ActivityType = "PAYOUT"
ActivityTypeAutomaticBitcoinConversions ActivityType = "AUTOMATIC_BITCOIN_CONVERSIONS"
ActivityTypeAutomaticBitcoinConversionsReversed ActivityType = "AUTOMATIC_BITCOIN_CONVERSIONS_REVERSED"
ActivityTypeCreditCardRepayment ActivityType = "CREDIT_CARD_REPAYMENT"
ActivityTypeCreditCardRepaymentReversed ActivityType = "CREDIT_CARD_REPAYMENT_REVERSED"
ActivityTypeLocalOffersCashback ActivityType = "LOCAL_OFFERS_CASHBACK"
ActivityTypeLocalOffersFee ActivityType = "LOCAL_OFFERS_FEE"
ActivityTypePercentageProcessingEnrollment ActivityType = "PERCENTAGE_PROCESSING_ENROLLMENT"
ActivityTypePercentageProcessingDeactivation ActivityType = "PERCENTAGE_PROCESSING_DEACTIVATION"
ActivityTypePercentageProcessingRepayment ActivityType = "PERCENTAGE_PROCESSING_REPAYMENT"
ActivityTypePercentageProcessingRepaymentReversed ActivityType = "PERCENTAGE_PROCESSING_REPAYMENT_REVERSED"
ActivityTypeProcessingFee ActivityType = "PROCESSING_FEE"
ActivityTypeProcessingFeeRefund ActivityType = "PROCESSING_FEE_REFUND"
ActivityTypeUndoProcessingFeeRefund ActivityType = "UNDO_PROCESSING_FEE_REFUND"
ActivityTypeGiftCardLoadFee ActivityType = "GIFT_CARD_LOAD_FEE"
ActivityTypeGiftCardLoadFeeRefund ActivityType = "GIFT_CARD_LOAD_FEE_REFUND"
ActivityTypeUndoGiftCardLoadFeeRefund ActivityType = "UNDO_GIFT_CARD_LOAD_FEE_REFUND"
ActivityTypeBalanceFoldersTransfer ActivityType = "BALANCE_FOLDERS_TRANSFER"
ActivityTypeBalanceFoldersTransferReversed ActivityType = "BALANCE_FOLDERS_TRANSFER_REVERSED"
ActivityTypeGiftCardPoolTransfer ActivityType = "GIFT_CARD_POOL_TRANSFER"
ActivityTypeGiftCardPoolTransferReversed ActivityType = "GIFT_CARD_POOL_TRANSFER_REVERSED"
ActivityTypeSquarePayrollTransfer ActivityType = "SQUARE_PAYROLL_TRANSFER"
ActivityTypeSquarePayrollTransferReversed ActivityType = "SQUARE_PAYROLL_TRANSFER_REVERSED"
)
func NewActivityTypeFromString(s string) (ActivityType, error) {
switch s {
case "ADJUSTMENT":
return ActivityTypeAdjustment, nil
case "APP_FEE_REFUND":
return ActivityTypeAppFeeRefund, nil
case "APP_FEE_REVENUE":
return ActivityTypeAppFeeRevenue, nil
case "AUTOMATIC_SAVINGS":
return ActivityTypeAutomaticSavings, nil
case "AUTOMATIC_SAVINGS_REVERSED":
return ActivityTypeAutomaticSavingsReversed, nil
case "CHARGE":
return ActivityTypeCharge, nil
case "DEPOSIT_FEE":
return ActivityTypeDepositFee, nil
case "DEPOSIT_FEE_REVERSED":
return ActivityTypeDepositFeeReversed, nil
case "DISPUTE":
return ActivityTypeDispute, nil
case "ESCHEATMENT":
return ActivityTypeEscheatment, nil
case "FEE":
return ActivityTypeFee, nil
case "FREE_PROCESSING":
return ActivityTypeFreeProcessing, nil
case "HOLD_ADJUSTMENT":
return ActivityTypeHoldAdjustment, nil
case "INITIAL_BALANCE_CHANGE":
return ActivityTypeInitialBalanceChange, nil
case "MONEY_TRANSFER":
return ActivityTypeMoneyTransfer, nil
case "MONEY_TRANSFER_REVERSAL":
return ActivityTypeMoneyTransferReversal, nil
case "OPEN_DISPUTE":
return ActivityTypeOpenDispute, nil
case "OTHER":
return ActivityTypeOther, nil
case "OTHER_ADJUSTMENT":
return ActivityTypeOtherAdjustment, nil
case "PAID_SERVICE_FEE":
return ActivityTypePaidServiceFee, nil
case "PAID_SERVICE_FEE_REFUND":
return ActivityTypePaidServiceFeeRefund, nil
case "REDEMPTION_CODE":
return ActivityTypeRedemptionCode, nil
case "REFUND":
return ActivityTypeRefund, nil
case "RELEASE_ADJUSTMENT":
return ActivityTypeReleaseAdjustment, nil
case "RESERVE_HOLD":
return ActivityTypeReserveHold, nil
case "RESERVE_RELEASE":
return ActivityTypeReserveRelease, nil
case "RETURNED_PAYOUT":
return ActivityTypeReturnedPayout, nil
case "SQUARE_CAPITAL_PAYMENT":
return ActivityTypeSquareCapitalPayment, nil
case "SQUARE_CAPITAL_REVERSED_PAYMENT":
return ActivityTypeSquareCapitalReversedPayment, nil
case "SUBSCRIPTION_FEE":
return ActivityTypeSubscriptionFee, nil
case "SUBSCRIPTION_FEE_PAID_REFUND":
return ActivityTypeSubscriptionFeePaidRefund, nil
case "SUBSCRIPTION_FEE_REFUND":
return ActivityTypeSubscriptionFeeRefund, nil
case "TAX_ON_FEE":
return ActivityTypeTaxOnFee, nil
case "THIRD_PARTY_FEE":
return ActivityTypeThirdPartyFee, nil
case "THIRD_PARTY_FEE_REFUND":
return ActivityTypeThirdPartyFeeRefund, nil
case "PAYOUT":
return ActivityTypePayout, nil
case "AUTOMATIC_BITCOIN_CONVERSIONS":
return ActivityTypeAutomaticBitcoinConversions, nil
case "AUTOMATIC_BITCOIN_CONVERSIONS_REVERSED":
return ActivityTypeAutomaticBitcoinConversionsReversed, nil
case "CREDIT_CARD_REPAYMENT":
return ActivityTypeCreditCardRepayment, nil
case "CREDIT_CARD_REPAYMENT_REVERSED":
return ActivityTypeCreditCardRepaymentReversed, nil
case "LOCAL_OFFERS_CASHBACK":
return ActivityTypeLocalOffersCashback, nil
case "LOCAL_OFFERS_FEE":
return ActivityTypeLocalOffersFee, nil
case "PERCENTAGE_PROCESSING_ENROLLMENT":
return ActivityTypePercentageProcessingEnrollment, nil
case "PERCENTAGE_PROCESSING_DEACTIVATION":
return ActivityTypePercentageProcessingDeactivation, nil
case "PERCENTAGE_PROCESSING_REPAYMENT":
return ActivityTypePercentageProcessingRepayment, nil
case "PERCENTAGE_PROCESSING_REPAYMENT_REVERSED":
return ActivityTypePercentageProcessingRepaymentReversed, nil
case "PROCESSING_FEE":
return ActivityTypeProcessingFee, nil
case "PROCESSING_FEE_REFUND":
return ActivityTypeProcessingFeeRefund, nil
case "UNDO_PROCESSING_FEE_REFUND":
return ActivityTypeUndoProcessingFeeRefund, nil
case "GIFT_CARD_LOAD_FEE":
return ActivityTypeGiftCardLoadFee, nil
case "GIFT_CARD_LOAD_FEE_REFUND":
return ActivityTypeGiftCardLoadFeeRefund, nil
case "UNDO_GIFT_CARD_LOAD_FEE_REFUND":
return ActivityTypeUndoGiftCardLoadFeeRefund, nil
case "BALANCE_FOLDERS_TRANSFER":
return ActivityTypeBalanceFoldersTransfer, nil
case "BALANCE_FOLDERS_TRANSFER_REVERSED":
return ActivityTypeBalanceFoldersTransferReversed, nil
case "GIFT_CARD_POOL_TRANSFER":
return ActivityTypeGiftCardPoolTransfer, nil
case "GIFT_CARD_POOL_TRANSFER_REVERSED":
return ActivityTypeGiftCardPoolTransferReversed, nil
case "SQUARE_PAYROLL_TRANSFER":
return ActivityTypeSquarePayrollTransfer, nil
case "SQUARE_PAYROLL_TRANSFER_REVERSED":
return ActivityTypeSquarePayrollTransferReversed, nil
}
var t ActivityType
return "", fmt.Errorf("%s is not a valid %T", s, t)
}
func (a ActivityType) Ptr() *ActivityType {
return &a
}
// Information about the destination against which the payout was made.
type Destination struct {
// Type of the destination such as a bank account or debit card.
// See [DestinationType](#type-destinationtype) for possible values
Type *DestinationType `json:"type,omitempty" url:"type,omitempty"`
// Square issued unique ID (also known as the instrument ID) associated with this destination.
ID *string `json:"id,omitempty" url:"id,omitempty"`
extraProperties map[string]interface{}
rawJSON json.RawMessage
}
func (d *Destination) GetType() *DestinationType {
if d == nil {
return nil
}
return d.Type
}
func (d *Destination) GetID() *string {
if d == nil {
return nil
}
return d.ID
}
func (d *Destination) GetExtraProperties() map[string]interface{} {
return d.extraProperties
}
func (d *Destination) UnmarshalJSON(data []byte) error {
type unmarshaler Destination
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*d = Destination(value)
extraProperties, err := internal.ExtractExtraProperties(data, *d)
if err != nil {
return err
}
d.extraProperties = extraProperties
d.rawJSON = json.RawMessage(data)
return nil
}
func (d *Destination) String() string {
if len(d.rawJSON) > 0 {
if value, err := internal.StringifyJSON(d.rawJSON); err == nil {
return value
}
}
if value, err := internal.StringifyJSON(d); err == nil {
return value
}
return fmt.Sprintf("%#v", d)
}
// List of possible destinations against which a payout can be made.
type DestinationType string
const (
DestinationTypeBankAccount DestinationType = "BANK_ACCOUNT"
DestinationTypeCard DestinationType = "CARD"
DestinationTypeSquareBalance DestinationType = "SQUARE_BALANCE"
DestinationTypeSquareStoredBalance DestinationType = "SQUARE_STORED_BALANCE"
)
func NewDestinationTypeFromString(s string) (DestinationType, error) {
switch s {
case "BANK_ACCOUNT":
return DestinationTypeBankAccount, nil
case "CARD":
return DestinationTypeCard, nil
case "SQUARE_BALANCE":
return DestinationTypeSquareBalance, nil
case "SQUARE_STORED_BALANCE":
return DestinationTypeSquareStoredBalance, nil
}
var t DestinationType
return "", fmt.Errorf("%s is not a valid %T", s, t)
}
func (d DestinationType) Ptr() *DestinationType {
return &d
}
type GetPayoutResponse struct {
// The requested payout.
Payout *Payout `json:"payout,omitempty" url:"payout,omitempty"`
// Information about errors encountered during the request.
Errors []*Error `json:"errors,omitempty" url:"errors,omitempty"`
extraProperties map[string]interface{}
rawJSON json.RawMessage
}
func (g *GetPayoutResponse) GetPayout() *Payout {
if g == nil {
return nil
}
return g.Payout
}
func (g *GetPayoutResponse) GetErrors() []*Error {
if g == nil {
return nil
}
return g.Errors
}
func (g *GetPayoutResponse) GetExtraProperties() map[string]interface{} {
return g.extraProperties
}
func (g *GetPayoutResponse) UnmarshalJSON(data []byte) error {
type unmarshaler GetPayoutResponse
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*g = GetPayoutResponse(value)
extraProperties, err := internal.ExtractExtraProperties(data, *g)
if err != nil {
return err
}
g.extraProperties = extraProperties
g.rawJSON = json.RawMessage(data)
return nil
}
func (g *GetPayoutResponse) String() string {
if len(g.rawJSON) > 0 {
if value, err := internal.StringifyJSON(g.rawJSON); err == nil {
return value
}
}
if value, err := internal.StringifyJSON(g); err == nil {
return value
}
return fmt.Sprintf("%#v", g)
}
// The response to retrieve payout records entries.
type ListPayoutEntriesResponse struct {
// The requested list of payout entries, ordered with the given or default sort order.
PayoutEntries []*PayoutEntry `json:"payout_entries,omitempty" url:"payout_entries,omitempty"`
// The pagination cursor to be used in a subsequent request. If empty, this is the final response.
// For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).
Cursor *string `json:"cursor,omitempty" url:"cursor,omitempty"`
// Information about errors encountered during the request.
Errors []*Error `json:"errors,omitempty" url:"errors,omitempty"`
extraProperties map[string]interface{}
rawJSON json.RawMessage
}
func (l *ListPayoutEntriesResponse) GetPayoutEntries() []*PayoutEntry {
if l == nil {
return nil
}
return l.PayoutEntries
}
func (l *ListPayoutEntriesResponse) GetCursor() *string {
if l == nil {
return nil
}
return l.Cursor
}
func (l *ListPayoutEntriesResponse) GetErrors() []*Error {
if l == nil {
return nil
}
return l.Errors
}
func (l *ListPayoutEntriesResponse) GetExtraProperties() map[string]interface{} {
return l.extraProperties
}
func (l *ListPayoutEntriesResponse) UnmarshalJSON(data []byte) error {
type unmarshaler ListPayoutEntriesResponse
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*l = ListPayoutEntriesResponse(value)
extraProperties, err := internal.ExtractExtraProperties(data, *l)
if err != nil {
return err
}
l.extraProperties = extraProperties
l.rawJSON = json.RawMessage(data)
return nil
}
func (l *ListPayoutEntriesResponse) String() string {
if len(l.rawJSON) > 0 {
if value, err := internal.StringifyJSON(l.rawJSON); err == nil {
return value
}
}
if value, err := internal.StringifyJSON(l); err == nil {
return value
}
return fmt.Sprintf("%#v", l)
}
// The response to retrieve payout records entries.
type ListPayoutsResponse struct {
// The requested list of payouts.
Payouts []*Payout `json:"payouts,omitempty" url:"payouts,omitempty"`
// The pagination cursor to be used in a subsequent request. If empty, this is the final response.
// For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).
Cursor *string `json:"cursor,omitempty" url:"cursor,omitempty"`
// Information about errors encountered during the request.
Errors []*Error `json:"errors,omitempty" url:"errors,omitempty"`
extraProperties map[string]interface{}
rawJSON json.RawMessage
}
func (l *ListPayoutsResponse) GetPayouts() []*Payout {
if l == nil {
return nil
}
return l.Payouts
}
func (l *ListPayoutsResponse) GetCursor() *string {
if l == nil {
return nil
}
return l.Cursor
}
func (l *ListPayoutsResponse) GetErrors() []*Error {
if l == nil {
return nil
}
return l.Errors
}
func (l *ListPayoutsResponse) GetExtraProperties() map[string]interface{} {
return l.extraProperties
}
func (l *ListPayoutsResponse) UnmarshalJSON(data []byte) error {
type unmarshaler ListPayoutsResponse
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*l = ListPayoutsResponse(value)
extraProperties, err := internal.ExtractExtraProperties(data, *l)
if err != nil {
return err
}
l.extraProperties = extraProperties
l.rawJSON = json.RawMessage(data)
return nil
}
func (l *ListPayoutsResponse) String() string {
if len(l.rawJSON) > 0 {
if value, err := internal.StringifyJSON(l.rawJSON); err == nil {
return value
}
}
if value, err := internal.StringifyJSON(l); err == nil {
return value
}
return fmt.Sprintf("%#v", l)
}
type PaymentBalanceActivityAppFeeRefundDetail struct {
// The ID of the payment associated with this activity.
PaymentID *string `json:"payment_id,omitempty" url:"payment_id,omitempty"`
// The ID of the refund associated with this activity.
RefundID *string `json:"refund_id,omitempty" url:"refund_id,omitempty"`
// The ID of the location of the merchant associated with the payment refund activity
LocationID *string `json:"location_id,omitempty" url:"location_id,omitempty"`
extraProperties map[string]interface{}
rawJSON json.RawMessage
}
func (p *PaymentBalanceActivityAppFeeRefundDetail) GetPaymentID() *string {
if p == nil {
return nil
}
return p.PaymentID
}
func (p *PaymentBalanceActivityAppFeeRefundDetail) GetRefundID() *string {
if p == nil {
return nil
}
return p.RefundID
}
func (p *PaymentBalanceActivityAppFeeRefundDetail) GetLocationID() *string {
if p == nil {
return nil
}
return p.LocationID
}
func (p *PaymentBalanceActivityAppFeeRefundDetail) GetExtraProperties() map[string]interface{} {
return p.extraProperties
}
func (p *PaymentBalanceActivityAppFeeRefundDetail) UnmarshalJSON(data []byte) error {
type unmarshaler PaymentBalanceActivityAppFeeRefundDetail
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*p = PaymentBalanceActivityAppFeeRefundDetail(value)
extraProperties, err := internal.ExtractExtraProperties(data, *p)
if err != nil {
return err
}
p.extraProperties = extraProperties
p.rawJSON = json.RawMessage(data)
return nil
}
func (p *PaymentBalanceActivityAppFeeRefundDetail) String() string {
if len(p.rawJSON) > 0 {
if value, err := internal.StringifyJSON(p.rawJSON); err == nil {
return value
}
}
if value, err := internal.StringifyJSON(p); err == nil {
return value
}
return fmt.Sprintf("%#v", p)
}
type PaymentBalanceActivityAppFeeRevenueDetail struct {
// The ID of the payment associated with this activity.
PaymentID *string `json:"payment_id,omitempty" url:"payment_id,omitempty"`
// The ID of the location of the merchant associated with the payment activity
LocationID *string `json:"location_id,omitempty" url:"location_id,omitempty"`
extraProperties map[string]interface{}
rawJSON json.RawMessage
}
func (p *PaymentBalanceActivityAppFeeRevenueDetail) GetPaymentID() *string {
if p == nil {
return nil
}
return p.PaymentID
}
func (p *PaymentBalanceActivityAppFeeRevenueDetail) GetLocationID() *string {
if p == nil {
return nil
}
return p.LocationID
}
func (p *PaymentBalanceActivityAppFeeRevenueDetail) GetExtraProperties() map[string]interface{} {
return p.extraProperties
}
func (p *PaymentBalanceActivityAppFeeRevenueDetail) UnmarshalJSON(data []byte) error {
type unmarshaler PaymentBalanceActivityAppFeeRevenueDetail
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*p = PaymentBalanceActivityAppFeeRevenueDetail(value)
extraProperties, err := internal.ExtractExtraProperties(data, *p)
if err != nil {
return err
}
p.extraProperties = extraProperties
p.rawJSON = json.RawMessage(data)
return nil
}
func (p *PaymentBalanceActivityAppFeeRevenueDetail) String() string {
if len(p.rawJSON) > 0 {
if value, err := internal.StringifyJSON(p.rawJSON); err == nil {
return value
}
}
if value, err := internal.StringifyJSON(p); err == nil {
return value
}
return fmt.Sprintf("%#v", p)
}
type PaymentBalanceActivityAutomaticSavingsDetail struct {
// The ID of the payment associated with this activity.
PaymentID *string `json:"payment_id,omitempty" url:"payment_id,omitempty"`
// The ID of the payout associated with this activity.
PayoutID *string `json:"payout_id,omitempty" url:"payout_id,omitempty"`
extraProperties map[string]interface{}
rawJSON json.RawMessage
}
func (p *PaymentBalanceActivityAutomaticSavingsDetail) GetPaymentID() *string {
if p == nil {
return nil
}
return p.PaymentID
}
func (p *PaymentBalanceActivityAutomaticSavingsDetail) GetPayoutID() *string {
if p == nil {
return nil
}
return p.PayoutID
}
func (p *PaymentBalanceActivityAutomaticSavingsDetail) GetExtraProperties() map[string]interface{} {
return p.extraProperties
}
func (p *PaymentBalanceActivityAutomaticSavingsDetail) UnmarshalJSON(data []byte) error {
type unmarshaler PaymentBalanceActivityAutomaticSavingsDetail
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*p = PaymentBalanceActivityAutomaticSavingsDetail(value)
extraProperties, err := internal.ExtractExtraProperties(data, *p)
if err != nil {
return err
}
p.extraProperties = extraProperties
p.rawJSON = json.RawMessage(data)
return nil
}
func (p *PaymentBalanceActivityAutomaticSavingsDetail) String() string {
if len(p.rawJSON) > 0 {
if value, err := internal.StringifyJSON(p.rawJSON); err == nil {
return value
}
}
if value, err := internal.StringifyJSON(p); err == nil {
return value
}
return fmt.Sprintf("%#v", p)
}
type PaymentBalanceActivityAutomaticSavingsReversedDetail struct {
// The ID of the payment associated with this activity.
PaymentID *string `json:"payment_id,omitempty" url:"payment_id,omitempty"`
// The ID of the payout associated with this activity.
PayoutID *string `json:"payout_id,omitempty" url:"payout_id,omitempty"`
extraProperties map[string]interface{}
rawJSON json.RawMessage
}
func (p *PaymentBalanceActivityAutomaticSavingsReversedDetail) GetPaymentID() *string {
if p == nil {
return nil
}
return p.PaymentID
}
func (p *PaymentBalanceActivityAutomaticSavingsReversedDetail) GetPayoutID() *string {
if p == nil {
return nil
}
return p.PayoutID
}
func (p *PaymentBalanceActivityAutomaticSavingsReversedDetail) GetExtraProperties() map[string]interface{} {
return p.extraProperties
}
func (p *PaymentBalanceActivityAutomaticSavingsReversedDetail) UnmarshalJSON(data []byte) error {
type unmarshaler PaymentBalanceActivityAutomaticSavingsReversedDetail
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*p = PaymentBalanceActivityAutomaticSavingsReversedDetail(value)
extraProperties, err := internal.ExtractExtraProperties(data, *p)
if err != nil {
return err
}
p.extraProperties = extraProperties
p.rawJSON = json.RawMessage(data)
return nil
}
func (p *PaymentBalanceActivityAutomaticSavingsReversedDetail) String() string {
if len(p.rawJSON) > 0 {
if value, err := internal.StringifyJSON(p.rawJSON); err == nil {
return value
}
}
if value, err := internal.StringifyJSON(p); err == nil {
return value
}
return fmt.Sprintf("%#v", p)
}
type PaymentBalanceActivityChargeDetail struct {
// The ID of the payment associated with this activity.
PaymentID *string `json:"payment_id,omitempty" url:"payment_id,omitempty"`
extraProperties map[string]interface{}
rawJSON json.RawMessage
}
func (p *PaymentBalanceActivityChargeDetail) GetPaymentID() *string {
if p == nil {
return nil
}
return p.PaymentID
}
func (p *PaymentBalanceActivityChargeDetail) GetExtraProperties() map[string]interface{} {
return p.extraProperties
}
func (p *PaymentBalanceActivityChargeDetail) UnmarshalJSON(data []byte) error {
type unmarshaler PaymentBalanceActivityChargeDetail
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*p = PaymentBalanceActivityChargeDetail(value)
extraProperties, err := internal.ExtractExtraProperties(data, *p)
if err != nil {
return err
}
p.extraProperties = extraProperties
p.rawJSON = json.RawMessage(data)
return nil
}
func (p *PaymentBalanceActivityChargeDetail) String() string {
if len(p.rawJSON) > 0 {
if value, err := internal.StringifyJSON(p.rawJSON); err == nil {
return value
}
}
if value, err := internal.StringifyJSON(p); err == nil {
return value
}
return fmt.Sprintf("%#v", p)
}
type PaymentBalanceActivityDepositFeeDetail struct {
// The ID of the payout that triggered this deposit fee activity.
PayoutID *string `json:"payout_id,omitempty" url:"payout_id,omitempty"`
extraProperties map[string]interface{}
rawJSON json.RawMessage
}
func (p *PaymentBalanceActivityDepositFeeDetail) GetPayoutID() *string {
if p == nil {
return nil
}
return p.PayoutID
}
func (p *PaymentBalanceActivityDepositFeeDetail) GetExtraProperties() map[string]interface{} {
return p.extraProperties
}
func (p *PaymentBalanceActivityDepositFeeDetail) UnmarshalJSON(data []byte) error {
type unmarshaler PaymentBalanceActivityDepositFeeDetail
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*p = PaymentBalanceActivityDepositFeeDetail(value)
extraProperties, err := internal.ExtractExtraProperties(data, *p)
if err != nil {
return err
}
p.extraProperties = extraProperties
p.rawJSON = json.RawMessage(data)
return nil
}
func (p *PaymentBalanceActivityDepositFeeDetail) String() string {
if len(p.rawJSON) > 0 {
if value, err := internal.StringifyJSON(p.rawJSON); err == nil {
return value
}
}
if value, err := internal.StringifyJSON(p); err == nil {
return value
}
return fmt.Sprintf("%#v", p)
}
type PaymentBalanceActivityDepositFeeReversedDetail struct {
// The ID of the payout that triggered this deposit fee activity.
PayoutID *string `json:"payout_id,omitempty" url:"payout_id,omitempty"`
extraProperties map[string]interface{}
rawJSON json.RawMessage
}
func (p *PaymentBalanceActivityDepositFeeReversedDetail) GetPayoutID() *string {
if p == nil {
return nil
}
return p.PayoutID
}
func (p *PaymentBalanceActivityDepositFeeReversedDetail) GetExtraProperties() map[string]interface{} {
return p.extraProperties
}
func (p *PaymentBalanceActivityDepositFeeReversedDetail) UnmarshalJSON(data []byte) error {
type unmarshaler PaymentBalanceActivityDepositFeeReversedDetail
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*p = PaymentBalanceActivityDepositFeeReversedDetail(value)
extraProperties, err := internal.ExtractExtraProperties(data, *p)
if err != nil {
return err
}
p.extraProperties = extraProperties
p.rawJSON = json.RawMessage(data)
return nil
}
func (p *PaymentBalanceActivityDepositFeeReversedDetail) String() string {
if len(p.rawJSON) > 0 {
if value, err := internal.StringifyJSON(p.rawJSON); err == nil {
return value
}
}
if value, err := internal.StringifyJSON(p); err == nil {
return value
}
return fmt.Sprintf("%#v", p)
}
type PaymentBalanceActivityDisputeDetail struct {
// The ID of the payment associated with this activity.
PaymentID *string `json:"payment_id,omitempty" url:"payment_id,omitempty"`
// The ID of the dispute associated with this activity.
DisputeID *string `json:"dispute_id,omitempty" url:"dispute_id,omitempty"`
extraProperties map[string]interface{}
rawJSON json.RawMessage
}
func (p *PaymentBalanceActivityDisputeDetail) GetPaymentID() *string {
if p == nil {
return nil
}
return p.PaymentID
}
func (p *PaymentBalanceActivityDisputeDetail) GetDisputeID() *string {
if p == nil {
return nil
}
return p.DisputeID
}
func (p *PaymentBalanceActivityDisputeDetail) GetExtraProperties() map[string]interface{} {
return p.extraProperties
}
func (p *PaymentBalanceActivityDisputeDetail) UnmarshalJSON(data []byte) error {
type unmarshaler PaymentBalanceActivityDisputeDetail
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*p = PaymentBalanceActivityDisputeDetail(value)
extraProperties, err := internal.ExtractExtraProperties(data, *p)
if err != nil {
return err
}
p.extraProperties = extraProperties
p.rawJSON = json.RawMessage(data)
return nil
}
func (p *PaymentBalanceActivityDisputeDetail) String() string {
if len(p.rawJSON) > 0 {
if value, err := internal.StringifyJSON(p.rawJSON); err == nil {
return value
}
}
if value, err := internal.StringifyJSON(p); err == nil {
return value
}
return fmt.Sprintf("%#v", p)
}
type PaymentBalanceActivityFeeDetail struct {
// The ID of the payment associated with this activity
// This will only be populated when a principal LedgerEntryToken is also populated.
// If the fee is independent (there is no principal LedgerEntryToken) then this will likely not
// be populated.
PaymentID *string `json:"payment_id,omitempty" url:"payment_id,omitempty"`
extraProperties map[string]interface{}
rawJSON json.RawMessage
}
func (p *PaymentBalanceActivityFeeDetail) GetPaymentID() *string {
if p == nil {
return nil
}
return p.PaymentID
}
func (p *PaymentBalanceActivityFeeDetail) GetExtraProperties() map[string]interface{} {
return p.extraProperties
}
func (p *PaymentBalanceActivityFeeDetail) UnmarshalJSON(data []byte) error {
type unmarshaler PaymentBalanceActivityFeeDetail
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*p = PaymentBalanceActivityFeeDetail(value)
extraProperties, err := internal.ExtractExtraProperties(data, *p)
if err != nil {
return err
}
p.extraProperties = extraProperties
p.rawJSON = json.RawMessage(data)
return nil
}
func (p *PaymentBalanceActivityFeeDetail) String() string {
if len(p.rawJSON) > 0 {
if value, err := internal.StringifyJSON(p.rawJSON); err == nil {
return value
}