dodopayments 1.71.1 → 1.74.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 (69) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +21 -0
  3. data/README.md +1 -1
  4. data/lib/dodopayments/models/checkout_session_preview_params.rb +14 -0
  5. data/lib/dodopayments/models/checkout_session_preview_response.rb +426 -0
  6. data/lib/dodopayments/models/checkout_session_request.rb +94 -1
  7. data/lib/dodopayments/models/customer_list_params.rb +25 -1
  8. data/lib/dodopayments/models/discount_list_params.rb +33 -1
  9. data/lib/dodopayments/models/discount_retrieve_by_code_params.rb +14 -0
  10. data/lib/dodopayments/models/license_key_list_params.rb +17 -1
  11. data/lib/dodopayments/models/payment.rb +40 -1
  12. data/lib/dodopayments/models/payment_list_response.rb +28 -1
  13. data/lib/dodopayments/models/payment_method_types.rb +13 -98
  14. data/lib/dodopayments/models/product.rb +9 -1
  15. data/lib/dodopayments/models/subscription.rb +32 -1
  16. data/lib/dodopayments/models/subscription_change_plan_params.rb +10 -1
  17. data/lib/dodopayments/models/subscription_list_response.rb +9 -1
  18. data/lib/dodopayments/models/subscription_preview_change_plan_params.rb +10 -1
  19. data/lib/dodopayments/models.rb +4 -0
  20. data/lib/dodopayments/resources/checkout_sessions.rb +64 -1
  21. data/lib/dodopayments/resources/customers.rb +7 -1
  22. data/lib/dodopayments/resources/discounts.rb +31 -1
  23. data/lib/dodopayments/resources/license_keys.rb +5 -1
  24. data/lib/dodopayments/resources/subscriptions.rb +6 -2
  25. data/lib/dodopayments/version.rb +1 -1
  26. data/lib/dodopayments.rb +3 -0
  27. data/rbi/dodopayments/models/checkout_session_preview_params.rbi +32 -0
  28. data/rbi/dodopayments/models/checkout_session_preview_response.rbi +616 -0
  29. data/rbi/dodopayments/models/checkout_session_request.rbi +183 -0
  30. data/rbi/dodopayments/models/customer_list_params.rbi +33 -0
  31. data/rbi/dodopayments/models/discount_list_params.rbi +44 -0
  32. data/rbi/dodopayments/models/discount_retrieve_by_code_params.rbi +32 -0
  33. data/rbi/dodopayments/models/license_key_list_params.rbi +22 -0
  34. data/rbi/dodopayments/models/payment.rbi +54 -0
  35. data/rbi/dodopayments/models/payment_list_response.rbi +16 -0
  36. data/rbi/dodopayments/models/payment_method_types.rbi +18 -186
  37. data/rbi/dodopayments/models/product.rbi +11 -3
  38. data/rbi/dodopayments/models/subscription.rbi +50 -0
  39. data/rbi/dodopayments/models/subscription_change_plan_params.rbi +10 -0
  40. data/rbi/dodopayments/models/subscription_list_response.rbi +8 -0
  41. data/rbi/dodopayments/models/subscription_preview_change_plan_params.rbi +10 -0
  42. data/rbi/dodopayments/models.rbi +6 -0
  43. data/rbi/dodopayments/resources/checkout_sessions.rbi +104 -0
  44. data/rbi/dodopayments/resources/customers.rbi +9 -0
  45. data/rbi/dodopayments/resources/discounts.rbi +28 -0
  46. data/rbi/dodopayments/resources/license_keys.rbi +6 -0
  47. data/rbi/dodopayments/resources/subscriptions.rbi +8 -0
  48. data/sig/dodopayments/models/checkout_session_preview_params.rbs +15 -0
  49. data/sig/dodopayments/models/checkout_session_preview_response.rbs +330 -0
  50. data/sig/dodopayments/models/checkout_session_request.rbs +81 -0
  51. data/sig/dodopayments/models/customer_list_params.rbs +26 -1
  52. data/sig/dodopayments/models/discount_list_params.rbs +34 -1
  53. data/sig/dodopayments/models/discount_retrieve_by_code_params.rbs +15 -0
  54. data/sig/dodopayments/models/license_key_list_params.rbs +14 -0
  55. data/sig/dodopayments/models/payment.rbs +22 -0
  56. data/sig/dodopayments/models/payment_list_response.rbs +10 -0
  57. data/sig/dodopayments/models/payment_method_types.rbs +26 -196
  58. data/sig/dodopayments/models/product.rbs +8 -3
  59. data/sig/dodopayments/models/subscription.rbs +17 -0
  60. data/sig/dodopayments/models/subscription_change_plan_params.rbs +6 -1
  61. data/sig/dodopayments/models/subscription_list_response.rbs +5 -0
  62. data/sig/dodopayments/models/subscription_preview_change_plan_params.rbs +6 -1
  63. data/sig/dodopayments/models.rbs +4 -0
  64. data/sig/dodopayments/resources/checkout_sessions.rbs +25 -0
  65. data/sig/dodopayments/resources/customers.rbs +3 -0
  66. data/sig/dodopayments/resources/discounts.rbs +9 -0
  67. data/sig/dodopayments/resources/license_keys.rbs +2 -0
  68. data/sig/dodopayments/resources/subscriptions.rbs +2 -0
  69. metadata +11 -2
