dodopayments 1.73.0 → 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 (41) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +8 -0
  3. data/README.md +1 -1
  4. data/lib/dodopayments/models/checkout_session_request.rb +86 -1
  5. data/lib/dodopayments/models/customer_list_params.rb +25 -1
  6. data/lib/dodopayments/models/discount_list_params.rb +33 -1
  7. data/lib/dodopayments/models/license_key_list_params.rb +17 -1
  8. data/lib/dodopayments/models/payment.rb +32 -1
  9. data/lib/dodopayments/models/payment_list_response.rb +28 -1
  10. data/lib/dodopayments/models/subscription.rb +32 -1
  11. data/lib/dodopayments/models/subscription_list_response.rb +9 -1
  12. data/lib/dodopayments/resources/checkout_sessions.rb +6 -2
  13. data/lib/dodopayments/resources/customers.rb +7 -1
  14. data/lib/dodopayments/resources/discounts.rb +9 -1
  15. data/lib/dodopayments/resources/license_keys.rb +5 -1
  16. data/lib/dodopayments/version.rb +1 -1
  17. data/rbi/dodopayments/models/checkout_session_request.rbi +175 -0
  18. data/rbi/dodopayments/models/customer_list_params.rbi +33 -0
  19. data/rbi/dodopayments/models/discount_list_params.rbi +44 -0
  20. data/rbi/dodopayments/models/license_key_list_params.rbi +22 -0
  21. data/rbi/dodopayments/models/payment.rbi +46 -0
  22. data/rbi/dodopayments/models/payment_list_response.rbi +16 -0
  23. data/rbi/dodopayments/models/subscription.rbi +50 -0
  24. data/rbi/dodopayments/models/subscription_list_response.rbi +8 -0
  25. data/rbi/dodopayments/resources/checkout_sessions.rbi +16 -0
  26. data/rbi/dodopayments/resources/customers.rbi +9 -0
  27. data/rbi/dodopayments/resources/discounts.rbi +12 -0
  28. data/rbi/dodopayments/resources/license_keys.rbi +6 -0
  29. data/sig/dodopayments/models/checkout_session_request.rbs +76 -0
  30. data/sig/dodopayments/models/customer_list_params.rbs +26 -1
  31. data/sig/dodopayments/models/discount_list_params.rbs +34 -1
  32. data/sig/dodopayments/models/license_key_list_params.rbs +14 -0
  33. data/sig/dodopayments/models/payment.rbs +17 -0
  34. data/sig/dodopayments/models/payment_list_response.rbs +10 -0
  35. data/sig/dodopayments/models/subscription.rbs +17 -0
  36. data/sig/dodopayments/models/subscription_list_response.rbs +5 -0
  37. data/sig/dodopayments/resources/checkout_sessions.rbs +2 -0
  38. data/sig/dodopayments/resources/customers.rbs +3 -0
  39. data/sig/dodopayments/resources/discounts.rbs +4 -0
  40. data/sig/dodopayments/resources/license_keys.rbs +2 -0
  41. metadata +2 -2
@@ -55,6 +55,14 @@ module Dodopayments
55
55
  sig { params(confirm: T::Boolean).void }
56
56
  attr_writer :confirm
57
57
 
58
+ # Custom fields to collect from customer during checkout (max 5 fields)
59
+ sig do
60
+ returns(
61
+ T.nilable(T::Array[Dodopayments::CheckoutSessionRequest::CustomField])
62
+ )
63
+ end
64
+ attr_accessor :custom_fields
65
+
58
66
  # Customer details for the session
59
67
  sig do
60
68
  returns(
@@ -171,6 +179,12 @@ module Dodopayments
171
179
  ),
172
180
  billing_currency: T.nilable(Dodopayments::Currency::OrSymbol),
173
181
  confirm: T::Boolean,
182
+ custom_fields:
183
+ T.nilable(
184
+ T::Array[
185
+ Dodopayments::CheckoutSessionRequest::CustomField::OrHash
186
+ ]
187
+ ),
174
188
  customer:
