dodopayments 2.21.0 → 2.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +8 -0
  3. data/README.md +1 -1
  4. data/lib/dodopayments/models/payment.rb +5 -147
  5. data/lib/dodopayments/models/payment_list_params.rb +6 -2
  6. data/lib/dodopayments/models/payout_created_webhook_event.rb +188 -0
  7. data/lib/dodopayments/models/payout_failed_webhook_event.rb +188 -0
  8. data/lib/dodopayments/models/payout_in_progress_webhook_event.rb +188 -0
  9. data/lib/dodopayments/models/payout_on_hold_webhook_event.rb +188 -0
  10. data/lib/dodopayments/models/payout_success_webhook_event.rb +188 -0
  11. data/lib/dodopayments/models/unsafe_unwrap_webhook_event.rb +11 -1
  12. data/lib/dodopayments/models/unwrap_webhook_event.rb +11 -1
  13. data/lib/dodopayments/models/webhook_event_type.rb +1 -1
  14. data/lib/dodopayments/models/webhook_payload.rb +160 -3
  15. data/lib/dodopayments/models.rb +10 -0
  16. data/lib/dodopayments/resources/payments.rb +4 -1
  17. data/lib/dodopayments/resources/webhooks.rb +2 -2
  18. data/lib/dodopayments/version.rb +1 -1
  19. data/lib/dodopayments.rb +5 -0
  20. data/rbi/dodopayments/models/payment.rbi +6 -349
  21. data/rbi/dodopayments/models/payment_list_params.rbi +4 -2
  22. data/rbi/dodopayments/models/payout_created_webhook_event.rbi +270 -0
  23. data/rbi/dodopayments/models/payout_failed_webhook_event.rbi +270 -0
  24. data/rbi/dodopayments/models/payout_in_progress_webhook_event.rbi +272 -0
  25. data/rbi/dodopayments/models/payout_on_hold_webhook_event.rbi +270 -0
  26. data/rbi/dodopayments/models/payout_success_webhook_event.rbi +270 -0
  27. data/rbi/dodopayments/models/unsafe_unwrap_webhook_event.rbi +5 -0
  28. data/rbi/dodopayments/models/unwrap_webhook_event.rbi +5 -0
  29. data/rbi/dodopayments/models/webhook_event_type.rbi +2 -5
  30. data/rbi/dodopayments/models/webhook_payload.rbi +213 -0
  31. data/rbi/dodopayments/models.rbi +11 -0
  32. data/rbi/dodopayments/resources/payments.rbi +2 -1
  33. data/rbi/dodopayments/resources/webhooks.rbi +10 -0
  34. data/sig/dodopayments/models/payment.rbs +0 -135
  35. data/sig/dodopayments/models/payout_created_webhook_event.rbs +137 -0
  36. data/sig/dodopayments/models/payout_failed_webhook_event.rbs +137 -0
  37. data/sig/dodopayments/models/payout_in_progress_webhook_event.rbs +137 -0
  38. data/sig/dodopayments/models/payout_on_hold_webhook_event.rbs +137 -0
  39. data/sig/dodopayments/models/payout_success_webhook_event.rbs +137 -0
  40. data/sig/dodopayments/models/unsafe_unwrap_webhook_event.rbs +5 -0
  41. data/sig/dodopayments/models/unwrap_webhook_event.rbs +5 -0
  42. data/sig/dodopayments/models/webhook_event_type.rbs +2 -2
  43. data/sig/dodopayments/models/webhook_payload.rbs +108 -0
  44. data/sig/dodopayments/models.rbs +10 -0
  45. data/sig/dodopayments/resources/webhooks.rbs +10 -0
  46. metadata +17 -2
@@ -135,26 +135,12 @@ module Dodopayments
135
135
  sig { returns(T.nilable(String)) }
136
136
  attr_accessor :error_code
137
137
 
138
- # An error message if the payment failed
138
+ # An error message if the payment failed. When `error_code` is a recognised
139
+ # unified code, this is the merchant-facing headline + recommended action (Payment
140
+ # Details copy) rather than the raw connector text.
139
141
  sig { returns(T.nilable(String)) }