@@ -111,8 +111,12 @@ module Dodopayments
111
111
  # GET /discounts
112
112
  sig do
113
113
  params(
114
+ active: T::Boolean,
115
+ code: String,
116
+ discount_type: Dodopayments::DiscountType::OrSymbol,
114
117
  page_number: Integer,
115
118
  page_size: Integer,
119
+ product_id: String,
116
120
  request_options: Dodopayments::RequestOptions::OrHash
117
121
  ).returns(
118
122
  Dodopayments::Internal::DefaultPageNumberPagination[
@@ -121,10 +125,18 @@ module Dodopayments
121
125
  )
122
126
  end
123
127
  def list(
128
+ # Filter by active status (true = not expired, false = expired)
129
+ active: nil,
130
+ # Filter by discount code (partial match, case-insensitive)
131
+ code: nil,
132
+ # Filter by discount type (percentage)
133
+ discount_type: nil,
124
134
  # Page number (default = 0).
125
135
  page_number: nil,
126
136
  # Page size (default = 10, max = 100).
127
137
  page_size: nil,
138
+ # Filter by product restriction (only discounts that apply to this product)
139
+ product_id: nil,
128
140
  request_options: {}
129
141
  )
130
142
  end
@@ -143,6 +155,22 @@ module Dodopayments
143
155
  )
144
156
  end
145
157
 
158
+ # Validate and fetch a discount by its code name (e.g., "SAVE20"). This allows
159
+ # real-time validation directly against the API using the human-readable discount
160
+ # code instead of requiring the internal discount_id.
161
+ sig do
162
+ params(
163
+ code: String,
164
+ request_options: Dodopayments::RequestOptions::OrHash
165
+ ).returns(Dodopayments::Discount)
166
+ end
167
+ def retrieve_by_code(
168
+ # The discount code (e.g., 'SAVE20')
169
+ code,
170
+ request_options: {}
171
+ )
172
+ end
173
+
146
174
  # @api private
147
175
  sig { params(client: Dodopayments::Client).returns(T.attached_class) }
148
176
  def self.new(client:)
@@ -43,6 +43,8 @@ module Dodopayments
43
43
 
44
44
  sig do
45
45
  params(
46
+ created_at_gte: Time,
47
+ created_at_lte: Time,
46
48
  customer_id: String,
47
49
  page_number: Integer,
48
50
  page_size: Integer,
@@ -56,6 +58,10 @@ module Dodopayments
56
58
  )