175
189
  T.nilable(
176
190
  T.any(
@@ -213,6 +227,8 @@ module Dodopayments
213
227
  # If confirm is true, all the details will be finalized. If required data is
214
228
  # missing, an API error is thrown.
215
229
  confirm: nil,
230
+ # Custom fields to collect from customer during checkout (max 5 fields)
231
+ custom_fields: nil,
216
232
  # Customer details for the session
217
233
  customer: nil,
218
234
  # Customization for the checkout session page
@@ -253,6 +269,10 @@ module Dodopayments
253
269
  T.nilable(Dodopayments::CheckoutSessionRequest::BillingAddress),
254
270
  billing_currency: T.nilable(Dodopayments::Currency::OrSymbol),
255
271
  confirm: T::Boolean,
272
+ custom_fields:
273
+ T.nilable(
274
+ T::Array[Dodopayments::CheckoutSessionRequest::CustomField]
275
+ ),
256
276
  customer:
257
277
  T.nilable(
258
278
  T.any(
@@ -416,6 +436,161 @@ module Dodopayments
416
436
  end
417
437
  end
418
438
 
439
+ class CustomField < Dodopayments::Internal::Type::BaseModel
440
+ OrHash =
441
+ T.type_alias do
442
+ T.any(
443
+ Dodopayments::CheckoutSessionRequest::CustomField,
444
+ Dodopayments::Internal::AnyHash
445
+ )
446
+ end
447
+
448
+ # Type of field determining validation rules
449
+ sig do
450
+ returns(
451
+ Dodopayments::CheckoutSessionRequest::CustomField::FieldType::OrSymbol
452
+ )
453
+ end
454
+ attr_accessor :field_type
455
+
456
+ # Unique identifier for this field (used as key in responses)
457
+ sig { returns(String) }
458
+ attr_accessor :key
459
+
460
+ # Display label shown to customer
461
+ sig { returns(String) }
462
+ attr_accessor :label
463
+
464
+ # Options for dropdown type (required for dropdown, ignored for others)
465
+ sig { returns(T.nilable(T::Array[String])) }
466
+ attr_accessor :options
467
+
468
+ # Placeholder text for the input
469
+ sig { returns(T.nilable(String)) }
470
+ attr_accessor :placeholder
471
+
472
+ # Whether this field is required
473
+ sig { returns(T.nilable(T::Boolean)) }
474
+ attr_reader :required
475
+
476
+ sig { params(required: T::Boolean).void }
477
+ attr_writer :required
478
+
479
+ # Definition of a custom field for checkout
480
+ sig do
481
+ params(
482
+ field_type:
483
+ Dodopayments::CheckoutSessionRequest::CustomField::FieldType::OrSymbol,
484
+ key: String,
485
+ label: String,
486
+ options: T.nilable(T::Array[String]),
487
+ placeholder: T.nilable(String),
488
+ required: T::Boolean
489
+ ).returns(T.attached_class)
490
+ end
491
+ def self.new(
492
+ # Type of field determining validation rules
493
+ field_type:,
494
+ # Unique identifier for this field (used as key in responses)
495
+ key:,
496
+ # Display label shown to customer
497
+ label:,
498
+ # Options for dropdown type (required for dropdown, ignored for others)
499
+ options: nil,
500
+ # Placeholder text for the input
501
+ placeholder: nil,
502
+ # Whether this field is required
503
+ required: nil
504
+ )
505
+ end
506
+
507
+ sig do
508
+ override.returns(
509
+ {
510
+ field_type:
511
+ Dodopayments::CheckoutSessionRequest::CustomField::FieldType::OrSymbol,
512
+ key: String,
513
+ label: String,
514
+ options: T.nilable(T::Array[String]),
515
+ placeholder: T.nilable(String),
516
+ required: T::Boolean
517
+ }
518
+ )
519
+ end
520
+ def to_hash
521
+ end
522
+
523
+ # Type of field determining validation rules
524
+ module FieldType
525
+ extend Dodopayments::Internal::Type::Enum
526
+
527
+ TaggedSymbol =
528
+ T.type_alias do
529
+ T.all(
530
+ Symbol,
531
+ Dodopayments::CheckoutSessionRequest::CustomField::FieldType
532
+ )
533
+ end
534
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
535
+
536
+ TEXT =
537
+ T.let(
538
+ :text,
539
+ Dodopayments::CheckoutSessionRequest::CustomField::FieldType::TaggedSymbol
540
+ )
541
+ NUMBER =
542
+ T.let(
543
+ :number,
544
+ Dodopayments::CheckoutSessionRequest::CustomField::FieldType::TaggedSymbol
545
+ )
546
+ EMAIL =
547
+ T.let(
548
+ :email,
549
+ Dodopayments::CheckoutSessionRequest::CustomField::FieldType::TaggedSymbol
550
+ )
551
+ URL =
552
+ T.let(
553
+ :url,
554
+ Dodopayments::CheckoutSessionRequest::CustomField::FieldType::TaggedSymbol
555
+ )
556
+ PHONE =
557
+ T.let(
558
+ :phone,
559
+ Dodopayments::CheckoutSessionRequest::CustomField::FieldType::TaggedSymbol
560
+ )
561
+ DATE =
562
+ T.let(
563
+ :date,
564
+ Dodopayments::CheckoutSessionRequest::CustomField::FieldType::TaggedSymbol
565
+ )
566
+ DATETIME =
567
+ T.let(
568
+ :datetime,
569
+ Dodopayments::CheckoutSessionRequest::CustomField::FieldType::TaggedSymbol
570
+ )
571
+ DROPDOWN =
572
+ T.let(
573
+ :dropdown,
574
+ Dodopayments::CheckoutSessionRequest::CustomField::FieldType::TaggedSymbol
575
+ )
576
+ BOOLEAN =
577
+ T.let(
578
+ :boolean,
579
+ Dodopayments::CheckoutSessionRequest::CustomField::FieldType::TaggedSymbol
580
+ )
581
+
582
+ sig do
583
+ override.returns(
584
+ T::Array[
585
+ Dodopayments::CheckoutSessionRequest::CustomField::FieldType::TaggedSymbol
586
+ ]
587
+ )
588
+ end
589
+ def self.values
590
+ end
591
+ end
592
+ end
593
+
419
594
  class Customization < Dodopayments::Internal::Type::BaseModel
420
595
  OrHash =
421
596
  T.type_alias do
@@ -14,6 +14,20 @@ module Dodopayments
14
14
  )
15
15
  end
16
16
 
17
+ # Filter customers created on or after this timestamp
18
+ sig { returns(T.nilable(Time)) }
19
+ attr_reader :created_at_gte
20
+
21
+ sig { params(created_at_gte: Time).void }
22
+ attr_writer :created_at_gte
23
+
24
+ # Filter customers created on or before this timestamp
25
+ sig { returns(T.nilable(Time)) }
26
+ attr_reader :created_at_lte
27
+
28
+ sig { params(created_at_lte: Time).void }
29
+ attr_writer :created_at_lte
30
+
17
31
  # Filter by customer email
18
32
  sig { returns(T.nilable(String)) }
19
33
  attr_reader :email
@@ -21,6 +35,13 @@ module Dodopayments
21
35
  sig { params(email: String).void }
22
36
  attr_writer :email
23
37
 
38
+ # Filter by customer name (partial match, case-insensitive)
39
+ sig { returns(T.nilable(String)) }
40
+ attr_reader :name
41
+
42
+ sig { params(name: String).void }
43
+ attr_writer :name
44
+
24
45
  # Page number default is 0
25
46
  sig { returns(T.nilable(Integer)) }
26
47
  attr_reader :page_number
@@ -37,15 +58,24 @@ module Dodopayments
37
58
 
38
59
  sig do
39
60
  params(
61
+ created_at_gte: Time,
62
+ created_at_lte: Time,
40
63
  email: String,
64
+ name: String,
41
65
  page_number: Integer,
42
66
  page_size: Integer,
43
67
  request_options: Dodopayments::RequestOptions::OrHash
44
68
  ).returns(T.attached_class)
45
69
  end
46
70
  def self.new(
71
+ # Filter customers created on or after this timestamp
72
+ created_at_gte: nil,
73
+ # Filter customers created on or before this timestamp
74
+ created_at_lte: nil,
47
75
  # Filter by customer email
48
76
  email: nil,
77
+ # Filter by customer name (partial match, case-insensitive)
78
+ name: nil,
49
79
  # Page number default is 0
50
80
  page_number: nil,
51
81
  # Page size default is 10 max is 100
@@ -57,7 +87,10 @@ module Dodopayments
57
87
  sig do
58
88
  override.returns(
59
89
  {
90
+ created_at_gte: Time,
91
+ created_at_lte: Time,
60
92
  email: String,
93
+ name: String,
61
94
  page_number: Integer,
62
95
  page_size: Integer,
63
96
  request_options: Dodopayments::RequestOptions
@@ -14,6 +14,27 @@ module Dodopayments
14
14
  )
15
15
  end
16
16
 
17
+ # Filter by active status (true = not expired, false = expired)
18
+ sig { returns(T.nilable(T::Boolean)) }
19
+ attr_reader :active
20
+
21
+ sig { params(active: T::Boolean).void }
22
+ attr_writer :active
23
+
24
+ # Filter by discount code (partial match, case-insensitive)
25
+ sig { returns(T.nilable(String)) }
26
+ attr_reader :code
27
+
28
+ sig { params(code: String).void }
29
+ attr_writer :code
30
+
31
+ # Filter by discount type (percentage)
32
+ sig { returns(T.nilable(Dodopayments::DiscountType::OrSymbol)) }
33
+ attr_reader :discount_type
34
+
35
+ sig { params(discount_type: Dodopayments::DiscountType::OrSymbol).void }
36
+ attr_writer :discount_type
37
+
17
38
  # Page number (default = 0).
18
39
  sig { returns(T.nilable(Integer)) }
19
40
  attr_reader :page_number
@@ -28,18 +49,37 @@ module Dodopayments
28
49
  sig { params(page_size: Integer).void }
29
50
  attr_writer :page_size
30
51
 
52
+ # Filter by product restriction (only discounts that apply to this product)
53
+ sig { returns(T.nilable(String)) }
54
+ attr_reader :product_id
55
+
56
+ sig { params(product_id: String).void }
57
+ attr_writer :product_id
58
+
31
59
  sig do
32
60
  params(
61
+ active: T::Boolean,
62
+ code: String,
63
+ discount_type: Dodopayments::DiscountType::OrSymbol,
33
64
  page_number: Integer,
34
65
  page_size: Integer,
66
+ product_id: String,
35
67
  request_options: Dodopayments::RequestOptions::OrHash
36
68
  ).returns(T.attached_class)
37
69
  end
38
70
  def self.new(
71
+ # Filter by active status (true = not expired, false = expired)
72
+ active: nil,
73
+ # Filter by discount code (partial match, case-insensitive)
74
+ code: nil,
75
+ # Filter by discount type (percentage)
76
+ discount_type: nil,
39
77
  # Page number (default = 0).
40
78
  page_number: nil,
41
79
  # Page size (default = 10, max = 100).
42
80
  page_size: nil,
81
+ # Filter by product restriction (only discounts that apply to this product)
82
+ product_id: nil,
43
83
  request_options: {}
44
84
  )
45
85
  end
@@ -47,8 +87,12 @@ module Dodopayments
47
87
  sig do
48
88
  override.returns(
49
89
  {
90
+ active: T::Boolean,
91
+ code: String,
92
+ discount_type: Dodopayments::DiscountType::OrSymbol,
50
93
  page_number: Integer,
51
94
  page_size: Integer,
95
+ product_id: String,
52
96
  request_options: Dodopayments::RequestOptions
53
97
  }
54
98
  )
@@ -14,6 +14,20 @@ module Dodopayments
14
14
  )
15
15
  end
16
16
 
17
+ # Filter license keys created on or after this timestamp
18
+ sig { returns(T.nilable(Time)) }
19
+ attr_reader :created_at_gte
20
+
21
+ sig { params(created_at_gte: Time).void }
22
+ attr_writer :created_at_gte
23
+
24
+ # Filter license keys created on or before this timestamp
25
+ sig { returns(T.nilable(Time)) }
26
+ attr_reader :created_at_lte
27
+
28
+ sig { params(created_at_lte: Time).void }
29
+ attr_writer :created_at_lte
30
+
17
31
  # Filter by customer ID
18
32
  sig { returns(T.nilable(String)) }
19
33
  attr_reader :customer_id
@@ -57,6 +71,8 @@ module Dodopayments
57
71
 
58
72
  sig do
59
73
  params(
74
+ created_at_gte: Time,
75
+ created_at_lte: Time,
60
76
  customer_id: String,
61
77
  page_number: Integer,
62
78
  page_size: Integer,
@@ -66,6 +82,10 @@ module Dodopayments
66
82
  ).returns(T.attached_class)
67
83
  end
68
84
  def self.new(
85
+ # Filter license keys created on or after this timestamp
86
+ created_at_gte: nil,
87
+ # Filter license keys created on or before this timestamp
88
+ created_at_lte: nil,
69
89
  # Filter by customer ID
70
90
  customer_id: nil,
71
91
  # Page number default is 0
@@ -83,6 +103,8 @@ module Dodopayments
83
103
  sig do
84
104
  override.returns(
85
105
  {
106
+ created_at_gte: Time,
107
+ created_at_lte: Time,
86
108
  customer_id: String,
87
109
  page_number: Integer,
88
110
  page_size: Integer,
@@ -102,6 +102,12 @@ module Dodopayments
102
102
  sig { returns(T.nilable(String)) }
103
103
  attr_accessor :checkout_session_id
104
104
 
105
+ # Customer's responses to custom fields collected during checkout
106
+ sig do
107
+ returns(T.nilable(T::Array[Dodopayments::Payment::CustomFieldResponse]))
108
+ end
109
+ attr_accessor :custom_field_responses
110
+
105
111
  # The discount id if discount is applied
106
112
  sig { returns(T.nilable(String)) }
107
113
  attr_accessor :discount_id
@@ -182,6 +188,10 @@ module Dodopayments
182
188
  card_network: T.nilable(String),
183
189
  card_type: T.nilable(String),
184
190
  checkout_session_id: T.nilable(String),
191
+ custom_field_responses:
192
+ T.nilable(
193
+ T::Array[Dodopayments::Payment::CustomFieldResponse::OrHash]
194
+ ),
185
195
  discount_id: T.nilable(String),
186
196
  error_code: T.nilable(String),
187
197
  error_message: T.nilable(String),
@@ -246,6 +256,8 @@ module Dodopayments
246
256
  # If payment is made using a checkout session, this field is set to the id of the
247
257
  # session.
248
258
  checkout_session_id: nil,
259
+ # Customer's responses to custom fields collected during checkout
260
+ custom_field_responses: nil,
249
261
  # The discount id if discount is applied
250
262
  discount_id: nil,
251
263
  # An error code if the payment failed
@@ -303,6 +315,8 @@ module Dodopayments
303
315
  card_network: T.nilable(String),
304
316
  card_type: T.nilable(String),
305
317
  checkout_session_id: T.nilable(String),
318
+ custom_field_responses:
319
+ T.nilable(T::Array[Dodopayments::Payment::CustomFieldResponse]),
306
320
  discount_id: T.nilable(String),
307
321
  error_code: T.nilable(String),
308
322
  error_message: T.nilable(String),
@@ -423,6 +437,38 @@ module Dodopayments
423
437
  end
424
438
  end
425
439
 
440
+ class CustomFieldResponse < Dodopayments::Internal::Type::BaseModel
441
+ OrHash =
442
+ T.type_alias do
443
+ T.any(
444
+ Dodopayments::Payment::CustomFieldResponse,
445
+ Dodopayments::Internal::AnyHash
446
+ )
447
+ end
448
+
449
+ # Key matching the custom field definition
450
+ sig { returns(String) }
451
+ attr_accessor :key
452
+
453
+ # Value provided by customer
454
+ sig { returns(String) }
455
+ attr_accessor :value
456
+
457
+ # Customer's response to a custom field
458
+ sig { params(key: String, value: String).returns(T.attached_class) }
459
+ def self.new(
460
+ # Key matching the custom field definition
461
+ key:,
462
+ # Value provided by customer
463
+ value:
464
+ )
465
+ end
466
+
467
+ sig { override.returns({ key: String, value: String }) }
468
+ def to_hash
469
+ end
470
+ end
471
+
426
472
  class ProductCart < Dodopayments::Internal::Type::BaseModel
427
473
  OrHash =
428
474
  T.type_alias do
@@ -40,6 +40,14 @@ module Dodopayments
40
40
  sig { returns(Integer) }
41
41
  attr_accessor :total_amount
42
42
 
43
+ # Invoice ID for this payment. Uses India-specific invoice ID if available.
44
+ sig { returns(T.nilable(String)) }
45
+ attr_accessor :invoice_id
46
+
47
+ # URL to download the invoice PDF for this payment.
48
+ sig { returns(T.nilable(String)) }
49
+ attr_accessor :invoice_url
50
+
43
51
  sig { returns(T.nilable(String)) }
44
52
  attr_accessor :payment_method
45
53
 
@@ -62,6 +70,8 @@ module Dodopayments
62
70
  metadata: T::Hash[Symbol, String],
63
71
  payment_id: String,
64
72
  total_amount: Integer,
73
+ invoice_id: T.nilable(String),
74
+ invoice_url: T.nilable(String),
65
75
  payment_method: T.nilable(String),
66
76
  payment_method_type: T.nilable(String),
67
77
  status: T.nilable(Dodopayments::IntentStatus::OrSymbol),
@@ -77,6 +87,10 @@ module Dodopayments
77
87
  metadata:,
78
88
  payment_id:,
79
89
  total_amount:,
90
+ # Invoice ID for this payment. Uses India-specific invoice ID if available.
91
+ invoice_id: nil,
92
+ # URL to download the invoice PDF for this payment.
93
+ invoice_url: nil,
80
94
  payment_method: nil,
81
95
  payment_method_type: nil,
82
96
  status: nil,
@@ -95,6 +109,8 @@ module Dodopayments
95
109
  metadata: T::Hash[Symbol, String],
96
110
  payment_id: String,
97
111
  total_amount: Integer,
112
+ invoice_id: T.nilable(String),
113
+ invoice_url: T.nilable(String),
98
114
  payment_method: T.nilable(String),
99
115
  payment_method_type: T.nilable(String),
100
116
  status: T.nilable(Dodopayments::IntentStatus::TaggedSymbol),
@@ -110,6 +110,14 @@ module Dodopayments
110
110
  sig { returns(T.nilable(Time)) }
111
111
  attr_accessor :cancelled_at
112
112
 
113
+ # Customer's responses to custom fields collected during checkout
114
+ sig do
115
+ returns(
116
+ T.nilable(T::Array[Dodopayments::Subscription::CustomFieldResponse])
117
+ )
118
+ end
119
+ attr_accessor :custom_field_responses
120
+
113
121
  # Number of remaining discount cycles if discount is applied
114
122
  sig { returns(T.nilable(Integer)) }
115
123
  attr_accessor :discount_cycles_remaining
@@ -156,6 +164,10 @@ module Dodopayments
156
164
  tax_inclusive: T::Boolean,
157
165
  trial_period_days: Integer,
158
166
  cancelled_at: T.nilable(Time),
167
+ custom_field_responses:
168
+ T.nilable(
169
+ T::Array[Dodopayments::Subscription::CustomFieldResponse::OrHash]
170
+ ),
159
171
  discount_cycles_remaining: T.nilable(Integer),
160
172
  discount_id: T.nilable(String),
161
173
  expires_at: T.nilable(Time),
@@ -212,6 +224,8 @@ module Dodopayments
212
224
  trial_period_days:,
213
225
  # Cancelled timestamp if the subscription is cancelled
214
226
  cancelled_at: nil,
227
+ # Customer's responses to custom fields collected during checkout
228
+ custom_field_responses: nil,
215
229
  # Number of remaining discount cycles if discount is applied
216
230
  discount_cycles_remaining: nil,
217
231
  # The discount id if discount is applied
@@ -253,6 +267,10 @@ module Dodopayments
253
267
  tax_inclusive: T::Boolean,
254
268
  trial_period_days: Integer,
255
269
  cancelled_at: T.nilable(Time),
270
+ custom_field_responses:
271
+ T.nilable(
272
+ T::Array[Dodopayments::Subscription::CustomFieldResponse]
273
+ ),
256
274
  discount_cycles_remaining: T.nilable(Integer),
257
275
  discount_id: T.nilable(String),
258
276
  expires_at: T.nilable(Time),
@@ -333,6 +351,38 @@ module Dodopayments
333
351
  def to_hash
334
352
  end
335
353
  end
354
+
355
+ class CustomFieldResponse < Dodopayments::Internal::Type::BaseModel
356
+ OrHash =
357
+ T.type_alias do
358
+ T.any(
359
+ Dodopayments::Subscription::CustomFieldResponse,
360
+ Dodopayments::Internal::AnyHash
361
+ )
362
+ end
363
+
364
+ # Key matching the custom field definition
365
+ sig { returns(String) }
366
+ attr_accessor :key
367
+
368
+ # Value provided by customer
369
+ sig { returns(String) }
370
+ attr_accessor :value
371
+
372
+ # Customer's response to a custom field
373
+ sig { params(key: String, value: String).returns(T.attached_class) }
374
+ def self.new(
375
+ # Key matching the custom field definition
376
+ key:,
377
+ # Value provided by customer
378
+ value:
379
+ )
380
+ end
381
+
382
+ sig { override.returns({ key: String, value: String }) }
383
+ def to_hash
384
+ end
385
+ end
336
386
  end
337
387
  end
338
388
  end
@@ -117,6 +117,10 @@ module Dodopayments
117
117
  sig { returns(T.nilable(String)) }
118
118
  attr_accessor :payment_method_id
119
119
 
120
+ # Name of the product associated with this subscription
121
+ sig { returns(T.nilable(String)) }
122
+ attr_accessor :product_name
123
+
120
124
  # Tax identifier provided for this subscription (if applicable)
121
125
  sig { returns(T.nilable(String)) }
122
126
  attr_accessor :tax_id
@@ -148,6 +152,7 @@ module Dodopayments
148
152
  discount_cycles_remaining: T.nilable(Integer),
149
153
  discount_id: T.nilable(String),
150
154
  payment_method_id: T.nilable(String),
155
+ product_name: T.nilable(String),
151
156
  tax_id: T.nilable(String)
152
157
  ).returns(T.attached_class)
153
158
  end
@@ -202,6 +207,8 @@ module Dodopayments
202
207
  discount_id: nil,
203
208
  # Saved payment method id used for recurring charges
204
209
  payment_method_id: nil,
210
+ # Name of the product associated with this subscription
211
+ product_name: nil,
205
212
  # Tax identifier provided for this subscription (if applicable)
206
213
  tax_id: nil
207
214
  )
@@ -236,6 +243,7 @@ module Dodopayments
236
243
  discount_cycles_remaining: T.nilable(Integer),
237
244
  discount_id: T.nilable(String),
238
245
  payment_method_id: T.nilable(String),
246
+ product_name: T.nilable(String),
239
247
  tax_id: T.nilable(String)
240
248
  }
241
249
  )
@@ -15,6 +15,12 @@ module Dodopayments
15
15
  ),
16
16
  billing_currency: T.nilable(Dodopayments::Currency::OrSymbol),
17
17
  confirm: T::Boolean,
18
+ custom_fields:
19
+ T.nilable(
20
+ T::Array[
21
+ Dodopayments::CheckoutSessionRequest::CustomField::OrHash
22
+ ]
23
+ ),
18
24
  customer:
19
25
  T.nilable(
20
26
  T.any(
@@ -58,6 +64,8 @@ module Dodopayments
58
64
  # If confirm is true, all the details will be finalized. If required data is
59
65
  # missing, an API error is thrown.
60
66
  confirm: nil,
67
+ # Custom fields to collect from customer during checkout (max 5 fields)
68
+ custom_fields: nil,
61
69
  # Customer details for the session
62
70
  customer: nil,
63
71
  # Customization for the checkout session page
@@ -109,6 +117,12 @@ module Dodopayments
109
117
  ),
110
118
  billing_currency: T.nilable(Dodopayments::Currency::OrSymbol),
111
119
  confirm: T::Boolean,
120
+ custom_fields:
121
+ T.nilable(
122
+ T::Array[
123
+ Dodopayments::CheckoutSessionRequest::CustomField::OrHash
124
+ ]
125
+ ),
112
126
  customer:
113
127
  T.nilable(
114
128
  T.any(
@@ -152,6 +166,8 @@ module Dodopayments
152
166
  # If confirm is true, all the details will be finalized. If required data is
153
167
  # missing, an API error is thrown.
154
168
  confirm: nil,
169
+ # Custom fields to collect from customer during checkout (max 5 fields)
170
+ custom_fields: nil,
155
171
  # Customer details for the session
156
172
  customer: nil,
157
173
  # Customization for the checkout session page