140
142
  attr_accessor :error_message
141
143
 
142
- # Purpose-built failure messaging for the merchant and the customer, derived from
143
- # `error_code`. Present whenever `error_code` is set, regardless of payment
144
- # status; unrecognised codes still resolve via a generic fallback rather than
145
- # being omitted. The customer copy is always generic for fraud-sensitive declines
146
- # (lost/stolen/pickup/fraudulent) so the true reason is never leaked.
147
- sig { returns(T.nilable(Dodopayments::Payment::FailureDetails)) }
148
- attr_reader :failure_details
149
-
150
- sig do
151
- params(
152
- failure_details:
153
- T.nilable(Dodopayments::Payment::FailureDetails::OrHash)
154
- ).void
155
- end
156
- attr_writer :failure_details
157
-
158
144
  # Invoice ID for this payment. Uses India-specific invoice ID if available.
159
145
  sig { returns(T.nilable(String)) }
160
146
  attr_accessor :invoice_id
@@ -244,8 +230,6 @@ module Dodopayments
244
230
  discounts: T.nilable(T::Array[Dodopayments::DiscountDetail::OrHash]),
245
231
  error_code: T.nilable(String),
246
232
  error_message: T.nilable(String),
247
- failure_details:
248
- T.nilable(Dodopayments::Payment::FailureDetails::OrHash),
249
233
  invoice_id: T.nilable(String),
250
234
  invoice_url: T.nilable(String),
251
235
  payment_link: T.nilable(String),
@@ -328,14 +312,10 @@ module Dodopayments
328
312
  discounts: nil,
329
313
  # An error code if the payment failed
330
314
  error_code: nil,
331
- # An error message if the payment failed
315
+ # An error message if the payment failed. When `error_code` is a recognised
316
+ # unified code, this is the merchant-facing headline + recommended action (Payment
317
+ # Details copy) rather than the raw connector text.
332
318
  error_message: nil,
333
- # Purpose-built failure messaging for the merchant and the customer, derived from
334
- # `error_code`. Present whenever `error_code` is set, regardless of payment
335
- # status; unrecognised codes still resolve via a generic fallback rather than
336
- # being omitted. The customer copy is always generic for fraud-sensitive declines
337
- # (lost/stolen/pickup/fraudulent) so the true reason is never leaked.
338
- failure_details: nil,
339
319
  # Invoice ID for this payment. Uses India-specific invoice ID if available.
340
320
  invoice_id: nil,
341
321
  # URL to download the invoice PDF for this payment.
@@ -403,7 +383,6 @@ module Dodopayments
403
383
  discounts: T.nilable(T::Array[Dodopayments::DiscountDetail]),
404
384
  error_code: T.nilable(String),
405
385
  error_message: T.nilable(String),
406
- failure_details: T.nilable(Dodopayments::Payment::FailureDetails),
407
386
  invoice_id: T.nilable(String),
408
387
  invoice_url: T.nilable(String),
409
388
  payment_link: T.nilable(String),
@@ -450,328 +429,6 @@ module Dodopayments
450
429
  end
451
430
  end
452
431
 