57
59
  end
58
60
  def list(
61
+ # Filter license keys created on or after this timestamp
62
+ created_at_gte: nil,
63
+ # Filter license keys created on or before this timestamp
64
+ created_at_lte: nil,
59
65
  # Filter by customer ID
60
66
  customer_id: nil,
61
67
  # Page number default is 0
@@ -179,6 +179,7 @@ module Dodopayments
179
179
  Dodopayments::SubscriptionChangePlanParams::ProrationBillingMode::OrSymbol,
180
180
  quantity: Integer,
181
181
  addons: T.nilable(T::Array[Dodopayments::AttachAddon::OrHash]),
182
+ metadata: T.nilable(T::Hash[Symbol, String]),
182
183
  request_options: Dodopayments::RequestOptions::OrHash
183
184
  ).void
184
185
  end
@@ -194,6 +195,9 @@ module Dodopayments
194
195
  # Addons for the new plan. Note : Leaving this empty would remove any existing
195
196
  # addons
196
197
  addons: nil,
198
+ # Metadata for the payment. If not passed, the metadata of the subscription will
199
+ # be taken
200
+ metadata: nil,
197
201
  request_options: {}
198
202
  )
199
203
  end
@@ -246,6 +250,7 @@ module Dodopayments
246
250
  Dodopayments::SubscriptionPreviewChangePlanParams::ProrationBillingMode::OrSymbol,
247
251
  quantity: Integer,
248
252
  addons: T.nilable(T::Array[Dodopayments::AttachAddon::OrHash]),
253
+ metadata: T.nilable(T::Hash[Symbol, String]),
249
254
  request_options: Dodopayments::RequestOptions::OrHash
250
255
  ).returns(Dodopayments::Models::SubscriptionPreviewChangePlanResponse)
251
256
  end
@@ -261,6 +266,9 @@ module Dodopayments
261
266
  # Addons for the new plan. Note : Leaving this empty would remove any existing
262
267
  # addons
263
268
  addons: nil,
269
+ # Metadata for the payment. If not passed, the metadata of the subscription will
270
+ # be taken
271
+ metadata: nil,
264
272
  request_options: {}
265
273
  )
266
274
  end
