dodopayments 2.14.0 → 2.16.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 (94) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +12 -3
  3. data/README.md +1 -1
  4. data/lib/dodopayments/models/abandoned_checkout_detected_webhook_event.rb +14 -1
  5. data/lib/dodopayments/models/abandoned_checkout_recovered_webhook_event.rb +14 -1
  6. data/lib/dodopayments/models/checkout_session_preview_response.rb +15 -1
  7. data/lib/dodopayments/models/credit_balance_low_webhook_event.rb +16 -1
  8. data/lib/dodopayments/models/credit_entitlements/credit_ledger_entry.rb +24 -1
  9. data/lib/dodopayments/models/customer_retrieve_payment_methods_response.rb +2 -2
  10. data/lib/dodopayments/models/dispute_list_response.rb +2 -2
  11. data/lib/dodopayments/models/dunning_recovered_webhook_event.rb +14 -1
  12. data/lib/dodopayments/models/dunning_started_webhook_event.rb +14 -1
  13. data/lib/dodopayments/models/entitlements/entitlement_grant.rb +9 -1
  14. data/lib/dodopayments/models/entitlements/grant_list_params.rb +1 -26
  15. data/lib/dodopayments/models/get_dispute.rb +35 -1
  16. data/lib/dodopayments/models/integration_config.rb +7 -7
  17. data/lib/dodopayments/models/integration_config_response.rb +7 -11
  18. data/lib/dodopayments/models/license_key.rb +9 -1
  19. data/lib/dodopayments/models/payment.rb +9 -9
  20. data/lib/dodopayments/models/payment_create_response.rb +3 -2
  21. data/lib/dodopayments/models/payment_list_response.rb +2 -4
  22. data/lib/dodopayments/models/payment_method_types.rb +1 -1
  23. data/lib/dodopayments/models/payouts/breakup/detail_list_response.rb +7 -6
  24. data/lib/dodopayments/models/payouts/breakup_retrieve_response.rb +3 -3
  25. data/lib/dodopayments/models/product.rb +24 -1
  26. data/lib/dodopayments/models/product_create_params.rb +28 -5
  27. data/lib/dodopayments/models/product_list_response.rb +24 -1
  28. data/lib/dodopayments/models/product_update_params.rb +24 -1
  29. data/lib/dodopayments/models/refund.rb +9 -1
  30. data/lib/dodopayments/models/subscription.rb +12 -4
  31. data/lib/dodopayments/models/subscription_list_response.rb +3 -3
  32. data/lib/dodopayments/models/subscription_preview_change_plan_response.rb +16 -1
  33. data/lib/dodopayments/models/subscription_retrieve_usage_history_response.rb +7 -2
  34. data/lib/dodopayments/models/theme_config.rb +1 -1
  35. data/lib/dodopayments/models/webhook_payload.rb +47 -3
  36. data/lib/dodopayments/resources/entitlements/grants.rb +1 -3
  37. data/lib/dodopayments/resources/products.rb +8 -4
  38. data/lib/dodopayments/version.rb +1 -1
  39. data/rbi/dodopayments/models/abandoned_checkout_detected_webhook_event.rbi +8 -0
  40. data/rbi/dodopayments/models/abandoned_checkout_recovered_webhook_event.rbi +8 -0
  41. data/rbi/dodopayments/models/checkout_session_preview_response.rbi +14 -0
  42. data/rbi/dodopayments/models/credit_balance_low_webhook_event.rbi +8 -0
  43. data/rbi/dodopayments/models/credit_entitlements/credit_ledger_entry.rbi +8 -0
  44. data/rbi/dodopayments/models/customer_retrieve_payment_methods_response.rbi +2 -2
  45. data/rbi/dodopayments/models/dispute_list_response.rbi +3 -3
  46. data/rbi/dodopayments/models/dunning_recovered_webhook_event.rbi +8 -0
  47. data/rbi/dodopayments/models/dunning_started_webhook_event.rbi +8 -0
  48. data/rbi/dodopayments/models/entitlements/entitlement_grant.rbi +8 -0
  49. data/rbi/dodopayments/models/entitlements/grant_list_params.rbi +0 -89
  50. data/rbi/dodopayments/models/get_dispute.rbi +52 -0
  51. data/rbi/dodopayments/models/integration_config.rbi +9 -9
  52. data/rbi/dodopayments/models/integration_config_response.rbi +9 -15
  53. data/rbi/dodopayments/models/license_key.rbi +8 -0
  54. data/rbi/dodopayments/models/payment.rbi +13 -12
  55. data/rbi/dodopayments/models/payment_create_response.rbi +4 -2
  56. data/rbi/dodopayments/models/payment_list_response.rbi +3 -6
  57. data/rbi/dodopayments/models/payment_method_types.rbi +1 -1
  58. data/rbi/dodopayments/models/payouts/breakup/detail_list_response.rbi +10 -8
  59. data/rbi/dodopayments/models/payouts/breakup_retrieve_response.rbi +4 -4
  60. data/rbi/dodopayments/models/product.rbi +36 -0
  61. data/rbi/dodopayments/models/product_create_params.rbi +58 -4
  62. data/rbi/dodopayments/models/product_list_response.rbi +58 -0
  63. data/rbi/dodopayments/models/product_update_params.rbi +54 -0
  64. data/rbi/dodopayments/models/refund.rbi +8 -0
  65. data/rbi/dodopayments/models/subscription.rbi +12 -4
  66. data/rbi/dodopayments/models/subscription_list_response.rbi +4 -4
  67. data/rbi/dodopayments/models/subscription_preview_change_plan_response.rbi +10 -0
  68. data/rbi/dodopayments/models/subscription_retrieve_usage_history_response.rbi +4 -2
  69. data/rbi/dodopayments/models/theme_config.rbi +1 -1
  70. data/rbi/dodopayments/models/webhook_payload.rbi +24 -0
  71. data/rbi/dodopayments/resources/entitlements/grants.rbi +0 -4
  72. data/rbi/dodopayments/resources/products.rbi +14 -2
  73. data/sig/dodopayments/models/abandoned_checkout_detected_webhook_event.rbs +5 -0
  74. data/sig/dodopayments/models/abandoned_checkout_recovered_webhook_event.rbs +5 -0
  75. data/sig/dodopayments/models/checkout_session_preview_response.rbs +5 -0
  76. data/sig/dodopayments/models/credit_balance_low_webhook_event.rbs +5 -0
  77. data/sig/dodopayments/models/credit_entitlements/credit_ledger_entry.rbs +5 -0
  78. data/sig/dodopayments/models/dunning_recovered_webhook_event.rbs +5 -0
  79. data/sig/dodopayments/models/dunning_started_webhook_event.rbs +5 -0
  80. data/sig/dodopayments/models/entitlements/entitlement_grant.rbs +5 -0
  81. data/sig/dodopayments/models/entitlements/grant_list_params.rbs +0 -34
  82. data/sig/dodopayments/models/get_dispute.rbs +22 -0
  83. data/sig/dodopayments/models/license_key.rbs +5 -0
  84. data/sig/dodopayments/models/product.rbs +16 -0
  85. data/sig/dodopayments/models/product_create_params.rbs +17 -1
  86. data/sig/dodopayments/models/product_list_response.rbs +16 -0
  87. data/sig/dodopayments/models/product_update_params.rbs +16 -0
  88. data/sig/dodopayments/models/refund.rbs +5 -0
  89. data/sig/dodopayments/models/subscription.rbs +5 -0
  90. data/sig/dodopayments/models/theme_config.rbs +1 -1
  91. data/sig/dodopayments/models/webhook_payload.rbs +15 -0
  92. data/sig/dodopayments/resources/entitlements/grants.rbs +0 -1
  93. data/sig/dodopayments/resources/products.rbs +2 -0
  94. metadata +2 -2