453
- class FailureDetails < Dodopayments::Internal::Type::BaseModel
454
- OrHash =
455
- T.type_alias do
456
- T.any(
457
- Dodopayments::Payment::FailureDetails,
458
- Dodopayments::Internal::AnyHash
459
- )
460
- end
461
-
462
- # The unified error code (echoes `error_code`).
463
- sig { returns(String) }
464
- attr_accessor :code
465
-
466
- # The primary CTA to show the customer.
467
- sig do
468
- returns(
469
- Dodopayments::Payment::FailureDetails::CustomerCta::TaggedSymbol
470
- )
471
- end
472
- attr_accessor :customer_cta
473
-
474
- # Whether the customer can resolve this themselves (e.g. fix CVC).
475
- sig { returns(T::Boolean) }
476
- attr_accessor :customer_fixable
477
-
478
- # The customer-facing string. Always generic (`C11`) for the fraud-4.
479
- sig { returns(String) }
480
- attr_accessor :customer_message
481
-
482
- # The customer message template identifier (C1..C20).
483
- sig do
484
- returns(
485
- Dodopayments::Payment::FailureDetails::CustomerTemplate::TaggedSymbol
486
- )
487
- end
488
- attr_accessor :customer_template
489
-
490
- # Soft or hard decline.
491
- sig do
492
- returns(
493
- Dodopayments::Payment::FailureDetails::DeclineType::TaggedSymbol
494
- )
495
- end
496
- attr_accessor :decline_type
497
-
498
- # Merchant-facing headline + recommended action (Payment Details). For the fraud-4
499
- # this includes the operator "do not reveal" warning.
500
- sig { returns(String) }
501
- attr_accessor :merchant_message
502
-
503
- # Purpose-built failure messaging for the merchant and the customer, derived from
504
- # `error_code`. Present whenever `error_code` is set, regardless of payment
505
- # status; unrecognised codes still resolve via a generic fallback rather than
506
- # being omitted. The customer copy is always generic for fraud-sensitive declines
507
- # (lost/stolen/pickup/fraudulent) so the true reason is never leaked.
508
- sig do
509
- params(
510
- code: String,
511
- customer_cta:
512
- Dodopayments::Payment::FailureDetails::CustomerCta::OrSymbol,
513
- customer_fixable: T::Boolean,
514
- customer_message: String,
515
- customer_template:
516
- Dodopayments::Payment::FailureDetails::CustomerTemplate::OrSymbol,
517
- decline_type:
518
- Dodopayments::Payment::FailureDetails::DeclineType::OrSymbol,
519
- merchant_message: String
520
- ).returns(T.attached_class)
521
- end
522
- def self.new(
523
- # The unified error code (echoes `error_code`).
524
- code:,
525
- # The primary CTA to show the customer.
526
- customer_cta:,
527
- # Whether the customer can resolve this themselves (e.g. fix CVC).
528
- customer_fixable:,
529
- # The customer-facing string. Always generic (`C11`) for the fraud-4.
530
- customer_message:,
531
- # The customer message template identifier (C1..C20).
532
- customer_template:,
533
- # Soft or hard decline.
534
- decline_type:,
535
- # Merchant-facing headline + recommended action (Payment Details). For the fraud-4
536
- # this includes the operator "do not reveal" warning.
537
- merchant_message:
538
- )
539
- end
540
-
541
- sig do
542
- override.returns(
543
- {
544
- code: String,
545
- customer_cta:
546
- Dodopayments::Payment::FailureDetails::CustomerCta::TaggedSymbol,
547
- customer_fixable: T::Boolean,
548
- customer_message: String,
549
- customer_template:
550
- Dodopayments::Payment::FailureDetails::CustomerTemplate::TaggedSymbol,
551
- decline_type:
552
- Dodopayments::Payment::FailureDetails::DeclineType::TaggedSymbol,
553
- merchant_message: String
554
- }
555
- )
556
- end
557
- def to_hash
558
- end
559
-
560
- # The primary CTA to show the customer.
561
- module CustomerCta
562
- extend Dodopayments::Internal::Type::Enum
563
-
564
- TaggedSymbol =
565
- T.type_alias do
566
- T.all(Symbol, Dodopayments::Payment::FailureDetails::CustomerCta)
567
- end
568
- OrSymbol = T.type_alias { T.any(Symbol, String) }
569
-
570
- EDIT_AND_RETRY =
571
- T.let(
572
- :edit_and_retry,
573
- Dodopayments::Payment::FailureDetails::CustomerCta::TaggedSymbol
574
- )
575
- USE_ANOTHER_METHOD =
576
- T.let(
577
- :use_another_method,
578
- Dodopayments::Payment::FailureDetails::CustomerCta::TaggedSymbol
579
- )
580
- TRY_AGAIN =
581
- T.let(
582
- :try_again,
583
- Dodopayments::Payment::FailureDetails::CustomerCta::TaggedSymbol
584
- )
585
- TRY_LATER =
586
- T.let(
587
- :try_later,
588
- Dodopayments::Payment::FailureDetails::CustomerCta::TaggedSymbol
589
- )
590
- RETRY_AND_VERIFY =
591
- T.let(
592
- :retry_and_verify,
593
- Dodopayments::Payment::FailureDetails::CustomerCta::TaggedSymbol
594
- )
595
- RESTART =
596
- T.let(
597
- :restart,
598
- Dodopayments::Payment::FailureDetails::CustomerCta::TaggedSymbol
599
- )
600
- UPDATE_METHOD =
601
- T.let(
602
- :update_method,
603
- Dodopayments::Payment::FailureDetails::CustomerCta::TaggedSymbol
604
- )
605
-
606
- sig do
607
- override.returns(
608
- T::Array[
609
- Dodopayments::Payment::FailureDetails::CustomerCta::TaggedSymbol
610
- ]
611
- )
612
- end
613
- def self.values
614
- end
615
- end
616
-
617
- # The customer message template identifier (C1..C20).
618
- module CustomerTemplate
619
- extend Dodopayments::Internal::Type::Enum
620
-
621
- TaggedSymbol =
622
- T.type_alias do
623
- T.all(
624
- Symbol,
625
- Dodopayments::Payment::FailureDetails::CustomerTemplate
626
- )
627
- end
628
- OrSymbol = T.type_alias { T.any(Symbol, String) }
629
-
630
- C1 =
631
- T.let(
632
- :C1,
633
- Dodopayments::Payment::FailureDetails::CustomerTemplate::TaggedSymbol
634
- )
635
- C2 =
636
- T.let(
637
- :C2,
638
- Dodopayments::Payment::FailureDetails::CustomerTemplate::TaggedSymbol
639
- )
640
- C3 =
641
- T.let(
642
- :C3,
643
- Dodopayments::Payment::FailureDetails::CustomerTemplate::TaggedSymbol
644
- )
645
- C4 =
646
- T.let(
647
- :C4,
648
- Dodopayments::Payment::FailureDetails::CustomerTemplate::TaggedSymbol
649
- )
650
- C5 =
651
- T.let(
652
- :C5,
653
- Dodopayments::Payment::FailureDetails::CustomerTemplate::TaggedSymbol
654
- )
655
- C6 =
656
- T.let(
657
- :C6,
658
- Dodopayments::Payment::FailureDetails::CustomerTemplate::TaggedSymbol
659
- )
660
- C7 =
661
- T.let(
662
- :C7,
663
- Dodopayments::Payment::FailureDetails::CustomerTemplate::TaggedSymbol
664
- )
665
- C8 =
666
- T.let(
667
- :C8,
668
- Dodopayments::Payment::FailureDetails::CustomerTemplate::TaggedSymbol
669
- )
670
- C9 =
671
- T.let(
672
- :C9,
673
- Dodopayments::Payment::FailureDetails::CustomerTemplate::TaggedSymbol
674
- )
675
- C10 =
676
- T.let(
677
- :C10,
678
- Dodopayments::Payment::FailureDetails::CustomerTemplate::TaggedSymbol
679
- )
680
- C11 =
681
- T.let(
682
- :C11,
683
- Dodopayments::Payment::FailureDetails::CustomerTemplate::TaggedSymbol
684
- )
685
- C12 =
686
- T.let(
687
- :C12,
688
- Dodopayments::Payment::FailureDetails::CustomerTemplate::TaggedSymbol
689
- )
690
- C13 =
691
- T.let(
692
- :C13,
693
- Dodopayments::Payment::FailureDetails::CustomerTemplate::TaggedSymbol
694
- )
695
- C14 =
696
- T.let(
697
- :C14,
698
- Dodopayments::Payment::FailureDetails::CustomerTemplate::TaggedSymbol
699
- )
700
- C15 =
701
- T.let(
702
- :C15,
703
- Dodopayments::Payment::FailureDetails::CustomerTemplate::TaggedSymbol
704
- )
705
- C16 =
706
- T.let(
707
- :C16,
708
- Dodopayments::Payment::FailureDetails::CustomerTemplate::TaggedSymbol
709
- )
710
- C17 =
711
- T.let(
712
- :C17,
713
- Dodopayments::Payment::FailureDetails::CustomerTemplate::TaggedSymbol
714
- )
715
- C18 =
716
- T.let(
717
- :C18,
718
- Dodopayments::Payment::FailureDetails::CustomerTemplate::TaggedSymbol
719
- )
720
- C19 =
721
- T.let(
722
- :C19,
723
- Dodopayments::Payment::FailureDetails::CustomerTemplate::TaggedSymbol
724
- )
725
- C20 =
726
- T.let(
727
- :C20,
728
- Dodopayments::Payment::FailureDetails::CustomerTemplate::TaggedSymbol
729
- )
730
-
731
- sig do
732
- override.returns(
733
- T::Array[
734
- Dodopayments::Payment::FailureDetails::CustomerTemplate::TaggedSymbol
735
- ]
736
- )
737
- end
738
- def self.values
739
- end
740
- end
741
-
742
- # Soft or hard decline.
743
- module DeclineType
744
- extend Dodopayments::Internal::Type::Enum
745
-
746
- TaggedSymbol =
747
- T.type_alias do
748
- T.all(Symbol, Dodopayments::Payment::FailureDetails::DeclineType)
749
- end
750
- OrSymbol = T.type_alias { T.any(Symbol, String) }
751
-
752
- SOFT =
753
- T.let(
754
- :soft,
755
- Dodopayments::Payment::FailureDetails::DeclineType::TaggedSymbol
756
- )
757
- HARD =
758
- T.let(
759
- :hard,
760
- Dodopayments::Payment::FailureDetails::DeclineType::TaggedSymbol
761
- )
762
-
763
- sig do
764
- override.returns(
765
- T::Array[
766
- Dodopayments::Payment::FailureDetails::DeclineType::TaggedSymbol
767
- ]
768
- )
769
- end
770
- def self.values
771
- end
772
- end
773
- end
774
-
775
432
  class ProductCart < Dodopayments::Internal::Type::BaseModel