@@ -0,0 +1,15 @@
1
+ module Dodopayments
2
+ module Models
3
+ type checkout_session_preview_params =
4
+ { } & Dodopayments::Internal::Type::request_parameters
5
+
6
+ class CheckoutSessionPreviewParams < Dodopayments::Models::CheckoutSessionRequest
7
+ extend Dodopayments::Internal::Type::RequestParameters::Converter
8
+ include Dodopayments::Internal::Type::RequestParameters
9
+
10
+ def initialize: (?request_options: Dodopayments::request_opts) -> void
11
+
12
+ def to_hash: -> { request_options: Dodopayments::RequestOptions }
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,330 @@
1
+ module Dodopayments
2
+ module Models
3
+ type checkout_session_preview_response =
4
+ {
5
+ billing_country: Dodopayments::Models::country_code,
6
+ currency: Dodopayments::Models::currency,
7
+ current_breakup: Dodopayments::Models::CheckoutSessionPreviewResponse::CurrentBreakup,
8
+ product_cart: ::Array[Dodopayments::Models::CheckoutSessionPreviewResponse::ProductCart],
9
+ total_price: Integer,
10
+ recurring_breakup: Dodopayments::Models::CheckoutSessionPreviewResponse::RecurringBreakup?,
11
+ total_tax: Integer?
12
+ }
13
+
14
+ class CheckoutSessionPreviewResponse < Dodopayments::Internal::Type::BaseModel
15
+ attr_accessor billing_country: Dodopayments::Models::country_code
16
+
17
+ attr_accessor currency: Dodopayments::Models::currency
18
+
19
+ attr_accessor current_breakup: Dodopayments::Models::CheckoutSessionPreviewResponse::CurrentBreakup
20
+
21
+ attr_accessor product_cart: ::Array[Dodopayments::Models::CheckoutSessionPreviewResponse::ProductCart]
22
+
23
+ attr_accessor total_price: Integer
24
+
25
+ attr_accessor recurring_breakup: Dodopayments::Models::CheckoutSessionPreviewResponse::RecurringBreakup?
26
+
27
+ attr_accessor total_tax: Integer?
28
+
29
+ def initialize: (
30
+ billing_country: Dodopayments::Models::country_code,
31
+ currency: Dodopayments::Models::currency,
32
+ current_breakup: Dodopayments::Models::CheckoutSessionPreviewResponse::CurrentBreakup,
33
+ product_cart: ::Array[Dodopayments::Models::CheckoutSessionPreviewResponse::ProductCart],
34
+ total_price: Integer,
35
+ ?recurring_breakup: Dodopayments::Models::CheckoutSessionPreviewResponse::RecurringBreakup?,
36
+ ?total_tax: Integer?
37
+ ) -> void
38
+
39
+ def to_hash: -> {
40
+ billing_country: Dodopayments::Models::country_code,
41
+ currency: Dodopayments::Models::currency,
42
+ current_breakup: Dodopayments::Models::CheckoutSessionPreviewResponse::CurrentBreakup,
43
+ product_cart: ::Array[Dodopayments::Models::CheckoutSessionPreviewResponse::ProductCart],
44
+ total_price: Integer,
45
+ recurring_breakup: Dodopayments::Models::CheckoutSessionPreviewResponse::RecurringBreakup?,
46
+ total_tax: Integer?
47
+ }
48
+
49
+ type current_breakup =
50
+ {
51
+ discount: Integer,
52
+ subtotal: Integer,
53
+ total_amount: Integer,
54
+ tax: Integer?
55
+ }
56
+
57
+ class CurrentBreakup < Dodopayments::Internal::Type::BaseModel
58
+ attr_accessor discount: Integer
59
+
60
+ attr_accessor subtotal: Integer
61
+
62
+ attr_accessor total_amount: Integer
63
+
64
+ attr_accessor tax: Integer?
65
+
66
+ def initialize: (
67
+ discount: Integer,
68
+ subtotal: Integer,
69
+ total_amount: Integer,
70
+ ?tax: Integer?
71
+ ) -> void
72
+
73
+ def to_hash: -> {
74
+ discount: Integer,
75
+ subtotal: Integer,
76
+ total_amount: Integer,
77
+ tax: Integer?
78
+ }
79
+ end
80
+
81
+ type product_cart =
82
+ {
83
+ currency: Dodopayments::Models::currency,
84
+ discounted_price: Integer,
85
+ is_subscription: bool,
86
+ is_usage_based: bool,
87
+ meters: ::Array[Dodopayments::Models::CheckoutSessionPreviewResponse::ProductCart::Meter],
88
+ og_currency: Dodopayments::Models::currency,
89
+ og_price: Integer,
90
+ product_id: String,
91
+ quantity: Integer,
92
+ tax_category: Dodopayments::Models::tax_category,
93
+ tax_inclusive: bool,
94
+ tax_rate: Integer,
95
+ addons: ::Array[Dodopayments::Models::CheckoutSessionPreviewResponse::ProductCart::Addon]?,
96
+ description: String?,
97
+ discount_amount: Integer?,
98
+ discount_cycle: Integer?,
99
+ name: String?,
100
+ tax: Integer?
101
+ }
102
+
103
+ class ProductCart < Dodopayments::Internal::Type::BaseModel
104
+ attr_accessor currency: Dodopayments::Models::currency
105
+
106
+ attr_accessor discounted_price: Integer
107
+
108
+ attr_accessor is_subscription: bool
109
+
110
+ attr_accessor is_usage_based: bool
111
+
112
+ attr_accessor meters: ::Array[Dodopayments::Models::CheckoutSessionPreviewResponse::ProductCart::Meter]
113
+
114
+ attr_accessor og_currency: Dodopayments::Models::currency
115
+
116
+ attr_accessor og_price: Integer
117
+
118
+ attr_accessor product_id: String
119
+
120
+ attr_accessor quantity: Integer
121
+
122
+ attr_accessor tax_category: Dodopayments::Models::tax_category
123
+
124
+ attr_accessor tax_inclusive: bool
125
+
126
+ attr_accessor tax_rate: Integer
127
+
128
+ attr_accessor addons: ::Array[Dodopayments::Models::CheckoutSessionPreviewResponse::ProductCart::Addon]?
129
+
130
+ attr_accessor description: String?
131
+
132
+ attr_accessor discount_amount: Integer?
133
+
134
+ attr_accessor discount_cycle: Integer?
135
+
136
+ attr_accessor name: String?
137
+
138
+ attr_accessor tax: Integer?
139
+
140
+ def initialize: (
141
+ currency: Dodopayments::Models::currency,
142
+ discounted_price: Integer,
143
+ is_subscription: bool,
144
+ is_usage_based: bool,
145
+ meters: ::Array[Dodopayments::Models::CheckoutSessionPreviewResponse::ProductCart::Meter],
146
+ og_currency: Dodopayments::Models::currency,
147
+ og_price: Integer,
148
+ product_id: String,
149
+ quantity: Integer,
150
+ tax_category: Dodopayments::Models::tax_category,
151
+ tax_inclusive: bool,
152
+ tax_rate: Integer,
153
+ ?addons: ::Array[Dodopayments::Models::CheckoutSessionPreviewResponse::ProductCart::Addon]?,
154
+ ?description: String?,
155
+ ?discount_amount: Integer?,
156
+ ?discount_cycle: Integer?,
157
+ ?name: String?,
158
+ ?tax: Integer?
159
+ ) -> void
160
+
161
+ def to_hash: -> {
162
+ currency: Dodopayments::Models::currency,
163
+ discounted_price: Integer,
164
+ is_subscription: bool,
165
+ is_usage_based: bool,
166
+ meters: ::Array[Dodopayments::Models::CheckoutSessionPreviewResponse::ProductCart::Meter],
167
+ og_currency: Dodopayments::Models::currency,
168
+ og_price: Integer,
169
+ product_id: String,
170
+ quantity: Integer,
171
+ tax_category: Dodopayments::Models::tax_category,
172
+ tax_inclusive: bool,
173
+ tax_rate: Integer,
174
+ addons: ::Array[Dodopayments::Models::CheckoutSessionPreviewResponse::ProductCart::Addon]?,
175
+ description: String?,
176
+ discount_amount: Integer?,
177
+ discount_cycle: Integer?,
178
+ name: String?,
179
+ tax: Integer?
180
+ }
181
+
182
+ type meter =
183
+ {
184
+ measurement_unit: String,
185
+ name: String,
186
+ price_per_unit: String,
187
+ description: String?,
188
+ free_threshold: Integer?
189
+ }
190
+
191
+ class Meter < Dodopayments::Internal::Type::BaseModel
192
+ attr_accessor measurement_unit: String
193
+
194
+ attr_accessor name: String
195
+
196
+ attr_accessor price_per_unit: String
197
+
198
+ attr_accessor description: String?
199
+
200
+ attr_accessor free_threshold: Integer?
201
+
202
+ def initialize: (
203
+ measurement_unit: String,
204
+ name: String,
205
+ price_per_unit: String,
206
+ ?description: String?,
207
+ ?free_threshold: Integer?
208
+ ) -> void
209
+
210
+ def to_hash: -> {
211
+ measurement_unit: String,
212
+ name: String,
213
+ price_per_unit: String,
214
+ description: String?,
215
+ free_threshold: Integer?
216
+ }
217
+ end
218
+
219
+ type addon =
220
+ {
221
+ addon_id: String,
222
+ currency: Dodopayments::Models::currency,
223
+ discounted_price: Integer,
224
+ name: String,
225
+ og_currency: Dodopayments::Models::currency,
226
+ og_price: Integer,
227
+ quantity: Integer,
228
+ tax_category: Dodopayments::Models::tax_category,
229
+ tax_inclusive: bool,
230
+ tax_rate: Integer,
231
+ description: String?,
232
+ discount_amount: Integer?,
233
+ tax: Integer?
234
+ }
235
+
236
+ class Addon < Dodopayments::Internal::Type::BaseModel
237
+ attr_accessor addon_id: String
238
+
239
+ attr_accessor currency: Dodopayments::Models::currency
240
+
241
+ attr_accessor discounted_price: Integer
242
+
243
+ attr_accessor name: String
244
+
245
+ attr_accessor og_currency: Dodopayments::Models::currency
246
+
247
+ attr_accessor og_price: Integer
248
+
249
+ attr_accessor quantity: Integer
250
+
251
+ attr_accessor tax_category: Dodopayments::Models::tax_category
252
+
253
+ attr_accessor tax_inclusive: bool
254
+
255
+ attr_accessor tax_rate: Integer
256
+
257
+ attr_accessor description: String?
258
+
259
+ attr_accessor discount_amount: Integer?
260
+
261
+ attr_accessor tax: Integer?
262
+
263
+ def initialize: (
264
+ addon_id: String,
265
+ currency: Dodopayments::Models::currency,
266
+ discounted_price: Integer,
267
+ name: String,
268
+ og_currency: Dodopayments::Models::currency,
269
+ og_price: Integer,
270
+ quantity: Integer,
271
+ tax_category: Dodopayments::Models::tax_category,
272
+ tax_inclusive: bool,
273
+ tax_rate: Integer,
274
+ ?description: String?,
275
+ ?discount_amount: Integer?,
276
+ ?tax: Integer?
277
+ ) -> void
278
+
279
+ def to_hash: -> {
280
+ addon_id: String,
281
+ currency: Dodopayments::Models::currency,
282
+ discounted_price: Integer,
283
+ name: String,
284
+ og_currency: Dodopayments::Models::currency,
285
+ og_price: Integer,
286
+ quantity: Integer,
287
+ tax_category: Dodopayments::Models::tax_category,
288
+ tax_inclusive: bool,
289
+ tax_rate: Integer,
290
+ description: String?,
291
+ discount_amount: Integer?,
292
+ tax: Integer?
293
+ }
294
+ end
295
+ end
296
+
297
+ type recurring_breakup =
298
+ {
299
+ discount: Integer,
300
+ subtotal: Integer,
301
+ total_amount: Integer,
302
+ tax: Integer?
303
+ }
304
+
305
+ class RecurringBreakup < Dodopayments::Internal::Type::BaseModel
306
+ attr_accessor discount: Integer
307
+
308
+ attr_accessor subtotal: Integer
309
+
310
+ attr_accessor total_amount: Integer
311
+
312
+ attr_accessor tax: Integer?
313
+
314
+ def initialize: (
315
+ discount: Integer,
316
+ subtotal: Integer,
317
+ total_amount: Integer,
318
+ ?tax: Integer?
319
+ ) -> void
320
+
321
+ def to_hash: -> {
322
+ discount: Integer,
323
+ subtotal: Integer,
324
+ total_amount: Integer,
325
+ tax: Integer?
326
+ }
327
+ end
328
+ end
329
+ end
330
+ end
@@ -7,6 +7,7 @@ module Dodopayments
7
7
  billing_address: Dodopayments::CheckoutSessionRequest::BillingAddress?,