@@ -13,6 +13,10 @@ module Dodopayments
13
13
  sig { returns(String) }
14
14
  attr_accessor :amount
15
15
 
16
+ # Brand id this dispute belongs to
17
+ sig { returns(String) }
18
+ attr_accessor :brand_id
19
+
16
20
  # The unique identifier of the business involved in the dispute.
17
21
  sig { returns(String) }
18
22
  attr_accessor :business_id
@@ -50,6 +54,12 @@ module Dodopayments
50
54
  sig { returns(String) }
51
55
  attr_accessor :payment_id
52
56
 
57
+ # Which processor handled the underlying payment. `stripe` / `adyen` for BYOP
58
+ # routes (the merchant's own payment connector); `dodo` for everything Dodo
59
+ # processed itself.
60
+ sig { returns(Dodopayments::GetDispute::PaymentProvider::TaggedSymbol) }
61
+ attr_accessor :payment_provider
62
+
53
63
  # Whether the dispute was resolved by Rapid Dispute Resolution
54
64
  sig { returns(T.nilable(T::Boolean)) }
55
65
  attr_accessor :is_resolved_by_rdr
@@ -65,6 +75,7 @@ module Dodopayments
65
75
  sig do
66
76
  params(
67
77
  amount: String,
78
+ brand_id: String,
68
79
  business_id: String,
69
80
  created_at: Time,
70
81
  currency: String,
@@ -73,6 +84,7 @@ module Dodopayments
73
84
  dispute_stage: Dodopayments::DisputeStage::OrSymbol,
74
85
  dispute_status: Dodopayments::DisputeStatus::OrSymbol,
75
86
  payment_id: String,
87
+ payment_provider: Dodopayments::GetDispute::PaymentProvider::OrSymbol,
76
88
  is_resolved_by_rdr: T.nilable(T::Boolean),
77
89
  reason: T.nilable(String),
78
90
  remarks: T.nilable(String)
@@ -82,6 +94,8 @@ module Dodopayments
82
94
  # The amount involved in the dispute, represented as a string to accommodate
83
95
  # precision.
84
96
  amount:,
97
+ # Brand id this dispute belongs to
98
+ brand_id:,
85
99
  # The unique identifier of the business involved in the dispute.
86
100
  business_id:,
87
101
  # The timestamp of when the dispute was created, in UTC.
@@ -98,6 +112,10 @@ module Dodopayments
98
112
  dispute_status:,
99
113
  # The unique identifier of the payment associated with the dispute.
100
114
  payment_id:,
115
+ # Which processor handled the underlying payment. `stripe` / `adyen` for BYOP
116
+ # routes (the merchant's own payment connector); `dodo` for everything Dodo
117
+ # processed itself.
118
+ payment_provider:,
101
119
  # Whether the dispute was resolved by Rapid Dispute Resolution
102
120
  is_resolved_by_rdr: nil,
103
121
  # Reason for the dispute
@@ -111,6 +129,7 @@ module Dodopayments
111
129
  override.returns(
112
130
  {
113
131
  amount: String,
132
+ brand_id: String,
114
133
  business_id: String,
115
134
  created_at: Time,
116
135
  currency: String,
@@ -119,6 +138,8 @@ module Dodopayments
119
138
  dispute_stage: Dodopayments::DisputeStage::TaggedSymbol,
120
139
  dispute_status: Dodopayments::DisputeStatus::TaggedSymbol,
121
140
  payment_id: String,
141
+ payment_provider:
142
+ Dodopayments::GetDispute::PaymentProvider::TaggedSymbol,
122
143
  is_resolved_by_rdr: T.nilable(T::Boolean),
123
144
  reason: T.nilable(String),
124
145
  remarks: T.nilable(String)
@@ -127,6 +148,37 @@ module Dodopayments
127
148
  end
128
149
  def to_hash
129
150
  end
151
+
152
+ # Which processor handled the underlying payment. `stripe` / `adyen` for BYOP
153
+ # routes (the merchant's own payment connector); `dodo` for everything Dodo
154
+ # processed itself.
155
+ module PaymentProvider
156
+ extend Dodopayments::Internal::Type::Enum
157
+
158
+ TaggedSymbol =
159
+ T.type_alias do
160
+ T.all(Symbol, Dodopayments::GetDispute::PaymentProvider)
161
+ end
162
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
163
+
164
+ STRIPE =
165
+ T.let(
166
+ :stripe,
167
+ Dodopayments::GetDispute::PaymentProvider::TaggedSymbol
168
+ )
169
+ ADYEN =
170
+ T.let(:adyen, Dodopayments::GetDispute::PaymentProvider::TaggedSymbol)
171
+ DODO =
172
+ T.let(:dodo, Dodopayments::GetDispute::PaymentProvider::TaggedSymbol)
173
+
174
+ sig do
175
+ override.returns(
176
+ T::Array[Dodopayments::GetDispute::PaymentProvider::TaggedSymbol]
177
+ )
178
+ end
179
+ def self.values
180
+ end
181
+ end
130
182
  end
131
183
  end
132
184
  end
@@ -308,9 +308,9 @@ module Dodopayments
308
308
  sig { returns(T.nilable(Dodopayments::TimeInterval::OrSymbol)) }
309
309
  attr_accessor :duration_interval
310
310
 
311
- # Fulfillment mode: `auto` (default) generates keys automatically; `manual`
312
- # creates pending grants the merchant fulfills via the
313
- # `POST /grants/{id}/license-key` endpoint.
311
+ # How license keys are fulfilled. `auto` (default) generates and delivers keys to
312
+ # customers automatically; `manual` creates pending grants that you fulfill with
313
+ # the supplied key via `POST /grants/{grant_id}/license-key`.
314
314
  sig do
315
315
  returns(
316
316
  T.nilable(
@@ -344,9 +344,9 @@ module Dodopayments
344
344
  duration_count: nil,
345
345
  # Unit of `duration_count`.
346
346
  duration_interval: nil,
347
- # Fulfillment mode: `auto` (default) generates keys automatically; `manual`
348
- # creates pending grants the merchant fulfills via the
349
- # `POST /grants/{id}/license-key` endpoint.
347
+ # How license keys are fulfilled. `auto` (default) generates and delivers keys to
348
+ # customers automatically; `manual` creates pending grants that you fulfill with
349
+ # the supplied key via `POST /grants/{grant_id}/license-key`.
350
350
  fulfillment_mode: nil
351
351
  )
352
352
  end
@@ -369,9 +369,9 @@ module Dodopayments
369
369
  def to_hash
370
370
  end
371
371
 
372
- # Fulfillment mode: `auto` (default) generates keys automatically; `manual`
373
- # creates pending grants the merchant fulfills via the
374
- # `POST /grants/{id}/license-key` endpoint.
372
+ # How license keys are fulfilled. `auto` (default) generates and delivers keys to
373
+ # customers automatically; `manual` creates pending grants that you fulfill with
374
+ # the supplied key via `POST /grants/{grant_id}/license-key`.
375
375
  module FulfillmentMode
376
376
  extend Dodopayments::Internal::Type::Enum
377
377
 
@@ -425,11 +425,9 @@ module Dodopayments
425
425
  sig { returns(T.nilable(Dodopayments::TimeInterval::TaggedSymbol)) }
426
426
  attr_accessor :duration_interval
427
427
 
428
- # Fulfillment mode:
429
- #
430
- # `auto` (default) generate and delivery license keys to customers automatically.
431
- # `manual` creates pending grants, actual key is provided via the fulfillment API
432
- # and delivered to the customer when fulfilled.
428
+ # How license keys are fulfilled. `auto` (default) generates and delivers keys to
429
+ # customers automatically; `manual` creates pending grants that you fulfill with
430
+ # the supplied key via `POST /grants/{grant_id}/license-key`.
433
431
  sig do
434
432
  returns(
435
433
  T.nilable(
@@ -463,11 +461,9 @@ module Dodopayments
463
461
  duration_count: nil,
464
462
  # Unit of `duration_count`.
465
463
  duration_interval: nil,
466
- # Fulfillment mode:
467
- #
468
- # `auto` (default) generate and delivery license keys to customers automatically.
469
- # `manual` creates pending grants, actual key is provided via the fulfillment API
470
- # and delivered to the customer when fulfilled.
464
+ # How license keys are fulfilled. `auto` (default) generates and delivers keys to
465
+ # customers automatically; `manual` creates pending grants that you fulfill with
466
+ # the supplied key via `POST /grants/{grant_id}/license-key`.
471
467
  fulfillment_mode: nil
472
468
  )
473
469
  end
@@ -490,11 +486,9 @@ module Dodopayments
490
486
  def to_hash
491
487
  end
492
488
 
493
- # Fulfillment mode:
494
- #
495
- # `auto` (default) generate and delivery license keys to customers automatically.
496
- # `manual` creates pending grants, actual key is provided via the fulfillment API
497
- # and delivered to the customer when fulfilled.
489
+ # How license keys are fulfilled. `auto` (default) generates and delivers keys to
490
+ # customers automatically; `manual` creates pending grants that you fulfill with
491
+ # the supplied key via `POST /grants/{grant_id}/license-key`.
498
492
  module FulfillmentMode
499
493
  extend Dodopayments::Internal::Type::Enum
500
494
 
@@ -12,6 +12,10 @@ module Dodopayments
12
12
  sig { returns(String) }
13
13
  attr_accessor :id
14
14
 
15
+ # Brand id this license key belongs to
16
+ sig { returns(String) }
17
+ attr_accessor :brand_id
18
+
15
19
  # The unique identifier of the business associated with the license key.
16
20
  sig { returns(String) }
17
21
  attr_accessor :business_id
@@ -65,6 +69,7 @@ module Dodopayments
65
69
  sig do
66
70
  params(
67
71
  id: String,
72
+ brand_id: String,
68
73
  business_id: String,
69
74
  created_at: Time,
70
75
  customer_id: String,
@@ -82,6 +87,8 @@ module Dodopayments
82
87
  def self.new(
83
88
  # The unique identifier of the license key.
84
89
  id:,
90
+ # Brand id this license key belongs to
91
+ brand_id:,
85
92
  # The unique identifier of the business associated with the license key.
86
93
  business_id:,
87
94
  # The timestamp indicating when the license key was created, in UTC.
@@ -115,6 +122,7 @@ module Dodopayments
115
122
  override.returns(
116
123
  {
117
124
  id: String,
125
+ brand_id: String,
118
126
  business_id: String,
119
127
  created_at: Time,
120
128
  customer_id: String,
@@ -57,8 +57,7 @@ module Dodopayments
57
57
  attr_accessor :payment_id
58
58
 
59
59
  # Which processor handled this payment. `stripe` / `adyen` for BYOP routes (the
60
- # merchant's own Hyperswitch connector); `dodo` for everything Dodo processed
61
- # itself.
60
+ # merchant's own payment connector); `dodo` for everything Dodo processed itself.
62
61
  sig { returns(Dodopayments::Payment::PaymentProvider::TaggedSymbol) }
63
62
  attr_accessor :payment_provider
64
63
 
@@ -84,8 +83,9 @@ module Dodopayments
84
83
  sig { returns(Dodopayments::Currency::TaggedSymbol) }
85
84
  attr_accessor :settlement_currency
86
85
 
87
- # Total amount charged to the customer including tax, in smallest currency unit
88
- # (e.g. cents)
86
+ # Total amount charged to the customer including tax, in the currency's smallest
87
+ # unit (e.g. cents for USD, yen for JPY, fils for KWD — see the currency's decimal
88
+ # places)
89
89
  sig { returns(Integer) }
90
90
  attr_accessor :total_amount
91
91
 
@@ -179,7 +179,8 @@ module Dodopayments
179
179
  sig { returns(T.nilable(String)) }
180
180
  attr_accessor :subscription_id
181
181
 
182
- # Amount of tax collected in smallest currency unit (e.g. cents)
182
+ # Amount of tax collected in the currency's smallest unit (e.g. cents for USD, yen
183
+ # for JPY, fils for KWD)
183
184
  sig { returns(T.nilable(Integer)) }
184
185
  attr_accessor :tax
185
186
 
@@ -254,8 +255,7 @@ module Dodopayments
254
255
  # Unique identifier for the payment
255
256
  payment_id:,
256
257
  # Which processor handled this payment. `stripe` / `adyen` for BYOP routes (the
257
- # merchant's own Hyperswitch connector); `dodo` for everything Dodo processed
258
- # itself.
258
+ # merchant's own payment connector); `dodo` for everything Dodo processed itself.
259
259
  payment_provider:,
260
260
  # List of refunds issued for this payment
261
261
  refunds:,
@@ -271,8 +271,9 @@ module Dodopayments
271
271
  # balance. This may differ from the customer's payment currency in adaptive
272
272
  # pricing scenarios.
273
273
  settlement_currency:,
274
- # Total amount charged to the customer including tax, in smallest currency unit
275
- # (e.g. cents)
274
+ # Total amount charged to the customer including tax, in the currency's smallest
275
+ # unit (e.g. cents for USD, yen for JPY, fils for KWD — see the currency's decimal
276
+ # places)
276
277
  total_amount:,
277
278
  # Cardholder name
278
279
  card_holder_name: nil,
@@ -320,7 +321,8 @@ module Dodopayments
320
321
  status: nil,
321
322
  # Identifier of the subscription if payment is part of a subscription
322
323
  subscription_id: nil,
323
- # Amount of tax collected in smallest currency unit (e.g. cents)
324
+ # Amount of tax collected in the currency's smallest unit (e.g. cents for USD, yen
325
+ # for JPY, fils for KWD)
324
326
  tax: nil,
325
327
  # Timestamp when the payment was last updated
326
328
  updated_at: nil
@@ -381,8 +383,7 @@ module Dodopayments
381
383
  end
382
384
 
383
385
  # Which processor handled this payment. `stripe` / `adyen` for BYOP routes (the
384
- # merchant's own Hyperswitch connector); `dodo` for everything Dodo processed
385
- # itself.
386
+ # merchant's own payment connector); `dodo` for everything Dodo processed itself.
386
387
  module PaymentProvider
387
388
  extend Dodopayments::Internal::Type::Enum
388
389
 
@@ -33,7 +33,8 @@ module Dodopayments
33
33
  sig { returns(String) }
34
34
  attr_accessor :payment_id
35
35
 
36
- # Total amount of the payment in smallest currency unit (e.g. cents)
36
+ # Total amount of the payment in the currency's smallest unit (cents for USD, yen
37
+ # for JPY, fils for KWD)
37
38
  sig { returns(Integer) }
38
39
  attr_accessor :total_amount
39
40
 
@@ -83,7 +84,8 @@ module Dodopayments
83
84
  metadata:,
84
85
  # Unique identifier for the payment
85
86
  payment_id:,
86
- # Total amount of the payment in smallest currency unit (e.g. cents)
87
+ # Total amount of the payment in the currency's smallest unit (cents for USD, yen
88
+ # for JPY, fils for KWD)
87
89
  total_amount:,
88
90
  # DEPRECATED: Use discount_ids instead. Returns the first discount's ID if
89
91
  # present.
@@ -41,8 +41,7 @@ module Dodopayments
41
41
  attr_accessor :payment_id
42
42
 
43
43
  # Which processor handled this payment. `stripe` / `adyen` for BYOP routes (the
44
- # merchant's own Hyperswitch connector); `dodo` for everything Dodo processed
45
- # itself.
44
+ # merchant's own payment connector); `dodo` for everything Dodo processed itself.
46
45
  sig do
47
46
  returns(
48
47
  Dodopayments::Models::PaymentListResponse::PaymentProvider::TaggedSymbol
@@ -127,8 +126,7 @@ module Dodopayments
127
126
  metadata:,
128
127
  payment_id:,
129
128
  # Which processor handled this payment. `stripe` / `adyen` for BYOP routes (the
130
- # merchant's own Hyperswitch connector); `dodo` for everything Dodo processed
131
- # itself.
129
+ # merchant's own payment connector); `dodo` for everything Dodo processed itself.
132
130
  payment_provider:,
133
131
  total_amount:,
134
132
  # The last four digits of the card
@@ -184,8 +182,7 @@ module Dodopayments
184
182
  end
185
183
 
186
184
  # Which processor handled this payment. `stripe` / `adyen` for BYOP routes (the
187
- # merchant's own Hyperswitch connector); `dodo` for everything Dodo processed
188
- # itself.
185
+ # merchant's own payment connector); `dodo` for everything Dodo processed itself.
189
186
  module PaymentProvider
190
187
  extend Dodopayments::Internal::Type::Enum
191
188
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Dodopayments
4
4
  module Models
5
- # All supported payment method types (from Hyperswitch).
5
+ # All supported payment method types.
6
6
  #
7
7
  # Used for disabled-payment-methods filtering and validation.
8
8
  module PaymentMethodTypes
@@ -26,8 +26,8 @@ module Dodopayments
26
26
  sig { returns(String) }
27
27
  attr_accessor :event_type
28
28
 
29
- # Original amount in the original currency (in smallest currency unit, e.g.,
30
- # cents).
29
+ # Original amount in the original currency, in that currency's smallest unit
30
+ # (cents for USD, yen for JPY, fils for KWD).
31
31
  sig { returns(Integer) }
32
32
  attr_accessor :original_amount
33
33
 
@@ -35,8 +35,9 @@ module Dodopayments
35
35
  sig { returns(String) }
36
36
  attr_accessor :original_currency
37
37
 
38
- # Amount in the payout's currency (in smallest currency unit). Uses cumulative
39
- # rounding to ensure sum matches payout total exactly.
38
+ # Amount in the payout's currency, in that currency's smallest unit (cents for
39
+ # USD, yen for JPY, fils for KWD). Uses cumulative rounding to ensure sum matches
40
+ # payout total exactly.
40
41
  sig { returns(Integer) }
41
42
  attr_accessor :payout_currency_amount
42
43
 
@@ -75,13 +76,14 @@ module Dodopayments
75
76
  # The type of balance ledger event (e.g., "payment", "refund", "dispute",
76
77
  # "payment_fees").
77
78
  event_type:,
78
- # Original amount in the original currency (in smallest currency unit, e.g.,
79
- # cents).
79
+ # Original amount in the original currency, in that currency's smallest unit
80
+ # (cents for USD, yen for JPY, fils for KWD).
80
81
  original_amount:,
81
82
  # Original currency as ISO 4217 code (e.g., "USD", "EUR").
82
83
  original_currency:,
83
- # Amount in the payout's currency (in smallest currency unit). Uses cumulative
84
- # rounding to ensure sum matches payout total exactly.
84
+ # Amount in the payout's currency, in that currency's smallest unit (cents for
85
+ # USD, yen for JPY, fils for KWD). Uses cumulative rounding to ensure sum matches
86
+ # payout total exactly.
85
87
  payout_currency_amount:,
86
88
  # USD equivalent of the original amount (in cents).
87
89
  usd_equivalent_amount:,
@@ -17,8 +17,8 @@ module Dodopayments
17
17
  sig { returns(String) }
18
18
  attr_accessor :event_type
19
19
 
20
- # Total amount for this event type in the payout's currency (in smallest currency
21
- # unit, e.g., cents).
20
+ # Total amount for this event type in the payout's currency, in that currency's
21
+ # smallest unit (cents for USD, yen for JPY, fils for KWD).
22
22
  sig { returns(Integer) }
23
23
  attr_accessor :total
24
24
 
@@ -30,8 +30,8 @@ module Dodopayments
30
30
  # The type of balance ledger event (e.g., "payment", "refund", "dispute",
31
31
  # "payment_fees").
32
32
  event_type:,
33
- # Total amount for this event type in the payout's currency (in smallest currency
34
- # unit, e.g., cents).
33
+ # Total amount for this event type in the payout's currency, in that currency's
34
+ # smallest unit (cents for USD, yen for JPY, fils for KWD).
35
35
  total:
36
36
  )
37
37
  end
@@ -104,6 +104,13 @@ module Dodopayments
104
104
  sig { returns(T.nilable(String)) }
105
105
  attr_accessor :name
106
106
 
107
+ # Pricing mode for localized pricing. NULL means base-only (no localized rules
108
+ # apply).
109
+ sig do
110
+ returns(T.nilable(Dodopayments::Product::PricingMode::TaggedSymbol))
111
+ end
112
+ attr_accessor :pricing_mode
113
+
107
114
  # The product collection ID this product belongs to, if any
108
115
  sig { returns(T.nilable(String)) }
109
116
  attr_accessor :product_collection_id
@@ -139,6 +146,7 @@ module Dodopayments
139
146
  license_key_duration:
140
147
  T.nilable(Dodopayments::LicenseKeyDuration::OrHash),
141
148
  name: T.nilable(String),
149
+ pricing_mode: T.nilable(Dodopayments::Product::PricingMode::OrSymbol),
142
150
  product_collection_id: T.nilable(String)
143
151
  ).returns(T.attached_class)
144
152
  end
@@ -183,6 +191,9 @@ module Dodopayments
183
191
  license_key_duration: nil,
184
192
  # Name of the product, optional.
185
193
  name: nil,
194
+ # Pricing mode for localized pricing. NULL means base-only (no localized rules
195
+ # apply).
196
+ pricing_mode: nil,
186
197
  # The product collection ID this product belongs to, if any
187
198
  product_collection_id: nil
188
199
  )
@@ -213,12 +224,37 @@ module Dodopayments
213
224
  license_key_activations_limit: T.nilable(Integer),
214
225
  license_key_duration: T.nilable(Dodopayments::LicenseKeyDuration),
215
226
  name: T.nilable(String),
227
+ pricing_mode:
228
+ T.nilable(Dodopayments::Product::PricingMode::TaggedSymbol),
216
229
  product_collection_id: T.nilable(String)
217
230
  }
218
231
  )
219
232
  end
220
233
  def to_hash
221
234
  end
235
+
236
+ # Pricing mode for localized pricing. NULL means base-only (no localized rules
237
+ # apply).
238
+ module PricingMode
239
+ extend Dodopayments::Internal::Type::Enum
240
+
241
+ TaggedSymbol =
242
+ T.type_alias { T.all(Symbol, Dodopayments::Product::PricingMode) }
243
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
244
+
245
+ BY_CURRENCY =
246
+ T.let(:by_currency, Dodopayments::Product::PricingMode::TaggedSymbol)
247
+ BY_COUNTRY =
248
+ T.let(:by_country, Dodopayments::Product::PricingMode::TaggedSymbol)
249
+
250
+ sig do
251
+ override.returns(
252
+ T::Array[Dodopayments::Product::PricingMode::TaggedSymbol]
253
+ )
254
+ end
255
+ def self.values
256
+ end
257
+ end
222
258
  end
223
259
  end
224
260
  end
@@ -42,7 +42,7 @@ module Dodopayments
42
42
  sig { returns(T.nilable(String)) }
43
43
  attr_accessor :brand_id
44
44
 
45
- # Optional credit entitlements to attach (max 3)
45
+ # Optional credit entitlements to attach (max 5)
46
46
  sig do
47
47
  returns(T.nilable(T::Array[Dodopayments::AttachCreditEntitlement]))
48
48
  end
@@ -72,7 +72,7 @@ module Dodopayments
72
72
  end
73
73
  attr_writer :digital_product_delivery
74
74
 
75
- # Optional entitlements to attach to this product (max 20)
75
+ # Optional entitlements to attach to this product (max 50)
76
76
  sig do
77
77
  returns(T.nilable(T::Array[Dodopayments::AttachProductEntitlement]))
78
78
  end
@@ -124,6 +124,16 @@ module Dodopayments
124
124
  sig { params(metadata: T::Hash[Symbol, String]).void }
125
125
  attr_writer :metadata
126
126
 
127
+ # Pricing mode for localized pricing. When set, rules from
128
+ # /products/{id}/localized-prices apply at checkout. NULL means base-only
129
+ # (existing behavior).
130
+ sig do
131
+ returns(
132
+ T.nilable(Dodopayments::ProductCreateParams::PricingMode::OrSymbol)
133
+ )
134
+ end
135
+ attr_accessor :pricing_mode
136
+
127
137
  sig do
128
138
  params(
129
139
  name: String,
@@ -151,6 +161,8 @@ module Dodopayments
151
161
  T.nilable(Dodopayments::LicenseKeyDuration::OrHash),
152
162
  license_key_enabled: T.nilable(T::Boolean),
153
163
  metadata: T::Hash[Symbol, String],
164
+ pricing_mode:
165
+ T.nilable(Dodopayments::ProductCreateParams::PricingMode::OrSymbol),
154
166
  request_options: Dodopayments::RequestOptions::OrHash
155
167
  ).returns(T.attached_class)
156
168
  end
@@ -165,7 +177,7 @@ module Dodopayments
165
177
  addons: nil,
166
178
  # Brand id for the product, if not provided will default to primary brand
167
179
  brand_id: nil,
168
- # Optional credit entitlements to attach (max 3)
180
+ # Optional credit entitlements to attach (max 5)
169
181
  credit_entitlements: nil,
170
182
  # Optional description of the product
171
183
  description: nil,
@@ -173,7 +185,7 @@ module Dodopayments
173
185
  #
174
186
  # deprecated: use entitlements instead
175
187
  digital_product_delivery: nil,
176
- # Optional entitlements to attach to this product (max 20)
188
+ # Optional entitlements to attach to this product (max 50)
177
189
  entitlements: nil,
178
190
  # Optional message displayed during license key activation
179
191
  #
@@ -200,6 +212,10 @@ module Dodopayments
200
212
  license_key_enabled: nil,
201
213
  # Additional metadata for the product
202
214
  metadata: nil,
215
+ # Pricing mode for localized pricing. When set, rules from
216
+ # /products/{id}/localized-prices apply at checkout. NULL means base-only
217
+ # (existing behavior).
218
+ pricing_mode: nil,
203
219
  request_options: {}
204
220
  )
205
221
  end
@@ -231,6 +247,10 @@ module Dodopayments
231
247
  license_key_duration: T.nilable(Dodopayments::LicenseKeyDuration),
232
248
  license_key_enabled: T.nilable(T::Boolean),
233
249
  metadata: T::Hash[Symbol, String],
250
+ pricing_mode:
251
+ T.nilable(
252
+ Dodopayments::ProductCreateParams::PricingMode::OrSymbol
253
+ ),
234
254
  request_options: Dodopayments::RequestOptions
235
255
  }
236
256
  )
@@ -280,6 +300,40 @@ module Dodopayments
280
300
  def to_hash
281
301
  end
282
302
  end
303
+
304
+ # Pricing mode for localized pricing. When set, rules from
305
+ # /products/{id}/localized-prices apply at checkout. NULL means base-only
306
+ # (existing behavior).
307
+ module PricingMode
308
+ extend Dodopayments::Internal::Type::Enum
309
+
310
+ TaggedSymbol =
311
+ T.type_alias do
312
+ T.all(Symbol, Dodopayments::ProductCreateParams::PricingMode)
313
+ end
314
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
315
+
316
+ BY_CURRENCY =
317
+ T.let(
318
+ :by_currency,
319
+ Dodopayments::ProductCreateParams::PricingMode::TaggedSymbol
320
+ )
321
+ BY_COUNTRY =
322
+ T.let(
323
+ :by_country,
324
+ Dodopayments::ProductCreateParams::PricingMode::TaggedSymbol
325
+ )
326
+
327
+ sig do
328
+ override.returns(
329
+ T::Array[
330
+ Dodopayments::ProductCreateParams::PricingMode::TaggedSymbol
331
+ ]
332
+ )
333
+ end
334
+ def self.values
335
+ end
336
+ end
283
337
  end
284
338
  end
285
339
  end