776
433
  OrHash =
777
434
  T.type_alias do
@@ -55,7 +55,8 @@ module Dodopayments
55
55
  sig { params(customer_id: String).void }
56
56
  attr_writer :customer_id
57
57
 
58
- # Page number default is 0
58
+ # Page number default is 0. Capped to bound OFFSET-based deep pagination, which
59
+ # forces Postgres to scan and discard every preceding row.
59
60
  sig { returns(T.nilable(Integer)) }
60
61
  attr_reader :page_number
61
62
 
@@ -120,7 +121,8 @@ module Dodopayments
120
121
  currency: nil,
121
122
  # Filter by customer id
122
123
  customer_id: nil,
123
- # Page number default is 0
124
+ # Page number default is 0. Capped to bound OFFSET-based deep pagination, which
125
+ # forces Postgres to scan and discard every preceding row.
124
126
  page_number: nil,
125
127
  # Page size default is 10 max is 100
126
128
  page_size: nil,
@@ -0,0 +1,270 @@
1
+ # typed: strong
2
+
3
+ module Dodopayments
4
+ module Models
5
+ class PayoutCreatedWebhookEvent < Dodopayments::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(
9
+ Dodopayments::PayoutCreatedWebhookEvent,
10
+ Dodopayments::Internal::AnyHash
11
+ )
12
+ end
13
+
14
+ # The business identifier
15
+ sig { returns(String) }
16
+ attr_accessor :business_id
17
+
18
+ sig { returns(Dodopayments::PayoutCreatedWebhookEvent::Data) }
19
+ attr_reader :data
20
+
21
+ sig do
22
+ params(data: Dodopayments::PayoutCreatedWebhookEvent::Data::OrHash).void
23
+ end
24
+ attr_writer :data
25
+
26
+ # The timestamp of when the event occurred
27
+ sig { returns(Time) }
28
+ attr_accessor :timestamp
29
+
30
+ # The event type
31
+ sig { returns(Symbol) }
32
+ attr_accessor :type
33
+
34
+ sig do
35
+ params(
36
+ business_id: String,
37
+ data: Dodopayments::PayoutCreatedWebhookEvent::Data::OrHash,
38
+ timestamp: Time,
39
+ type: Symbol
40
+ ).returns(T.attached_class)
41
+ end
42
+ def self.new(
43
+ # The business identifier
44
+ business_id:,
45
+ data:,
46
+ # The timestamp of when the event occurred
47
+ timestamp:,
48
+ # The event type
49
+ type: :"payout.created"
50
+ )
51
+ end
52
+
53
+ sig do
54
+ override.returns(
55
+ {
56
+ business_id: String,
57
+ data: Dodopayments::PayoutCreatedWebhookEvent::Data,
58
+ timestamp: Time,
59
+ type: Symbol
60
+ }
61
+ )
62
+ end
63
+ def to_hash
64
+ end
65
+
66
+ class Data < Dodopayments::Internal::Type::BaseModel
67
+ OrHash =
68
+ T.type_alias do
69
+ T.any(
70
+ Dodopayments::PayoutCreatedWebhookEvent::Data,
71
+ Dodopayments::Internal::AnyHash
72
+ )
73
+ end
74
+
75
+ # The total amount of the payout.
76
+ sig { returns(Integer) }
77
+ attr_accessor :amount
78
+
79
+ # The unique identifier of the business associated with the payout.
80
+ sig { returns(String) }
81
+ attr_accessor :business_id
82
+
83
+ # The total value of chargebacks associated with the payout.
84
+ sig { returns(Integer) }
85
+ attr_accessor :chargebacks
86
+
87
+ # The timestamp when the payout was created, in UTC.
88
+ sig { returns(Time) }
89
+ attr_accessor :created_at
90
+
91
+ # The currency of the payout, represented as an ISO 4217 currency code.
92
+ sig { returns(Dodopayments::Currency::TaggedSymbol) }
93
+ attr_accessor :currency
94
+
95
+ # The fee charged for processing the payout.
96
+ sig { returns(Integer) }
97
+ attr_accessor :fee
98
+
99
+ # The payment method used for the payout (e.g., bank transfer, card, etc.).
100
+ sig { returns(String) }
101
+ attr_accessor :payment_method
102
+
103
+ # The unique identifier of the payout.
104
+ sig { returns(String) }
105
+ attr_accessor :payout_id
106
+
107
+ # The total value of refunds associated with the payout.
108
+ sig { returns(Integer) }
109
+ attr_accessor :refunds
110
+
111
+ # The current status of the payout.
112
+ sig do
113
+ returns(
114
+ Dodopayments::PayoutCreatedWebhookEvent::Data::Status::TaggedSymbol
115
+ )
116
+ end
117
+ attr_accessor :status
118
+
119
+ # The tax applied to the payout.
120
+ sig { returns(Integer) }
121
+ attr_accessor :tax
122
+
123
+ # The timestamp when the payout was last updated, in UTC.
124
+ sig { returns(Time) }
125
+ attr_accessor :updated_at
126
+
127
+ # The name of the payout recipient or purpose.
128
+ sig { returns(T.nilable(String)) }
129
+ attr_accessor :name
130
+
131
+ # The URL of the document associated with the payout.
132
+ sig { returns(T.nilable(String)) }
133
+ attr_accessor :payout_document_url
134
+
135
+ # Any additional remarks or notes associated with the payout.
136
+ sig { returns(T.nilable(String)) }
137
+ attr_accessor :remarks
138
+
139
+ sig do
140
+ params(
141
+ amount: Integer,
142
+ business_id: String,
143
+ chargebacks: Integer,
144
+ created_at: Time,
145
+ currency: Dodopayments::Currency::OrSymbol,
146
+ fee: Integer,
147
+ payment_method: String,
148
+ payout_id: String,
149
+ refunds: Integer,
150
+ status:
151
+ Dodopayments::PayoutCreatedWebhookEvent::Data::Status::OrSymbol,
152
+ tax: Integer,
153
+ updated_at: Time,
154
+ name: T.nilable(String),
155
+ payout_document_url: T.nilable(String),
156
+ remarks: T.nilable(String)
157
+ ).returns(T.attached_class)
158
+ end
159
+ def self.new(
160
+ # The total amount of the payout.
161
+ amount:,
162
+ # The unique identifier of the business associated with the payout.
163
+ business_id:,
164
+ # The total value of chargebacks associated with the payout.
165
+ chargebacks:,
166
+ # The timestamp when the payout was created, in UTC.
167
+ created_at:,
168
+ # The currency of the payout, represented as an ISO 4217 currency code.
169
+ currency:,
170
+ # The fee charged for processing the payout.
171
+ fee:,
172
+ # The payment method used for the payout (e.g., bank transfer, card, etc.).
173
+ payment_method:,
174
+ # The unique identifier of the payout.
175
+ payout_id:,
176
+ # The total value of refunds associated with the payout.
177
+ refunds:,
178
+ # The current status of the payout.
179
+ status:,
180
+ # The tax applied to the payout.
181
+ tax:,
182
+ # The timestamp when the payout was last updated, in UTC.
183
+ updated_at:,
184
+ # The name of the payout recipient or purpose.
185
+ name: nil,
186
+ # The URL of the document associated with the payout.
187
+ payout_document_url: nil,
188
+ # Any additional remarks or notes associated with the payout.
189
+ remarks: nil
190
+ )
191
+ end
192
+
193
+ sig do
194
+ override.returns(
195
+ {
196
+ amount: Integer,
197
+ business_id: String,
198
+ chargebacks: Integer,
199
+ created_at: Time,
200
+ currency: Dodopayments::Currency::TaggedSymbol,
201
+ fee: Integer,
202
+ payment_method: String,
203
+ payout_id: String,
204
+ refunds: Integer,
205
+ status:
206
+ Dodopayments::PayoutCreatedWebhookEvent::Data::Status::TaggedSymbol,
207
+ tax: Integer,
208
+ updated_at: Time,
209
+ name: T.nilable(String),
210
+ payout_document_url: T.nilable(String),
211
+ remarks: T.nilable(String)
212
+ }
213
+ )
214
+ end
215
+ def to_hash
216
+ end
217
+
218
+ # The current status of the payout.
219
+ module Status
220
+ extend Dodopayments::Internal::Type::Enum
221
+
222
+ TaggedSymbol =
223
+ T.type_alias do
224
+ T.all(
225
+ Symbol,
226
+ Dodopayments::PayoutCreatedWebhookEvent::Data::Status
227
+ )
228
+ end
229
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
230
+
231
+ NOT_INITIATED =
232
+ T.let(
233
+ :not_initiated,
234
+ Dodopayments::PayoutCreatedWebhookEvent::Data::Status::TaggedSymbol
235
+ )
236
+ IN_PROGRESS =
237
+ T.let(
238
+ :in_progress,
239
+ Dodopayments::PayoutCreatedWebhookEvent::Data::Status::TaggedSymbol
240
+ )
241
+ ON_HOLD =
242
+ T.let(
243
+ :on_hold,
244
+ Dodopayments::PayoutCreatedWebhookEvent::Data::Status::TaggedSymbol
245
+ )
246
+ FAILED =
247
+ T.let(
248
+ :failed,
249
+ Dodopayments::PayoutCreatedWebhookEvent::Data::Status::TaggedSymbol
250
+ )
251
+ SUCCESS =
252
+ T.let(
253
+ :success,
254
+ Dodopayments::PayoutCreatedWebhookEvent::Data::Status::TaggedSymbol
255
+ )
256
+
257
+ sig do
258
+ override.returns(
259
+ T::Array[
260
+ Dodopayments::PayoutCreatedWebhookEvent::Data::Status::TaggedSymbol
261
+ ]
262
+ )
263
+ end
264
+ def self.values
265
+ end
266
+ end
267
+ end
268
+ end
269
+ end
270
+ end