8
8
  billing_currency: Dodopayments::Models::currency?,
9
9
  confirm: bool,
10
+ custom_fields: ::Array[Dodopayments::CheckoutSessionRequest::CustomField]?,
10
11
  customer: Dodopayments::Models::customer_request?,
11
12
  customization: Dodopayments::CheckoutSessionRequest::Customization,
12
13
  discount_code: String?,
@@ -15,6 +16,7 @@ module Dodopayments
15
16
  metadata: ::Hash[Symbol, String]?,
16
17
  minimal_address: bool,
17
18
  payment_method_id: String?,
19
+ product_collection_id: String?,
18
20
  return_url: String?,
19
21
  short_link: bool,
20
22
  show_saved_payment_methods: bool,
@@ -34,6 +36,8 @@ module Dodopayments
34
36
 
35
37
  def confirm=: (bool) -> bool
36
38
 
39
+ attr_accessor custom_fields: ::Array[Dodopayments::CheckoutSessionRequest::CustomField]?
40
+
37
41
  attr_accessor customer: Dodopayments::Models::customer_request?
38
42
 
39
43
  attr_reader customization: Dodopayments::CheckoutSessionRequest::Customization?
@@ -60,6 +64,8 @@ module Dodopayments
60
64
 
61
65
  attr_accessor payment_method_id: String?
