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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cce1a46aa3a586422600889e188f2b401e93246c826b2e96e5dc8c5c0a056014
4
- data.tar.gz: 295a9d062709d43a862c5f351231a8cb27febbcb36fd8a1ff78b69de75374634
3
+ metadata.gz: 163def2395f779a9e37c434ed82db681beb1604ecfca9e9805408a8748882b14
4
+ data.tar.gz: cd58f274a55ce3838d5f779703a1a26127d18381d4ea2f017d841c066ebc238c
5
5
  SHA512:
6
- metadata.gz: 2aca745d3761996c176af1668be98cc19496aebddc82b6d6aa2e43b7a2784a410e601a0d81608a0c0d855f8634f4959075455c697d286018a9d2bd4a3e3c8573
7
- data.tar.gz: 35d872f10337c040fc7b90d431a0ca011298cf7daaedff9a6a126cb7c05dc0b261edf3caf826d6c39b70fc4524f7264d17a6c9a104b397292ee9e5b44d1c0ea6
6
+ metadata.gz: f124c53ff18ae2919095987fa5567cdd032ebfad926e01480868d98a1df64f760432e6de39a9a23bd6e6505f303b6de90063d80e7714df5bdb4a26a7323999ed
7
+ data.tar.gz: b6659504610c0a812ffc0766da56f721864a0aa0eed10b846609881f90d07d50c539386f3c6402175c8ee09261f6dae933288e720b038ef035f00aacf21fce8e
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.22.0](https://github.com/dodopayments/dodopayments-ruby/compare/v2.21.0...v2.22.0) (2026-07-31)
4
+
5
+
6
+ ### Features
7
+
8
+ * **api:** add payout webhook events and remove payment failure_details ([de7c577](https://github.com/dodopayments/dodopayments-ruby/commit/de7c577f484a03e6a6cb8474dc8bef89e7b938cb))
9
+ * **api:** add payout webhook events and remove payment failure_details ([4822183](https://github.com/dodopayments/dodopayments-ruby/commit/482218348d81bc473129b896bb8e9392d2477e70))
10
+
3
11
  ## [2.21.0](https://github.com/dodopayments/dodopayments-ruby/compare/v2.20.1...v2.21.0) (2026-07-24)
4
12
 
5
13
 
data/README.md CHANGED
@@ -23,7 +23,7 @@ To use this gem, install via Bundler by adding the following to your application
23
23
  <!-- x-release-please-start-version -->
24
24
 
25
25
  ```ruby
26
- gem "dodopayments", "~> 2.21.0"
26
+ gem "dodopayments", "~> 2.22.0"
27
27
  ```
28
28
 
29
29
  <!-- x-release-please-end -->
@@ -184,21 +184,13 @@ module Dodopayments
184
184
  optional :error_code, String, nil?: true
185
185
 
186
186
  # @!attribute error_message
187
- # An error message if the payment failed
187
+ # An error message if the payment failed. When `error_code` is a recognised
188
+ # unified code, this is the merchant-facing headline + recommended action (Payment
189
+ # Details copy) rather than the raw connector text.
188
190
  #
189
191
  # @return [String, nil]
190
192
  optional :error_message, String, nil?: true
191
193
 
192
- # @!attribute failure_details
193
- # Purpose-built failure messaging for the merchant and the customer, derived from
194
- # `error_code`. Present whenever `error_code` is set, regardless of payment
195
- # status; unrecognised codes still resolve via a generic fallback rather than
196
- # being omitted. The customer copy is always generic for fraud-sensitive declines
197
- # (lost/stolen/pickup/fraudulent) so the true reason is never leaked.
198
- #
199
- # @return [Dodopayments::Models::Payment::FailureDetails, nil]
200
- optional :failure_details, -> { Dodopayments::Payment::FailureDetails }, nil?: true
201
-
202
194
  # @!attribute invoice_id
203
195
  # Invoice ID for this payment. Uses India-specific invoice ID if available.
204
196
  #
@@ -283,7 +275,7 @@ module Dodopayments
283
275
  # @return [Time, nil]
284
276
  optional :updated_at, Time, nil?: true
285
277
 
286
- # @!method initialize(billing:, brand_id:, business_id:, created_at:, currency:, customer:, digital_products_delivered:, disputes:, is_update_payment_method:, metadata:, payment_id:, payment_provider:, refunds:, retry_attempt:, settlement_amount:, settlement_currency:, total_amount:, card_holder_name: nil, card_issuing_country: nil, card_last_four: nil, card_network: nil, card_type: nil, checkout_session_id: nil, custom_field_responses: nil, discount_id: nil, discounts: nil, error_code: nil, error_message: nil, failure_details: nil, invoice_id: nil, invoice_url: nil, payment_link: nil, payment_method: nil, payment_method_id: nil, payment_method_type: nil, product_cart: nil, refund_status: nil, settlement_tax: nil, status: nil, subscription_id: nil, tax: nil, updated_at: nil)
278
+ # @!method initialize(billing:, brand_id:, business_id:, created_at:, currency:, customer:, digital_products_delivered:, disputes:, is_update_payment_method:, metadata:, payment_id:, payment_provider:, refunds:, retry_attempt:, settlement_amount:, settlement_currency:, total_amount:, card_holder_name: nil, card_issuing_country: nil, card_last_four: nil, card_network: nil, card_type: nil, checkout_session_id: nil, custom_field_responses: nil, discount_id: nil, discounts: nil, error_code: nil, error_message: nil, invoice_id: nil, invoice_url: nil, payment_link: nil, payment_method: nil, payment_method_id: nil, payment_method_type: nil, product_cart: nil, refund_status: nil, settlement_tax: nil, status: nil, subscription_id: nil, tax: nil, updated_at: nil)
287
279
  # Some parameter documentations has been truncated, see
288
280
  # {Dodopayments::Models::Payment} for more details.
289
281
  #
@@ -341,9 +333,7 @@ module Dodopayments
341
333
  #
342
334
  # @param error_code [String, nil] An error code if the payment failed
343
335
  #
344
- # @param error_message [String, nil] An error message if the payment failed
345
- #
346
- # @param failure_details [Dodopayments::Models::Payment::FailureDetails, nil] Purpose-built failure messaging for the merchant and the customer, derived
336
+ # @param error_message [String, nil] An error message if the payment failed. When `error_code` is a recognised
347
337
  #
348
338
  # @param invoice_id [String, nil] Invoice ID for this payment. Uses India-specific invoice ID if available.
349
339
  #
@@ -386,138 +376,6 @@ module Dodopayments
386
376
  # @return [Array<Symbol>]
387
377
  end
388
378
 
389
- # @see Dodopayments::Models::Payment#failure_details
390
- class FailureDetails < Dodopayments::Internal::Type::BaseModel
391
- # @!attribute code
392
- # The unified error code (echoes `error_code`).
393
- #
394
- # @return [String]
395
- required :code, String
396
-
397
- # @!attribute customer_cta
398
- # The primary CTA to show the customer.
399
- #
400
- # @return [Symbol, Dodopayments::Models::Payment::FailureDetails::CustomerCta]
401
- required :customer_cta, enum: -> { Dodopayments::Payment::FailureDetails::CustomerCta }
402
-
403
- # @!attribute customer_fixable
404
- # Whether the customer can resolve this themselves (e.g. fix CVC).
405
- #
406
- # @return [Boolean]
407
- required :customer_fixable, Dodopayments::Internal::Type::Boolean
408
-
409
- # @!attribute customer_message
410
- # The customer-facing string. Always generic (`C11`) for the fraud-4.
411
- #
412
- # @return [String]
413
- required :customer_message, String
414
-
415
- # @!attribute customer_template
416
- # The customer message template identifier (C1..C20).
417
- #
418
- # @return [Symbol, Dodopayments::Models::Payment::FailureDetails::CustomerTemplate]
419
- required :customer_template, enum: -> { Dodopayments::Payment::FailureDetails::CustomerTemplate }
420
-
421
- # @!attribute decline_type
422
- # Soft or hard decline.
423
- #
424
- # @return [Symbol, Dodopayments::Models::Payment::FailureDetails::DeclineType]
425
- required :decline_type, enum: -> { Dodopayments::Payment::FailureDetails::DeclineType }
426
-
427
- # @!attribute merchant_message
428
- # Merchant-facing headline + recommended action (Payment Details). For the fraud-4
429
- # this includes the operator "do not reveal" warning.
430
- #
431
- # @return [String]
432
- required :merchant_message, String
433
-
434
- # @!method initialize(code:, customer_cta:, customer_fixable:, customer_message:, customer_template:, decline_type:, merchant_message:)
435
- # Some parameter documentations has been truncated, see
436
- # {Dodopayments::Models::Payment::FailureDetails} for more details.
437
- #
438
- # Purpose-built failure messaging for the merchant and the customer, derived from
439
- # `error_code`. Present whenever `error_code` is set, regardless of payment
440
- # status; unrecognised codes still resolve via a generic fallback rather than
441
- # being omitted. The customer copy is always generic for fraud-sensitive declines
442
- # (lost/stolen/pickup/fraudulent) so the true reason is never leaked.
443
- #
444
- # @param code [String] The unified error code (echoes `error_code`).
445
- #
446
- # @param customer_cta [Symbol, Dodopayments::Models::Payment::FailureDetails::CustomerCta] The primary CTA to show the customer.
447
- #
448
- # @param customer_fixable [Boolean] Whether the customer can resolve this themselves (e.g. fix CVC).
449
- #
450
- # @param customer_message [String] The customer-facing string. Always generic (`C11`) for the fraud-4.
451
- #
452
- # @param customer_template [Symbol, Dodopayments::Models::Payment::FailureDetails::CustomerTemplate] The customer message template identifier (C1..C20).
453
- #
454
- # @param decline_type [Symbol, Dodopayments::Models::Payment::FailureDetails::DeclineType] Soft or hard decline.
455
- #
456
- # @param merchant_message [String] Merchant-facing headline + recommended action (Payment Details). For the fraud-4
457
-
458
- # The primary CTA to show the customer.
459
- #
460
- # @see Dodopayments::Models::Payment::FailureDetails#customer_cta
461
- module CustomerCta
462
- extend Dodopayments::Internal::Type::Enum
463
-
464
- EDIT_AND_RETRY = :edit_and_retry
465
- USE_ANOTHER_METHOD = :use_another_method
466
- TRY_AGAIN = :try_again
467
- TRY_LATER = :try_later
468
- RETRY_AND_VERIFY = :retry_and_verify
469
- RESTART = :restart
470
- UPDATE_METHOD = :update_method
471
-
472
- # @!method self.values
473
- # @return [Array<Symbol>]
474
- end
475
-
476
- # The customer message template identifier (C1..C20).
477
- #
478
- # @see Dodopayments::Models::Payment::FailureDetails#customer_template
479
- module CustomerTemplate
480
- extend Dodopayments::Internal::Type::Enum
481
-
482
- C1 = :C1
483
- C2 = :C2
484
- C3 = :C3
485
- C4 = :C4
486
- C5 = :C5
487
- C6 = :C6
488
- C7 = :C7
489
- C8 = :C8
490
- C9 = :C9
491
- C10 = :C10
492
- C11 = :C11
493
- C12 = :C12
494
- C13 = :C13
495
- C14 = :C14
496
- C15 = :C15
497
- C16 = :C16
498
- C17 = :C17
499
- C18 = :C18
500
- C19 = :C19
501
- C20 = :C20
502
-
503
- # @!method self.values
504
- # @return [Array<Symbol>]
505
- end
506
-
507
- # Soft or hard decline.
508
- #
509
- # @see Dodopayments::Models::Payment::FailureDetails#decline_type
510
- module DeclineType
511
- extend Dodopayments::Internal::Type::Enum
512
-
513
- SOFT = :soft
514
- HARD = :hard
515
-
516
- # @!method self.values
517
- # @return [Array<Symbol>]
518
- end
519
- end
520
-
521
379
  class ProductCart < Dodopayments::Internal::Type::BaseModel
522
380
  # @!attribute product_id
523
381
  #
@@ -38,7 +38,8 @@ module Dodopayments
38
38
  optional :customer_id, String
39
39
 
40
40
  # @!attribute page_number
41
- # Page number default is 0
41
+ # Page number default is 0. Capped to bound OFFSET-based deep pagination, which
42
+ # forces Postgres to scan and discard every preceding row.
42
43
  #
43
44
  # @return [Integer, nil]
44
45
  optional :page_number, Integer
@@ -68,6 +69,9 @@ module Dodopayments
68
69
  optional :subscription_id, String
69
70
 
70
71
  # @!method initialize(brand_id: nil, created_at_gte: nil, created_at_lte: nil, currency: nil, customer_id: nil, page_number: nil, page_size: nil, product_id: nil, status: nil, subscription_id: nil, request_options: {})
72
+ # Some parameter documentations has been truncated, see
73
+ # {Dodopayments::Models::PaymentListParams} for more details.
74
+ #
71
75
  # @param brand_id [String] filter by Brand id
72
76
  #
73
77
  # @param created_at_gte [Time] Get events after this created time
@@ -78,7 +82,7 @@ module Dodopayments
78
82
  #
79
83
  # @param customer_id [String] Filter by customer id
80
84
  #
81
- # @param page_number [Integer] Page number default is 0
85
+ # @param page_number [Integer] Page number default is 0. Capped to bound OFFSET-based deep pagination,
82
86
  #
83
87
  # @param page_size [Integer] Page size default is 10 max is 100
84
88
  #
@@ -0,0 +1,188 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ class PayoutCreatedWebhookEvent < Dodopayments::Internal::Type::BaseModel
6
+ # @!attribute business_id
7
+ # The business identifier
8
+ #
9
+ # @return [String]
10
+ required :business_id, String
11
+
12
+ # @!attribute data
13
+ #
14
+ # @return [Dodopayments::Models::PayoutCreatedWebhookEvent::Data]
15
+ required :data, -> { Dodopayments::PayoutCreatedWebhookEvent::Data }
16
+
17
+ # @!attribute timestamp
18
+ # The timestamp of when the event occurred
19
+ #
20
+ # @return [Time]
21
+ required :timestamp, Time
22
+
23
+ # @!attribute type
24
+ # The event type
25
+ #
26
+ # @return [Symbol, :"payout.created"]
27
+ required :type, const: :"payout.created"
28
+
29
+ # @!method initialize(business_id:, data:, timestamp:, type: :"payout.created")
30
+ # @param business_id [String] The business identifier
31
+ #
32
+ # @param data [Dodopayments::Models::PayoutCreatedWebhookEvent::Data]
33
+ #
34
+ # @param timestamp [Time] The timestamp of when the event occurred
35
+ #
36
+ # @param type [Symbol, :"payout.created"] The event type
37
+
38
+ # @see Dodopayments::Models::PayoutCreatedWebhookEvent#data
39
+ class Data < Dodopayments::Internal::Type::BaseModel
40
+ # @!attribute amount
41
+ # The total amount of the payout.
42
+ #
43
+ # @return [Integer]
44
+ required :amount, Integer
45
+
46
+ # @!attribute business_id
47
+ # The unique identifier of the business associated with the payout.
48
+ #
49
+ # @return [String]
50
+ required :business_id, String
51
+
52
+ # @!attribute chargebacks
53
+ # @deprecated Use the v3 payout breakup endpoints instead. Will be removed in a future
54
+ # release.
55
+ #
56
+ # The total value of chargebacks associated with the payout.
57
+ #
58
+ # @return [Integer]
59
+ required :chargebacks, Integer
60
+
61
+ # @!attribute created_at
62
+ # The timestamp when the payout was created, in UTC.
63
+ #
64
+ # @return [Time]
65
+ required :created_at, Time
66
+
67
+ # @!attribute currency
68
+ # The currency of the payout, represented as an ISO 4217 currency code.
69
+ #
70
+ # @return [Symbol, Dodopayments::Models::Currency]
71
+ required :currency, enum: -> { Dodopayments::Currency }
72
+
73
+ # @!attribute fee
74
+ # The fee charged for processing the payout.
75
+ #
76
+ # @return [Integer]
77
+ required :fee, Integer
78
+
79
+ # @!attribute payment_method
80
+ # The payment method used for the payout (e.g., bank transfer, card, etc.).
81
+ #
82
+ # @return [String]
83
+ required :payment_method, String
84
+
85
+ # @!attribute payout_id
86
+ # The unique identifier of the payout.
87
+ #
88
+ # @return [String]
89
+ required :payout_id, String
90
+
91
+ # @!attribute refunds
92
+ # @deprecated Use the v3 payout breakup endpoints instead. Will be removed in a future
93
+ # release.
94
+ #
95
+ # The total value of refunds associated with the payout.
96
+ #
97
+ # @return [Integer]
98
+ required :refunds, Integer
99
+
100
+ # @!attribute status
101
+ # The current status of the payout.
102
+ #
103
+ # @return [Symbol, Dodopayments::Models::PayoutCreatedWebhookEvent::Data::Status]
104
+ required :status, enum: -> { Dodopayments::PayoutCreatedWebhookEvent::Data::Status }
105
+
106
+ # @!attribute tax
107
+ # @deprecated Use the v3 payout breakup endpoints instead. Will be removed in a future
108
+ # release.
109
+ #
110
+ # The tax applied to the payout.
111
+ #
112
+ # @return [Integer]
113
+ required :tax, Integer
114
+
115
+ # @!attribute updated_at
116
+ # The timestamp when the payout was last updated, in UTC.
117
+ #
118
+ # @return [Time]
119
+ required :updated_at, Time
120
+
121
+ # @!attribute name
122
+ # The name of the payout recipient or purpose.
123
+ #
124
+ # @return [String, nil]
125
+ optional :name, String, nil?: true
126
+
127
+ # @!attribute payout_document_url
128
+ # The URL of the document associated with the payout.
129
+ #
130
+ # @return [String, nil]
131
+ optional :payout_document_url, String, nil?: true
132
+
133
+ # @!attribute remarks
134
+ # Any additional remarks or notes associated with the payout.
135
+ #
136
+ # @return [String, nil]
137
+ optional :remarks, String, nil?: true
138
+
139
+ # @!method initialize(amount:, business_id:, chargebacks:, created_at:, currency:, fee:, payment_method:, payout_id:, refunds:, status:, tax:, updated_at:, name: nil, payout_document_url: nil, remarks: nil)
140
+ # @param amount [Integer] The total amount of the payout.
141
+ #
142
+ # @param business_id [String] The unique identifier of the business associated with the payout.
143
+ #
144
+ # @param chargebacks [Integer] The total value of chargebacks associated with the payout.
145
+ #
146
+ # @param created_at [Time] The timestamp when the payout was created, in UTC.
147
+ #
148
+ # @param currency [Symbol, Dodopayments::Models::Currency] The currency of the payout, represented as an ISO 4217 currency code.
149
+ #
150
+ # @param fee [Integer] The fee charged for processing the payout.
151
+ #
152
+ # @param payment_method [String] The payment method used for the payout (e.g., bank transfer, card, etc.).
153
+ #
154
+ # @param payout_id [String] The unique identifier of the payout.
155
+ #
156
+ # @param refunds [Integer] The total value of refunds associated with the payout.
157
+ #
158
+ # @param status [Symbol, Dodopayments::Models::PayoutCreatedWebhookEvent::Data::Status] The current status of the payout.
159
+ #
160
+ # @param tax [Integer] The tax applied to the payout.
161
+ #
162
+ # @param updated_at [Time] The timestamp when the payout was last updated, in UTC.
163
+ #
164
+ # @param name [String, nil] The name of the payout recipient or purpose.
165
+ #
166
+ # @param payout_document_url [String, nil] The URL of the document associated with the payout.
167
+ #
168
+ # @param remarks [String, nil] Any additional remarks or notes associated with the payout.
169
+
170
+ # The current status of the payout.
171
+ #
172
+ # @see Dodopayments::Models::PayoutCreatedWebhookEvent::Data#status
173
+ module Status
174
+ extend Dodopayments::Internal::Type::Enum
175
+
176
+ NOT_INITIATED = :not_initiated
177
+ IN_PROGRESS = :in_progress
178
+ ON_HOLD = :on_hold
179
+ FAILED = :failed
180
+ SUCCESS = :success
181
+
182
+ # @!method self.values
183
+ # @return [Array<Symbol>]
184
+ end
185
+ end
186
+ end
187
+ end
188
+ end
@@ -0,0 +1,188 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ class PayoutFailedWebhookEvent < Dodopayments::Internal::Type::BaseModel
6
+ # @!attribute business_id
7
+ # The business identifier
8
+ #
9
+ # @return [String]
10
+ required :business_id, String
11
+
12
+ # @!attribute data
13
+ #
14
+ # @return [Dodopayments::Models::PayoutFailedWebhookEvent::Data]
15
+ required :data, -> { Dodopayments::PayoutFailedWebhookEvent::Data }
16
+
17
+ # @!attribute timestamp
18
+ # The timestamp of when the event occurred
19
+ #
20
+ # @return [Time]
21
+ required :timestamp, Time
22
+
23
+ # @!attribute type
24
+ # The event type
25
+ #
26
+ # @return [Symbol, :"payout.failed"]
27
+ required :type, const: :"payout.failed"
28
+
29
+ # @!method initialize(business_id:, data:, timestamp:, type: :"payout.failed")
30
+ # @param business_id [String] The business identifier
31
+ #
32
+ # @param data [Dodopayments::Models::PayoutFailedWebhookEvent::Data]
33
+ #
34
+ # @param timestamp [Time] The timestamp of when the event occurred
35
+ #
36
+ # @param type [Symbol, :"payout.failed"] The event type
37
+
38
+ # @see Dodopayments::Models::PayoutFailedWebhookEvent#data
39
+ class Data < Dodopayments::Internal::Type::BaseModel
40
+ # @!attribute amount
41
+ # The total amount of the payout.
42
+ #
43
+ # @return [Integer]
44
+ required :amount, Integer
45
+
46
+ # @!attribute business_id
47
+ # The unique identifier of the business associated with the payout.
48
+ #
49
+ # @return [String]
50
+ required :business_id, String
51
+
52
+ # @!attribute chargebacks
53
+ # @deprecated Use the v3 payout breakup endpoints instead. Will be removed in a future
54
+ # release.
55
+ #
56
+ # The total value of chargebacks associated with the payout.
57
+ #
58
+ # @return [Integer]
59
+ required :chargebacks, Integer
60
+
61
+ # @!attribute created_at
62
+ # The timestamp when the payout was created, in UTC.
63
+ #
64
+ # @return [Time]
65
+ required :created_at, Time
66
+
67
+ # @!attribute currency
68
+ # The currency of the payout, represented as an ISO 4217 currency code.
69
+ #
70
+ # @return [Symbol, Dodopayments::Models::Currency]
71
+ required :currency, enum: -> { Dodopayments::Currency }
72
+
73
+ # @!attribute fee
74
+ # The fee charged for processing the payout.
75
+ #
76
+ # @return [Integer]
77
+ required :fee, Integer
78
+
79
+ # @!attribute payment_method
80
+ # The payment method used for the payout (e.g., bank transfer, card, etc.).
81
+ #
82
+ # @return [String]
83
+ required :payment_method, String
84
+
85
+ # @!attribute payout_id
86
+ # The unique identifier of the payout.
87
+ #
88
+ # @return [String]
89
+ required :payout_id, String
90
+
91
+ # @!attribute refunds
92
+ # @deprecated Use the v3 payout breakup endpoints instead. Will be removed in a future
93
+ # release.
94
+ #
95
+ # The total value of refunds associated with the payout.
96
+ #
97
+ # @return [Integer]
98
+ required :refunds, Integer
99
+
100
+ # @!attribute status
101
+ # The current status of the payout.
102
+ #
103
+ # @return [Symbol, Dodopayments::Models::PayoutFailedWebhookEvent::Data::Status]
104
+ required :status, enum: -> { Dodopayments::PayoutFailedWebhookEvent::Data::Status }
105
+
106
+ # @!attribute tax
107
+ # @deprecated Use the v3 payout breakup endpoints instead. Will be removed in a future
108
+ # release.
109
+ #
110
+ # The tax applied to the payout.
111
+ #
112
+ # @return [Integer]
113
+ required :tax, Integer
114
+
115
+ # @!attribute updated_at
116
+ # The timestamp when the payout was last updated, in UTC.
117
+ #
118
+ # @return [Time]
119
+ required :updated_at, Time
120
+
121
+ # @!attribute name
122
+ # The name of the payout recipient or purpose.
123
+ #
124
+ # @return [String, nil]
125
+ optional :name, String, nil?: true
126
+
127
+ # @!attribute payout_document_url
128
+ # The URL of the document associated with the payout.
129
+ #
130
+ # @return [String, nil]
131
+ optional :payout_document_url, String, nil?: true
132
+
133
+ # @!attribute remarks
134
+ # Any additional remarks or notes associated with the payout.
135
+ #
136
+ # @return [String, nil]
137
+ optional :remarks, String, nil?: true
138
+
139
+ # @!method initialize(amount:, business_id:, chargebacks:, created_at:, currency:, fee:, payment_method:, payout_id:, refunds:, status:, tax:, updated_at:, name: nil, payout_document_url: nil, remarks: nil)
140
+ # @param amount [Integer] The total amount of the payout.
141
+ #
142
+ # @param business_id [String] The unique identifier of the business associated with the payout.
143
+ #
144
+ # @param chargebacks [Integer] The total value of chargebacks associated with the payout.
145
+ #
146
+ # @param created_at [Time] The timestamp when the payout was created, in UTC.
147
+ #
148
+ # @param currency [Symbol, Dodopayments::Models::Currency] The currency of the payout, represented as an ISO 4217 currency code.
149
+ #
150
+ # @param fee [Integer] The fee charged for processing the payout.
151
+ #
152
+ # @param payment_method [String] The payment method used for the payout (e.g., bank transfer, card, etc.).
153
+ #
154
+ # @param payout_id [String] The unique identifier of the payout.
155
+ #
156
+ # @param refunds [Integer] The total value of refunds associated with the payout.
157
+ #
158
+ # @param status [Symbol, Dodopayments::Models::PayoutFailedWebhookEvent::Data::Status] The current status of the payout.
159
+ #
160
+ # @param tax [Integer] The tax applied to the payout.
161
+ #
162
+ # @param updated_at [Time] The timestamp when the payout was last updated, in UTC.
163
+ #
164
+ # @param name [String, nil] The name of the payout recipient or purpose.
165
+ #
166
+ # @param payout_document_url [String, nil] The URL of the document associated with the payout.
167
+ #
168
+ # @param remarks [String, nil] Any additional remarks or notes associated with the payout.
169
+
170
+ # The current status of the payout.
171
+ #
172
+ # @see Dodopayments::Models::PayoutFailedWebhookEvent::Data#status
173
+ module Status
174
+ extend Dodopayments::Internal::Type::Enum
175
+
176
+ NOT_INITIATED = :not_initiated
177
+ IN_PROGRESS = :in_progress
178
+ ON_HOLD = :on_hold
179
+ FAILED = :failed
180
+ SUCCESS = :success
181
+
182
+ # @!method self.values
183
+ # @return [Array<Symbol>]
184
+ end
185
+ end
186
+ end
187
+ end
188
+ end