-
Notifications
You must be signed in to change notification settings - Fork 2
/
shared.go
1647 lines (1499 loc) · 79.9 KB
/
shared.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
// Code generated by the Paddle SDK Generator; DO NOT EDIT.
package paddle
import (
"encoding/json"
"strings"
paddleerr "github.com/PaddleHQ/paddle-go-sdk/v3/pkg/paddleerr"
"github.com/PaddleHQ/paddle-go-sdk/v3/pkg/paddlenotification"
)
// ErrNotFound represents a `not_found` error.
// See https://developer.paddle.com/errors/shared/not_found for more information.
var ErrNotFound = &paddleerr.Error{
Code: "not_found",
Type: paddleerr.ErrorTypeRequestError,
}
// ErrInvalidURL represents a `invalid_url` error.
// See https://developer.paddle.com/errors/shared/invalid_url for more information.
var ErrInvalidURL = &paddleerr.Error{
Code: "invalid_url",
Type: paddleerr.ErrorTypeRequestError,
}
// ErrAuthenticationMissing represents a `authentication_missing` error.
// See https://developer.paddle.com/errors/shared/authentication_missing for more information.
var ErrAuthenticationMissing = &paddleerr.Error{
Code: "authentication_missing",
Type: paddleerr.ErrorTypeRequestError,
}
// ErrAuthenticationMalformed represents a `authentication_malformed` error.
// See https://developer.paddle.com/errors/shared/authentication_malformed for more information.
var ErrAuthenticationMalformed = &paddleerr.Error{
Code: "authentication_malformed",
Type: paddleerr.ErrorTypeRequestError,
}
// ErrInvalidToken represents a `invalid_token` error.
// See https://developer.paddle.com/errors/shared/invalid_token for more information.
var ErrInvalidToken = &paddleerr.Error{
Code: "invalid_token",
Type: paddleerr.ErrorTypeRequestError,
}
// ErrInvalidClientToken represents a `invalid_client_token` error.
// See https://developer.paddle.com/errors/shared/invalid_client_token for more information.
var ErrInvalidClientToken = &paddleerr.Error{
Code: "invalid_client_token",
Type: paddleerr.ErrorTypeRequestError,
}
// ErrPaddleBillingNotEnabled represents a `paddle_billing_not_enabled` error.
// See https://developer.paddle.com/errors/shared/paddle_billing_not_enabled for more information.
var ErrPaddleBillingNotEnabled = &paddleerr.Error{
Code: "paddle_billing_not_enabled",
Type: paddleerr.ErrorTypeRequestError,
}
// ErrForbidden represents a `forbidden` error.
// See https://developer.paddle.com/errors/shared/forbidden for more information.
var ErrForbidden = &paddleerr.Error{
Code: "forbidden",
Type: paddleerr.ErrorTypeRequestError,
}
// ErrBadRequest represents a `bad_request` error.
// See https://developer.paddle.com/errors/shared/bad_request for more information.
var ErrBadRequest = &paddleerr.Error{
Code: "bad_request",
Type: paddleerr.ErrorTypeRequestError,
}
// ErrInternalError represents a `internal_error` error.
// See https://developer.paddle.com/errors/shared/internal_error for more information.
var ErrInternalError = &paddleerr.Error{
Code: "internal_error",
Type: paddleerr.ErrorTypeAPIError,
}
// ErrServiceUnavailable represents a `service_unavailable` error.
// See https://developer.paddle.com/errors/shared/service_unavailable for more information.
var ErrServiceUnavailable = &paddleerr.Error{
Code: "service_unavailable",
Type: paddleerr.ErrorTypeAPIError,
}
// ErrMethodNotAllowed represents a `method_not_allowed` error.
// See https://developer.paddle.com/errors/shared/method_not_allowed for more information.
var ErrMethodNotAllowed = &paddleerr.Error{
Code: "method_not_allowed",
Type: paddleerr.ErrorTypeRequestError,
}
// ErrNotImplemented represents a `not_implemented` error.
// See https://developer.paddle.com/errors/shared/not_implemented for more information.
var ErrNotImplemented = &paddleerr.Error{
Code: "not_implemented",
Type: paddleerr.ErrorTypeAPIError,
}
// ErrBadGateway represents a `bad_gateway` error.
// See https://developer.paddle.com/errors/shared/bad_gateway for more information.
var ErrBadGateway = &paddleerr.Error{
Code: "bad_gateway",
Type: paddleerr.ErrorTypeAPIError,
}
// ErrTooManyRequests represents a `too_many_requests` error.
// See https://developer.paddle.com/errors/shared/too_many_requests for more information.
var ErrTooManyRequests = &paddleerr.Error{
Code: "too_many_requests",
Type: paddleerr.ErrorTypeAPIError,
}
// ErrTemporarilyUnavailable represents a `temporarily_unavailable` error.
// See https://developer.paddle.com/errors/shared/temporarily_unavailable for more information.
var ErrTemporarilyUnavailable = &paddleerr.Error{
Code: "temporarily_unavailable",
Type: paddleerr.ErrorTypeAPIError,
}
// ErrEntityArchived represents a `entity_archived` error.
// See https://developer.paddle.com/errors/shared/entity_archived for more information.
var ErrEntityArchived = &paddleerr.Error{
Code: "entity_archived",
Type: paddleerr.ErrorTypeRequestError,
}
// ErrInvalidField represents a `invalid_field` error.
// See https://developer.paddle.com/errors/shared/invalid_field for more information.
var ErrInvalidField = &paddleerr.Error{
Code: "invalid_field",
Type: paddleerr.ErrorTypeRequestError,
}
// ErrConcurrentModification represents a `concurrent_modification` error.
// See https://developer.paddle.com/errors/shared/concurrent_modification for more information.
var ErrConcurrentModification = &paddleerr.Error{
Code: "concurrent_modification",
Type: paddleerr.ErrorTypeRequestError,
}
// ErrConflict represents a `conflict` error.
// See https://developer.paddle.com/errors/shared/conflict for more information.
var ErrConflict = &paddleerr.Error{
Code: "conflict",
Type: paddleerr.ErrorTypeRequestError,
}
// ErrInvalidJson represents a `invalid_json` error.
// See https://developer.paddle.com/errors/shared/invalid_json for more information.
var ErrInvalidJson = &paddleerr.Error{
Code: "invalid_json",
Type: paddleerr.ErrorTypeRequestError,
}
// ErrUnexpectedRequestBody represents a `unexpected_request_body` error.
// See https://developer.paddle.com/errors/shared/unexpected_request_body for more information.
var ErrUnexpectedRequestBody = &paddleerr.Error{
Code: "unexpected_request_body",
Type: paddleerr.ErrorTypeRequestError,
}
// ErrInvalidTimeQueryParameter represents a `invalid_time_query_parameter` error.
// See https://developer.paddle.com/errors/shared/invalid_time_query_parameter for more information.
var ErrInvalidTimeQueryParameter = &paddleerr.Error{
Code: "invalid_time_query_parameter",
Type: paddleerr.ErrorTypeRequestError,
}
// ErrUnsupportedMediaType represents a `unsupported_media_type` error.
// See https://developer.paddle.com/errors/shared/unsupported_media_type for more information.
var ErrUnsupportedMediaType = &paddleerr.Error{
Code: "unsupported_media_type",
Type: paddleerr.ErrorTypeRequestError,
}
// ErrReceiptDataNotEnabled represents a `receipt_data_not_enabled` error.
// See https://developer.paddle.com/errors/shared/receipt_data_not_enabled for more information.
var ErrReceiptDataNotEnabled = &paddleerr.Error{
Code: "receipt_data_not_enabled",
Type: paddleerr.ErrorTypeRequestError,
}
// ErrRequestHeadersTooLarge represents a `request_headers_too_large` error.
// See https://developer.paddle.com/errors/shared/request_headers_too_large for more information.
var ErrRequestHeadersTooLarge = &paddleerr.Error{
Code: "request_headers_too_large",
Type: paddleerr.ErrorTypeRequestError,
}
// ErrRequestBodyTooLarge represents a `request_body_too_large` error.
// See https://developer.paddle.com/errors/shared/request_body_too_large for more information.
var ErrRequestBodyTooLarge = &paddleerr.Error{
Code: "request_body_too_large",
Type: paddleerr.ErrorTypeRequestError,
}
// CatalogType: Return items that match the specified type..
type CatalogType string
const (
CatalogTypeCustom CatalogType = "custom"
CatalogTypeStandard CatalogType = "standard"
)
// TaxCategory: Tax category for this product. Used for charging the correct rate of tax. Selected tax category must be enabled on your Paddle account..
type TaxCategory string
const (
TaxCategoryDigitalGoods TaxCategory = "digital-goods"
TaxCategoryEbooks TaxCategory = "ebooks"
TaxCategoryImplementationServices TaxCategory = "implementation-services"
TaxCategoryProfessionalServices TaxCategory = "professional-services"
TaxCategorySaas TaxCategory = "saas"
TaxCategorySoftwareProgrammingServices TaxCategory = "software-programming-services"
TaxCategoryStandard TaxCategory = "standard"
TaxCategoryTrainingServices TaxCategory = "training-services"
TaxCategoryWebsiteHosting TaxCategory = "website-hosting"
)
// CustomData: Your own structured key-value data.
type CustomData map[string]any
// Status: Whether this entity can be used in Paddle..
type Status string
const (
StatusActive Status = "active"
StatusArchived Status = "archived"
)
// ImportMeta: Import information for this entity. `null` if this entity is not imported.
type ImportMeta struct {
// ExternalID: Reference or identifier for this entity from the solution where it was imported from.
ExternalID *string `json:"external_id,omitempty"`
// ImportedFrom: Name of the platform where this entity was imported from.
ImportedFrom string `json:"imported_from,omitempty"`
}
// Interval: Unit of time..
type Interval string
const (
IntervalDay Interval = "day"
IntervalWeek Interval = "week"
IntervalMonth Interval = "month"
IntervalYear Interval = "year"
)
// Duration: How often this price should be charged. `null` if price is non-recurring (one-time).
type Duration struct {
// Interval: Unit of time.
Interval Interval `json:"interval,omitempty"`
// Frequency: Amount of time.
Frequency int `json:"frequency,omitempty"`
}
// TaxMode: How tax is calculated for this price..
type TaxMode string
const (
TaxModeAccountSetting TaxMode = "account_setting"
TaxModeExternal TaxMode = "external"
TaxModeInternal TaxMode = "internal"
)
// CurrencyCode: Supported three-letter ISO 4217 currency code..
type CurrencyCode string
const (
CurrencyCodeUSD CurrencyCode = "USD"
CurrencyCodeEUR CurrencyCode = "EUR"
CurrencyCodeGBP CurrencyCode = "GBP"
CurrencyCodeJPY CurrencyCode = "JPY"
CurrencyCodeAUD CurrencyCode = "AUD"
CurrencyCodeCAD CurrencyCode = "CAD"
CurrencyCodeCHF CurrencyCode = "CHF"
CurrencyCodeHKD CurrencyCode = "HKD"
CurrencyCodeSGD CurrencyCode = "SGD"
CurrencyCodeSEK CurrencyCode = "SEK"
CurrencyCodeARS CurrencyCode = "ARS"
CurrencyCodeBRL CurrencyCode = "BRL"
CurrencyCodeCNY CurrencyCode = "CNY"
CurrencyCodeCOP CurrencyCode = "COP"
CurrencyCodeCZK CurrencyCode = "CZK"
CurrencyCodeDKK CurrencyCode = "DKK"
CurrencyCodeHUF CurrencyCode = "HUF"
CurrencyCodeILS CurrencyCode = "ILS"
CurrencyCodeINR CurrencyCode = "INR"
CurrencyCodeKRW CurrencyCode = "KRW"
CurrencyCodeMXN CurrencyCode = "MXN"
CurrencyCodeNOK CurrencyCode = "NOK"
CurrencyCodeNZD CurrencyCode = "NZD"
CurrencyCodePLN CurrencyCode = "PLN"
CurrencyCodeRUB CurrencyCode = "RUB"
CurrencyCodeTHB CurrencyCode = "THB"
CurrencyCodeTRY CurrencyCode = "TRY"
CurrencyCodeTWD CurrencyCode = "TWD"
CurrencyCodeUAH CurrencyCode = "UAH"
CurrencyCodeVND CurrencyCode = "VND"
CurrencyCodeZAR CurrencyCode = "ZAR"
)
// Money: Base price. This price applies to all customers, except for customers located in countries where you have `unit_price_overrides`.
type Money struct {
// Amount: Amount in the lowest denomination for the currency, e.g. 10 USD = 1000 (cents). Although represented as a string, this value must be a valid integer.
Amount string `json:"amount,omitempty"`
// CurrencyCode: Supported three-letter ISO 4217 currency code.
CurrencyCode CurrencyCode `json:"currency_code,omitempty"`
}
// CountryCode: Supported two-letter ISO 3166-1 alpha-2 country code..
type CountryCode string
const (
CountryCodeAD CountryCode = "AD"
CountryCodeAE CountryCode = "AE"
CountryCodeAG CountryCode = "AG"
CountryCodeAI CountryCode = "AI"
CountryCodeAL CountryCode = "AL"
CountryCodeAM CountryCode = "AM"
CountryCodeAO CountryCode = "AO"
CountryCodeAR CountryCode = "AR"
CountryCodeAS CountryCode = "AS"
CountryCodeAT CountryCode = "AT"
CountryCodeAU CountryCode = "AU"
CountryCodeAW CountryCode = "AW"
CountryCodeAX CountryCode = "AX"
CountryCodeAZ CountryCode = "AZ"
CountryCodeBA CountryCode = "BA"
CountryCodeBB CountryCode = "BB"
CountryCodeBD CountryCode = "BD"
CountryCodeBE CountryCode = "BE"
CountryCodeBF CountryCode = "BF"
CountryCodeBG CountryCode = "BG"
CountryCodeBH CountryCode = "BH"
CountryCodeBI CountryCode = "BI"
CountryCodeBJ CountryCode = "BJ"
CountryCodeBL CountryCode = "BL"
CountryCodeBM CountryCode = "BM"
CountryCodeBN CountryCode = "BN"
CountryCodeBO CountryCode = "BO"
CountryCodeBQ CountryCode = "BQ"
CountryCodeBR CountryCode = "BR"
CountryCodeBS CountryCode = "BS"
CountryCodeBT CountryCode = "BT"
CountryCodeBV CountryCode = "BV"
CountryCodeBW CountryCode = "BW"
CountryCodeBZ CountryCode = "BZ"
CountryCodeCA CountryCode = "CA"
CountryCodeCC CountryCode = "CC"
CountryCodeCG CountryCode = "CG"
CountryCodeCH CountryCode = "CH"
CountryCodeCI CountryCode = "CI"
CountryCodeCK CountryCode = "CK"
CountryCodeCL CountryCode = "CL"
CountryCodeCM CountryCode = "CM"
CountryCodeCN CountryCode = "CN"
CountryCodeCO CountryCode = "CO"
CountryCodeCR CountryCode = "CR"
CountryCodeCV CountryCode = "CV"
CountryCodeCW CountryCode = "CW"
CountryCodeCX CountryCode = "CX"
CountryCodeCY CountryCode = "CY"
CountryCodeCZ CountryCode = "CZ"
CountryCodeDE CountryCode = "DE"
CountryCodeDJ CountryCode = "DJ"
CountryCodeDK CountryCode = "DK"
CountryCodeDM CountryCode = "DM"
CountryCodeDO CountryCode = "DO"
CountryCodeDZ CountryCode = "DZ"
CountryCodeEC CountryCode = "EC"
CountryCodeEE CountryCode = "EE"
CountryCodeEG CountryCode = "EG"
CountryCodeEH CountryCode = "EH"
CountryCodeER CountryCode = "ER"
CountryCodeES CountryCode = "ES"
CountryCodeET CountryCode = "ET"
CountryCodeFI CountryCode = "FI"
CountryCodeFJ CountryCode = "FJ"
CountryCodeFK CountryCode = "FK"
CountryCodeFM CountryCode = "FM"
CountryCodeFO CountryCode = "FO"
CountryCodeFR CountryCode = "FR"
CountryCodeGA CountryCode = "GA"
CountryCodeGB CountryCode = "GB"
CountryCodeGD CountryCode = "GD"
CountryCodeGE CountryCode = "GE"
CountryCodeGF CountryCode = "GF"
CountryCodeGG CountryCode = "GG"
CountryCodeGH CountryCode = "GH"
CountryCodeGI CountryCode = "GI"
CountryCodeGL CountryCode = "GL"
CountryCodeGM CountryCode = "GM"
CountryCodeGN CountryCode = "GN"
CountryCodeGP CountryCode = "GP"
CountryCodeGQ CountryCode = "GQ"
CountryCodeGR CountryCode = "GR"
CountryCodeGS CountryCode = "GS"
CountryCodeGT CountryCode = "GT"
CountryCodeGU CountryCode = "GU"
CountryCodeGW CountryCode = "GW"
CountryCodeGY CountryCode = "GY"
CountryCodeHK CountryCode = "HK"
CountryCodeHM CountryCode = "HM"
CountryCodeHN CountryCode = "HN"
CountryCodeHR CountryCode = "HR"
CountryCodeHU CountryCode = "HU"
CountryCodeID CountryCode = "ID"
CountryCodeIE CountryCode = "IE"
CountryCodeIL CountryCode = "IL"
CountryCodeIM CountryCode = "IM"
CountryCodeIN CountryCode = "IN"
CountryCodeIO CountryCode = "IO"
CountryCodeIQ CountryCode = "IQ"
CountryCodeIS CountryCode = "IS"
CountryCodeIT CountryCode = "IT"
CountryCodeJE CountryCode = "JE"
CountryCodeJM CountryCode = "JM"
CountryCodeJO CountryCode = "JO"
CountryCodeJP CountryCode = "JP"
CountryCodeKE CountryCode = "KE"
CountryCodeKG CountryCode = "KG"
CountryCodeKH CountryCode = "KH"
CountryCodeKI CountryCode = "KI"
CountryCodeKM CountryCode = "KM"
CountryCodeKN CountryCode = "KN"
CountryCodeKR CountryCode = "KR"
CountryCodeKW CountryCode = "KW"
CountryCodeKY CountryCode = "KY"
CountryCodeKZ CountryCode = "KZ"
CountryCodeLA CountryCode = "LA"
CountryCodeLB CountryCode = "LB"
CountryCodeLC CountryCode = "LC"
CountryCodeLI CountryCode = "LI"
CountryCodeLK CountryCode = "LK"
CountryCodeLR CountryCode = "LR"
CountryCodeLS CountryCode = "LS"
CountryCodeLT CountryCode = "LT"
CountryCodeLU CountryCode = "LU"
CountryCodeLV CountryCode = "LV"
CountryCodeMA CountryCode = "MA"
CountryCodeMC CountryCode = "MC"
CountryCodeMD CountryCode = "MD"
CountryCodeME CountryCode = "ME"
CountryCodeMF CountryCode = "MF"
CountryCodeMG CountryCode = "MG"
CountryCodeMH CountryCode = "MH"
CountryCodeMK CountryCode = "MK"
CountryCodeMN CountryCode = "MN"
CountryCodeMO CountryCode = "MO"
CountryCodeMP CountryCode = "MP"
CountryCodeMQ CountryCode = "MQ"
CountryCodeMR CountryCode = "MR"
CountryCodeMS CountryCode = "MS"
CountryCodeMT CountryCode = "MT"
CountryCodeMU CountryCode = "MU"
CountryCodeMV CountryCode = "MV"
CountryCodeMW CountryCode = "MW"
CountryCodeMX CountryCode = "MX"
CountryCodeMY CountryCode = "MY"
CountryCodeMZ CountryCode = "MZ"
CountryCodeNA CountryCode = "NA"
CountryCodeNC CountryCode = "NC"
CountryCodeNE CountryCode = "NE"
CountryCodeNF CountryCode = "NF"
CountryCodeNG CountryCode = "NG"
CountryCodeNL CountryCode = "NL"
CountryCodeNO CountryCode = "NO"
CountryCodeNP CountryCode = "NP"
CountryCodeNR CountryCode = "NR"
CountryCodeNU CountryCode = "NU"
CountryCodeNZ CountryCode = "NZ"
CountryCodeOM CountryCode = "OM"
CountryCodePA CountryCode = "PA"
CountryCodePE CountryCode = "PE"
CountryCodePF CountryCode = "PF"
CountryCodePG CountryCode = "PG"
CountryCodePH CountryCode = "PH"
CountryCodePK CountryCode = "PK"
CountryCodePL CountryCode = "PL"
CountryCodePM CountryCode = "PM"
CountryCodePN CountryCode = "PN"
CountryCodePR CountryCode = "PR"
CountryCodePS CountryCode = "PS"
CountryCodePT CountryCode = "PT"
CountryCodePW CountryCode = "PW"
CountryCodePY CountryCode = "PY"
CountryCodeQA CountryCode = "QA"
CountryCodeRE CountryCode = "RE"
CountryCodeRO CountryCode = "RO"
CountryCodeRS CountryCode = "RS"
CountryCodeRW CountryCode = "RW"
CountryCodeSA CountryCode = "SA"
CountryCodeSB CountryCode = "SB"
CountryCodeSC CountryCode = "SC"
CountryCodeSE CountryCode = "SE"
CountryCodeSG CountryCode = "SG"
CountryCodeSH CountryCode = "SH"
CountryCodeSI CountryCode = "SI"
CountryCodeSJ CountryCode = "SJ"
CountryCodeSK CountryCode = "SK"
CountryCodeSL CountryCode = "SL"
CountryCodeSM CountryCode = "SM"
CountryCodeSN CountryCode = "SN"
CountryCodeSR CountryCode = "SR"
CountryCodeST CountryCode = "ST"
CountryCodeSV CountryCode = "SV"
CountryCodeSX CountryCode = "SX"
CountryCodeSZ CountryCode = "SZ"
CountryCodeTC CountryCode = "TC"
CountryCodeTD CountryCode = "TD"
CountryCodeTF CountryCode = "TF"
CountryCodeTG CountryCode = "TG"
CountryCodeTH CountryCode = "TH"
CountryCodeTJ CountryCode = "TJ"
CountryCodeTK CountryCode = "TK"
CountryCodeTL CountryCode = "TL"
CountryCodeTM CountryCode = "TM"
CountryCodeTN CountryCode = "TN"
CountryCodeTO CountryCode = "TO"
CountryCodeTR CountryCode = "TR"
CountryCodeTT CountryCode = "TT"
CountryCodeTV CountryCode = "TV"
CountryCodeTW CountryCode = "TW"
CountryCodeTZ CountryCode = "TZ"
CountryCodeUA CountryCode = "UA"
CountryCodeUG CountryCode = "UG"
CountryCodeUM CountryCode = "UM"
CountryCodeUS CountryCode = "US"
CountryCodeUY CountryCode = "UY"
CountryCodeUZ CountryCode = "UZ"
CountryCodeVA CountryCode = "VA"
CountryCodeVC CountryCode = "VC"
CountryCodeVG CountryCode = "VG"
CountryCodeVI CountryCode = "VI"
CountryCodeVN CountryCode = "VN"
CountryCodeVU CountryCode = "VU"
CountryCodeWF CountryCode = "WF"
CountryCodeWS CountryCode = "WS"
CountryCodeXK CountryCode = "XK"
CountryCodeYT CountryCode = "YT"
CountryCodeZA CountryCode = "ZA"
CountryCodeZM CountryCode = "ZM"
)
// UnitPriceOverride: List of unit price overrides. Use to override the base price with a custom price and currency for a country or group of countries.
type UnitPriceOverride struct {
// CountryCodes: Supported two-letter ISO 3166-1 alpha-2 country code.
CountryCodes []CountryCode `json:"country_codes,omitempty"`
// UnitPrice: Override price. This price applies to customers located in the countries for this unit price override.
UnitPrice Money `json:"unit_price,omitempty"`
}
// PriceQuantity: Limits on how many times the related product can be purchased at this price. Useful for discount campaigns.
type PriceQuantity struct {
// Minimum: Minimum quantity of the product related to this price that can be bought. Required if `maximum` set.
Minimum int `json:"minimum,omitempty"`
// Maximum: Maximum quantity of the product related to this price that can be bought. Required if `minimum` set. Must be greater than or equal to the `minimum` value.
Maximum int `json:"maximum,omitempty"`
}
// Pagination: Keys used for working with paginated results.
type Pagination struct {
// PerPage: Number of entities per page for this response. May differ from the number requested if the requested number is greater than the maximum.
PerPage int `json:"per_page,omitempty"`
// Next: URL containing the query parameters of the original request, along with the `after` parameter that marks the starting point of the next page. Always returned, even if `has_more` is `false`.
Next string `json:"next,omitempty"`
// HasMore: Whether this response has another page.
HasMore bool `json:"has_more,omitempty"`
// EstimatedTotal: Estimated number of entities for this response.
EstimatedTotal int `json:"estimated_total,omitempty"`
}
// MetaPaginated: Information about this response.
type MetaPaginated struct {
// RequestID: Unique ID for the request relating to this response. Provide this when contacting Paddle support about a specific request.
RequestID string `json:"request_id,omitempty"`
// Pagination: Keys used for working with paginated results.
Pagination Pagination `json:"pagination,omitempty"`
}
// Meta: Information about this response.
type Meta struct {
// RequestID: Unique ID for the request relating to this response. Provide this when contacting Paddle support about a specific request.
RequestID string `json:"request_id,omitempty"`
}
// CollectionMode: Return entities that match the specified collection mode..
type CollectionMode string
const (
CollectionModeAutomatic CollectionMode = "automatic"
CollectionModeManual CollectionMode = "manual"
)
// TransactionStatus: Status of this transaction. You may set a transaction to `billed` or `canceled`, other statuses are set automatically by Paddle. Automatically-collected transactions may return `completed` if payment is captured successfully, or `past_due` if payment failed..
type TransactionStatus string
const (
TransactionStatusDraft TransactionStatus = "draft"
TransactionStatusReady TransactionStatus = "ready"
TransactionStatusBilled TransactionStatus = "billed"
TransactionStatusPaid TransactionStatus = "paid"
TransactionStatusCompleted TransactionStatus = "completed"
TransactionStatusCanceled TransactionStatus = "canceled"
TransactionStatusPastDue TransactionStatus = "past_due"
)
// TransactionOrigin: Describes how this transaction was created..
type TransactionOrigin string
const (
TransactionOriginAPI TransactionOrigin = "api"
TransactionOriginSubscriptionCharge TransactionOrigin = "subscription_charge"
TransactionOriginSubscriptionPaymentMethodChange TransactionOrigin = "subscription_payment_method_change"
TransactionOriginSubscriptionRecurring TransactionOrigin = "subscription_recurring"
TransactionOriginSubscriptionUpdate TransactionOrigin = "subscription_update"
TransactionOriginWeb TransactionOrigin = "web"
)
// BillingDetails: Details for invoicing. Required if `collection_mode` is `manual`.
type BillingDetails struct {
// EnableCheckout: Whether the related transaction may be paid using a Paddle Checkout. If omitted when creating a transaction, defaults to `false`.
EnableCheckout bool `json:"enable_checkout,omitempty"`
// PurchaseOrderNumber: Customer purchase order number. Appears on invoice documents.
PurchaseOrderNumber string `json:"purchase_order_number,omitempty"`
// AdditionalInformation: Notes or other information to include on this invoice. Appears on invoice documents.
AdditionalInformation *string `json:"additional_information,omitempty"`
// PaymentTerms: How long a customer has to pay this invoice once issued.
PaymentTerms Duration `json:"payment_terms,omitempty"`
}
// TimePeriod: Time period that this transaction is for. Set automatically by Paddle for subscription renewals to describe the period that charges are for.
type TimePeriod struct {
// StartsAt: RFC 3339 datetime string of when this period starts.
StartsAt string `json:"starts_at,omitempty"`
// EndsAt: RFC 3339 datetime string of when this period ends.
EndsAt string `json:"ends_at,omitempty"`
}
// Proration: How proration was calculated for this item. Populated when a transaction is created from a subscription change, where `proration_billing_mode` was `prorated_immediately` or `prorated_next_billing_period`. Set automatically by Paddle.
type Proration struct {
// Rate: Rate used to calculate proration.
Rate string `json:"rate,omitempty"`
// BillingPeriod: Billing period that proration is based on.
BillingPeriod TimePeriod `json:"billing_period,omitempty"`
}
// TransactionItem: List of items on this transaction. For calculated totals, use `details.line_items`.
type TransactionItem struct {
// PriceID: Paddle ID for the price to add to this transaction, prefixed with `pri_`.
PriceID string `json:"price_id,omitempty"`
// Price: Represents a price entity.
Price Price `json:"price,omitempty"`
// Quantity: Quantity of this item on the transaction.
Quantity int `json:"quantity,omitempty"`
// Proration: How proration was calculated for this item. Populated when a transaction is created from a subscription change, where `proration_billing_mode` was `prorated_immediately` or `prorated_next_billing_period`. Set automatically by Paddle.
Proration *Proration `json:"proration,omitempty"`
}
// Totals: Calculated totals for the tax applied to this transaction.
type Totals struct {
// Subtotal: Subtotal before discount, tax, and deductions. If an item, unit price multiplied by quantity.
Subtotal string `json:"subtotal,omitempty"`
/*
Discount: Total discount as a result of any discounts applied.
Except for percentage discounts, Paddle applies tax to discounts based on the line item `price.tax_mode`. If `price.tax_mode` for a line item is `internal`, Paddle removes tax from the discount applied.
*/
Discount string `json:"discount,omitempty"`
// Tax: Total tax on the subtotal.
Tax string `json:"tax,omitempty"`
// Total: Total after discount and tax.
Total string `json:"total,omitempty"`
}
// TaxRatesUsed: List of tax rates applied for this transaction.
type TaxRatesUsed struct {
// TaxRate: Rate used to calculate tax for this transaction.
TaxRate string `json:"tax_rate,omitempty"`
// Totals: Calculated totals for the tax applied to this transaction.
Totals Totals `json:"totals,omitempty"`
}
// TransactionTotals: Breakdown of the total for a transaction. These numbers can become negative when dealing with subscription updates that result in credit.
type TransactionTotals struct {
// Subtotal: Subtotal before discount, tax, and deductions. If an item, unit price multiplied by quantity.
Subtotal string `json:"subtotal,omitempty"`
/*
Discount: Total discount as a result of any discounts applied.
Except for percentage discounts, Paddle applies tax to discounts based on the line item `price.tax_mode`. If `price.tax_mode` for a line item is `internal`, Paddle removes tax from the discount applied.
*/
Discount string `json:"discount,omitempty"`
// Tax: Total tax on the subtotal.
Tax string `json:"tax,omitempty"`
// Total: Total after discount and tax.
Total string `json:"total,omitempty"`
// Credit: Total credit applied to this transaction. This includes credits applied using a customer's credit balance and adjustments to a `billed` transaction.
Credit string `json:"credit,omitempty"`
// CreditToBalance: Additional credit generated from negative `details.line_items`. This credit is added to the customer balance.
CreditToBalance string `json:"credit_to_balance,omitempty"`
// Balance: Total due on a transaction after credits and any payments.
Balance string `json:"balance,omitempty"`
// GrandTotal: Total due on a transaction after credits but before any payments.
GrandTotal string `json:"grand_total,omitempty"`
// Fee: Total fee taken by Paddle for this transaction. `null` until the transaction is `completed` and the fee is processed.
Fee *string `json:"fee,omitempty"`
// Earnings: Total earnings for this transaction. This is the total minus the Paddle fee. `null` until the transaction is `completed` and the fee is processed.
Earnings *string `json:"earnings,omitempty"`
// CurrencyCode: Three-letter ISO 4217 currency code of the currency used for this transaction.
CurrencyCode CurrencyCode `json:"currency_code,omitempty"`
}
// TransactionTotalsAdjusted: Breakdown of the payout totals for a transaction after adjustments. `null` until the transaction is `completed`.
type TransactionTotalsAdjusted struct {
// Subtotal: Subtotal before discount, tax, and deductions. If an item, unit price multiplied by quantity.
Subtotal string `json:"subtotal,omitempty"`
// Tax: Total tax on the subtotal.
Tax string `json:"tax,omitempty"`
// Total: Total after tax.
Total string `json:"total,omitempty"`
// GrandTotal: Total due after credits but before any payments.
GrandTotal string `json:"grand_total,omitempty"`
// Fee: Total fee taken by Paddle for this transaction. `null` until the transaction is `completed` and the fee is processed.
Fee *string `json:"fee,omitempty"`
/*
Earnings: Total earnings for this transaction. This is the total minus the Paddle fee.
`null` until the transaction is `completed` and the fee is processed.
*/
Earnings *string `json:"earnings,omitempty"`
// CurrencyCode: Three-letter ISO 4217 currency code of the currency used for this transaction.
CurrencyCode CurrencyCode `json:"currency_code,omitempty"`
}
// CurrencyCodePayouts: Three-letter ISO 4217 currency code used for the payout for this transaction. If your primary currency has changed, this reflects the primary currency at the time the transaction was billed..
type CurrencyCodePayouts string
const (
CurrencyCodePayoutsAUD CurrencyCodePayouts = "AUD"
CurrencyCodePayoutsCAD CurrencyCodePayouts = "CAD"
CurrencyCodePayoutsCHF CurrencyCodePayouts = "CHF"
CurrencyCodePayoutsCNY CurrencyCodePayouts = "CNY"
CurrencyCodePayoutsCZK CurrencyCodePayouts = "CZK"
CurrencyCodePayoutsDKK CurrencyCodePayouts = "DKK"
CurrencyCodePayoutsEUR CurrencyCodePayouts = "EUR"
CurrencyCodePayoutsGBP CurrencyCodePayouts = "GBP"
CurrencyCodePayoutsHUF CurrencyCodePayouts = "HUF"
CurrencyCodePayoutsPLN CurrencyCodePayouts = "PLN"
CurrencyCodePayoutsSEK CurrencyCodePayouts = "SEK"
CurrencyCodePayoutsUSD CurrencyCodePayouts = "USD"
CurrencyCodePayoutsZAR CurrencyCodePayouts = "ZAR"
)
// TransactionPayoutTotals: Breakdown of the payout total for a transaction. `null` until the transaction is `completed`. Returned in your payout currency.
type TransactionPayoutTotals struct {
// Subtotal: Total before tax and fees.
Subtotal string `json:"subtotal,omitempty"`
/*
Discount: Total discount as a result of any discounts applied.
Except for percentage discounts, Paddle applies tax to discounts based on the line item `price.tax_mode`. If `price.tax_mode` for a line item is `internal`, Paddle removes tax from the discount applied.
*/
Discount string `json:"discount,omitempty"`
// Tax: Total tax on the subtotal.
Tax string `json:"tax,omitempty"`
// Total: Total after tax.
Total string `json:"total,omitempty"`
// Credit: Total credit applied to this transaction. This includes credits applied using a customer's credit balance and adjustments to a `billed` transaction.
Credit string `json:"credit,omitempty"`
// CreditToBalance: Additional credit generated from negative `details.line_items`. This credit is added to the customer balance.
CreditToBalance string `json:"credit_to_balance,omitempty"`
// Balance: Total due on a transaction after credits and any payments.
Balance string `json:"balance,omitempty"`
// GrandTotal: Total due on a transaction after credits but before any payments.
GrandTotal string `json:"grand_total,omitempty"`
// Fee: Total fee taken by Paddle for this payout.
Fee string `json:"fee,omitempty"`
// Earnings: Total earnings for this payout. This is the subtotal minus the Paddle fee.
Earnings string `json:"earnings,omitempty"`
// CurrencyCode: Three-letter ISO 4217 currency code used for the payout for this transaction. If your primary currency has changed, this reflects the primary currency at the time the transaction was billed.
CurrencyCode CurrencyCodePayouts `json:"currency_code,omitempty"`
}
// CurrencyCodeChargebacks: Three-letter ISO 4217 currency code for the original chargeback fee..
type CurrencyCodeChargebacks string
const (
CurrencyCodeChargebacksAUD CurrencyCodeChargebacks = "AUD"
CurrencyCodeChargebacksCAD CurrencyCodeChargebacks = "CAD"
CurrencyCodeChargebacksEUR CurrencyCodeChargebacks = "EUR"
CurrencyCodeChargebacksGBP CurrencyCodeChargebacks = "GBP"
CurrencyCodeChargebacksUSD CurrencyCodeChargebacks = "USD"
)
// Original: Chargeback fee before conversion to the payout currency. `null` when the chargeback fee is the same as the payout currency.
type Original struct {
// Amount: Fee amount for this chargeback in the original currency.
Amount string `json:"amount,omitempty"`
// CurrencyCode: Three-letter ISO 4217 currency code for the original chargeback fee.
CurrencyCode CurrencyCodeChargebacks `json:"currency_code,omitempty"`
}
// ChargebackFee: Details of any chargeback fees incurred for this transaction.
type ChargebackFee struct {
// Amount: Chargeback fee converted into the payout currency.
Amount string `json:"amount,omitempty"`
// Original: Chargeback fee before conversion to the payout currency. `null` when the chargeback fee is the same as the payout currency.
Original *Original `json:"original,omitempty"`
}
// TransactionPayoutTotalsAdjusted: Breakdown of the payout total for a transaction after adjustments. `null` until the transaction is `completed`.
type TransactionPayoutTotalsAdjusted struct {
// Subtotal: Total before tax and fees.
Subtotal string `json:"subtotal,omitempty"`
// Tax: Total tax on the subtotal.
Tax string `json:"tax,omitempty"`
// Total: Total after tax.
Total string `json:"total,omitempty"`
// Fee: Total fee taken by Paddle for this payout.
Fee string `json:"fee,omitempty"`
// ChargebackFee: Details of any chargeback fees incurred for this transaction.
ChargebackFee ChargebackFee `json:"chargeback_fee,omitempty"`
// Earnings: Total earnings for this payout. This is the subtotal minus the Paddle fee, excluding chargeback fees.
Earnings string `json:"earnings,omitempty"`
// CurrencyCode: Three-letter ISO 4217 currency code used for the payout for this transaction. If your primary currency has changed, this reflects the primary currency at the time the transaction was billed.
CurrencyCode CurrencyCodePayouts `json:"currency_code,omitempty"`
}
// TransactionLineItem: Information about line items for this transaction. Different from transaction `items` as they include totals calculated by Paddle. Considered the source of truth for line item totals.
type TransactionLineItem struct {
// ID: Unique Paddle ID for this transaction item, prefixed with `txnitm_`. Used when working with [adjustments](https://developer.paddle.com/build/transactions/create-transaction-adjustments).
ID string `json:"id,omitempty"`
// PriceID: Paddle ID for the price related to this transaction line item, prefixed with `pri_`.
PriceID string `json:"price_id,omitempty"`
// Quantity: Quantity of this transaction line item.
Quantity int `json:"quantity,omitempty"`
// Proration: How proration was calculated for this item. Populated when a transaction is created from a subscription change, where `proration_billing_mode` was `prorated_immediately` or `prorated_next_billing_period`. Set automatically by Paddle.
Proration *Proration `json:"proration,omitempty"`
// TaxRate: Rate used to calculate tax for this transaction line item.
TaxRate string `json:"tax_rate,omitempty"`
// UnitTotals: Breakdown of the charge for one unit in the lowest denomination of a currency (e.g. cents for USD).
UnitTotals Totals `json:"unit_totals,omitempty"`
// Totals: Breakdown of a charge in the lowest denomination of a currency (e.g. cents for USD).
Totals Totals `json:"totals,omitempty"`
// Product: Related product entity for this transaction line item price.
Product Product `json:"product,omitempty"`
}
// TransactionDetails: Calculated totals for a transaction, including proration, discounts, tax, and currency conversion. Considered the source of truth for totals on a transaction.
type TransactionDetails struct {
// TaxRatesUsed: List of tax rates applied for this transaction.
TaxRatesUsed []TaxRatesUsed `json:"tax_rates_used,omitempty"`
// Totals: Breakdown of the total for a transaction. These numbers can become negative when dealing with subscription updates that result in credit.
Totals TransactionTotals `json:"totals,omitempty"`
// AdjustedTotals: Breakdown of the payout totals for a transaction after adjustments. `null` until the transaction is `completed`.
AdjustedTotals TransactionTotalsAdjusted `json:"adjusted_totals,omitempty"`
// PayoutTotals: Breakdown of the payout total for a transaction. `null` until the transaction is `completed`. Returned in your payout currency.
PayoutTotals *TransactionPayoutTotals `json:"payout_totals,omitempty"`
// AdjustedPayoutTotals: Breakdown of the payout total for a transaction after adjustments. `null` until the transaction is `completed`.
AdjustedPayoutTotals *TransactionPayoutTotalsAdjusted `json:"adjusted_payout_totals,omitempty"`
// LineItems: Information about line items for this transaction. Different from transaction `items` as they include totals calculated by Paddle. Considered the source of truth for line item totals.
LineItems []TransactionLineItem `json:"line_items,omitempty"`
}
// PaymentAttemptStatus: Status of this payment attempt..
type PaymentAttemptStatus string
const (
PaymentAttemptStatusAuthorized PaymentAttemptStatus = "authorized"
PaymentAttemptStatusAuthorizedFlagged PaymentAttemptStatus = "authorized_flagged"
PaymentAttemptStatusCanceled PaymentAttemptStatus = "canceled"
PaymentAttemptStatusCaptured PaymentAttemptStatus = "captured"
PaymentAttemptStatusError PaymentAttemptStatus = "error"
PaymentAttemptStatusActionRequired PaymentAttemptStatus = "action_required"
PaymentAttemptStatusPendingNoActionRequired PaymentAttemptStatus = "pending_no_action_required"
PaymentAttemptStatusCreated PaymentAttemptStatus = "created"
PaymentAttemptStatusUnknown PaymentAttemptStatus = "unknown"
PaymentAttemptStatusDropped PaymentAttemptStatus = "dropped"
)
// ErrorCode: Reason why a payment attempt failed. Returns `null` if payment captured successfully..
type ErrorCode string
const (
ErrorCodeAlreadyCanceled ErrorCode = "already_canceled"
ErrorCodeAlreadyRefunded ErrorCode = "already_refunded"
ErrorCodeAuthenticationFailed ErrorCode = "authentication_failed"
ErrorCodeBlockedCard ErrorCode = "blocked_card"
ErrorCodeCanceled ErrorCode = "canceled"
ErrorCodeDeclined ErrorCode = "declined"
ErrorCodeDeclinedNotRetryable ErrorCode = "declined_not_retryable"
ErrorCodeExpiredCard ErrorCode = "expired_card"
ErrorCodeFraud ErrorCode = "fraud"
ErrorCodeInvalidAmount ErrorCode = "invalid_amount"
ErrorCodeInvalidPaymentDetails ErrorCode = "invalid_payment_details"
ErrorCodeIssuerUnavailable ErrorCode = "issuer_unavailable"
ErrorCodeNotEnoughBalance ErrorCode = "not_enough_balance"
ErrorCodePspError ErrorCode = "psp_error"
ErrorCodeRedactedPaymentMethod ErrorCode = "redacted_payment_method"
ErrorCodeSystemError ErrorCode = "system_error"
ErrorCodeTransactionNotPermitted ErrorCode = "transaction_not_permitted"
ErrorCodeUnknown ErrorCode = "unknown"
)
// PaymentMethodType: Type of payment method used for this payment attempt..
type PaymentMethodType string
const (
PaymentMethodTypeAlipay PaymentMethodType = "alipay"
PaymentMethodTypeApplePay PaymentMethodType = "apple_pay"
PaymentMethodTypeBancontact PaymentMethodType = "bancontact"
PaymentMethodTypeCard PaymentMethodType = "card"
PaymentMethodTypeGooglePay PaymentMethodType = "google_pay"
PaymentMethodTypeIdeal PaymentMethodType = "ideal"
PaymentMethodTypeOffline PaymentMethodType = "offline"
PaymentMethodTypePaypal PaymentMethodType = "paypal"
PaymentMethodTypeUnknown PaymentMethodType = "unknown"
PaymentMethodTypeWireTransfer PaymentMethodType = "wire_transfer"
)
// CardType: Type of credit or debit card used to pay..
type CardType string
const (
CardTypeAmericanExpress CardType = "american_express"
CardTypeDinersClub CardType = "diners_club"
CardTypeDiscover CardType = "discover"
CardTypeJcb CardType = "jcb"
CardTypeMada CardType = "mada"
CardTypeMaestro CardType = "maestro"
CardTypeMastercard CardType = "mastercard"
CardTypeUnionPay CardType = "union_pay"
CardTypeUnknown CardType = "unknown"
CardTypeVisa CardType = "visa"
)
// Card: Information about the credit or debit card used to pay. `null` unless `type` is `card`.
type Card struct {
// Type: Type of credit or debit card used to pay.
Type CardType `json:"type,omitempty"`
// Last4: Last four digits of the card used to pay.
Last4 string `json:"last4,omitempty"`
// ExpiryMonth: Month of the expiry date of the card used to pay.
ExpiryMonth int `json:"expiry_month,omitempty"`
// ExpiryYear: Year of the expiry date of the card used to pay.
ExpiryYear int `json:"expiry_year,omitempty"`
// CardholderName: The name on the card used to pay.
CardholderName string `json:"cardholder_name,omitempty"`
}
// MethodDetails: Information about the payment method used for a payment attempt.
type MethodDetails struct {
// Type: Type of payment method used for this payment attempt.
Type PaymentMethodType `json:"type,omitempty"`
// Card: Information about the credit or debit card used to pay. `null` unless `type` is `card`.
Card *Card `json:"card,omitempty"`
}
// TransactionPaymentAttempt: List of payment attempts for this transaction, including successful payments. Sorted by `created_at` in descending order, so most recent attempts are returned first.
type TransactionPaymentAttempt struct {
// PaymentAttemptID: UUID for this payment attempt.
PaymentAttemptID string `json:"payment_attempt_id,omitempty"`
// StoredPaymentMethodID: UUID for the stored payment method used for this payment attempt. Deprecated - use `payment_method_id` instead.
StoredPaymentMethodID string `json:"stored_payment_method_id,omitempty"`
// PaymentMethodID: Paddle ID of the payment method used for this payment attempt, prefixed with `paymtd_`.
PaymentMethodID *string `json:"payment_method_id,omitempty"`
// Amount: Amount for collection in the lowest denomination of a currency (e.g. cents for USD).
Amount string `json:"amount,omitempty"`
// Status: Status of this payment attempt.
Status PaymentAttemptStatus `json:"status,omitempty"`
// ErrorCode: Reason why a payment attempt failed. Returns `null` if payment captured successfully.
ErrorCode *ErrorCode `json:"error_code,omitempty"`
// MethodDetails: Information about the payment method used for a payment attempt.
MethodDetails MethodDetails `json:"method_details,omitempty"`
// CreatedAt: RFC 3339 datetime string of when this entity was created. Set automatically by Paddle.
CreatedAt string `json:"created_at,omitempty"`
// CapturedAt: RFC 3339 datetime string of when this payment was captured. `null` if `status` is not `captured`.
CapturedAt *string `json:"captured_at,omitempty"`
}
// TransactionCheckout: Paddle Checkout details for this transaction. Returned for automatically-collected transactions and where `billing_details.enable_checkout` is `true` for manually-collected transactions; `null` otherwise.
type TransactionCheckout struct {
// URL: Paddle Checkout URL for this transaction, composed of the URL passed in the request or your default payment URL + `_?txn=` and the Paddle ID for this transaction.
URL *string `json:"url,omitempty"`
}
// Address: Address for this transaction. Returned when the `include` parameter is used with the `address` value and the transaction has an `address_id`.
type Address struct {
// ID: Unique Paddle ID for this address entity, prefixed with `add_`.
ID string `json:"id,omitempty"`
// CustomerID: Paddle ID for the customer related to this address, prefixed with `cus_`.
CustomerID string `json:"customer_id,omitempty"`
// Description: Memorable description for this address.
Description *string `json:"description,omitempty"`
// FirstLine: First line of this address.