62
66
 
67
+ attr_accessor product_collection_id: String?
68
+
63
69
  attr_accessor return_url: String?
64
70
 
65
71
  attr_reader short_link: bool?
@@ -78,6 +84,7 @@ module Dodopayments
78
84
  ?billing_address: Dodopayments::CheckoutSessionRequest::BillingAddress?,
79
85
  ?billing_currency: Dodopayments::Models::currency?,
80
86
  ?confirm: bool,
87
+ ?custom_fields: ::Array[Dodopayments::CheckoutSessionRequest::CustomField]?,
81
88
  ?customer: Dodopayments::Models::customer_request?,
82
89
  ?customization: Dodopayments::CheckoutSessionRequest::Customization,
83
90
  ?discount_code: String?,
@@ -86,6 +93,7 @@ module Dodopayments
86
93
  ?metadata: ::Hash[Symbol, String]?,
87
94
  ?minimal_address: bool,
88
95
  ?payment_method_id: String?,
96
+ ?product_collection_id: String?,
89
97
  ?return_url: String?,
90
98
  ?short_link: bool,
91
99
  ?show_saved_payment_methods: bool,
@@ -98,6 +106,7 @@ module Dodopayments
98
106
  billing_address: Dodopayments::CheckoutSessionRequest::BillingAddress?,
99
107
  billing_currency: Dodopayments::Models::currency?,
100
108
  confirm: bool,
109
+ custom_fields: ::Array[Dodopayments::CheckoutSessionRequest::CustomField]?,
101
110
  customer: Dodopayments::Models::customer_request?,
102
111
  customization: Dodopayments::CheckoutSessionRequest::Customization,
103
112
  discount_code: String?,
@@ -106,6 +115,7 @@ module Dodopayments
106
115
  metadata: ::Hash[Symbol, String]?,
107
116
  minimal_address: bool,
108
117
  payment_method_id: String?,
118
+ product_collection_id: String?,
109
119
  return_url: String?,
110
120
  short_link: bool,
111
121
  show_saved_payment_methods: bool,
@@ -181,6 +191,77 @@ module Dodopayments
181
191
  }
182
192
  end
183
193
 
194
+ type custom_field =
195
+ {
196
+ field_type: Dodopayments::Models::CheckoutSessionRequest::CustomField::field_type,
197
+ key: String,
198
+ label: String,
199
+ options: ::Array[String]?,
200
+ placeholder: String?,
201
+ required: bool
202
+ }
203
+
204
+ class CustomField < Dodopayments::Internal::Type::BaseModel
205
+ attr_accessor field_type: Dodopayments::Models::CheckoutSessionRequest::CustomField::field_type
206
+
207
+ attr_accessor key: String
208
+
209
+ attr_accessor label: String
210
+
211
+ attr_accessor options: ::Array[String]?
212
+
213
+ attr_accessor placeholder: String?
214
+
215
+ attr_reader required: bool?
216
+
217
+ def required=: (bool) -> bool
218
+
219
+ def initialize: (
220
+ field_type: Dodopayments::Models::CheckoutSessionRequest::CustomField::field_type,
221
+ key: String,
222
+ label: String,
223
+ ?options: ::Array[String]?,
224
+ ?placeholder: String?,
225
+ ?required: bool
226
+ ) -> void
227
+
228
+ def to_hash: -> {
229
+ field_type: Dodopayments::Models::CheckoutSessionRequest::CustomField::field_type,
230
+ key: String,
231
+ label: String,
232
+ options: ::Array[String]?,
233
+ placeholder: String?,
234
+ required: bool
235
+ }
236
+
237
+ type field_type =
238
+ :text
239
+ | :number
240
+ | :email
241
+ | :url
242
+ | :phone
243
+ | :date
244
+ | :datetime
245
+ | :dropdown
246
+ | :boolean
247
+
248
+ module FieldType
249
+ extend Dodopayments::Internal::Type::Enum
250
+
251
+ TEXT: :text
252
+ NUMBER: :number
253
+ EMAIL: :email
254
+ URL: :url
255
+ PHONE: :phone
256
+ DATE: :date
257
+ DATETIME: :datetime
258
+ DROPDOWN: :dropdown
259
+ BOOLEAN: :boolean
260
+
261
+ def self?.values: -> ::Array[Dodopayments::Models::CheckoutSessionRequest::CustomField::field_type]
262
+ end
263
+ end
264
+
184
265
  type customization =
185
266
  {
186
267
  force_language: String?,
@@ -1,17 +1,36 @@
1
1
  module Dodopayments
2
2
  module Models
3
3
  type customer_list_params =
4
- { email: String, page_number: Integer, page_size: Integer }
4
+ {
5
+ created_at_gte: Time,
6
+ created_at_lte: Time,
7
+ email: String,
8
+ name: String,
9
+ page_number: Integer,
10
+ page_size: Integer
11
+ }
5
12
  & Dodopayments::Internal::Type::request_parameters
6
13
 
7
14
  class CustomerListParams < Dodopayments::Internal::Type::BaseModel
8
15
  extend Dodopayments::Internal::Type::RequestParameters::Converter
9
16
  include Dodopayments::Internal::Type::RequestParameters
10
17
 
18
+ attr_reader created_at_gte: Time?
19
+
20
+ def created_at_gte=: (Time) -> Time
21
+
22
+ attr_reader created_at_lte: Time?
23
+
24
+ def created_at_lte=: (Time) -> Time
25
+
11
26
  attr_reader email: String?
12
27
 
13
28
  def email=: (String) -> String
14
29
 
30
+ attr_reader name: String?
31
+
32
+ def name=: (String) -> String
33
+
15
34
  attr_reader page_number: Integer?
16
35
 
17
36
  def page_number=: (Integer) -> Integer
@@ -21,14 +40,20 @@ module Dodopayments
21
40
  def page_size=: (Integer) -> Integer
22
41
 
23
42
  def initialize: (
43
+ ?created_at_gte: Time,
44
+ ?created_at_lte: Time,
24
45
  ?email: String,
46
+ ?name: String,
25
47
  ?page_number: Integer,
26
48
  ?page_size: Integer,
27
49
  ?request_options: Dodopayments::request_opts
28
50
  ) -> void
29
51
 
30
52
  def to_hash: -> {
53
+ created_at_gte: Time,
54
+ created_at_lte: Time,
31
55
  email: String,
56
+ name: String,
32
57
  page_number: Integer,
33
58
  page_size: Integer,
34
59
  request_options: Dodopayments::RequestOptions