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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +21 -0
- data/README.md +1 -1
- data/lib/dodopayments/models/checkout_session_preview_params.rb +14 -0
- data/lib/dodopayments/models/checkout_session_preview_response.rb +426 -0
- data/lib/dodopayments/models/checkout_session_request.rb +94 -1
- data/lib/dodopayments/models/customer_list_params.rb +25 -1
- data/lib/dodopayments/models/discount_list_params.rb +33 -1
- data/lib/dodopayments/models/discount_retrieve_by_code_params.rb +14 -0
- data/lib/dodopayments/models/license_key_list_params.rb +17 -1
- data/lib/dodopayments/models/payment.rb +40 -1
- data/lib/dodopayments/models/payment_list_response.rb +28 -1
- data/lib/dodopayments/models/payment_method_types.rb +13 -98
- data/lib/dodopayments/models/product.rb +9 -1
- data/lib/dodopayments/models/subscription.rb +32 -1
- data/lib/dodopayments/models/subscription_change_plan_params.rb +10 -1
- data/lib/dodopayments/models/subscription_list_response.rb +9 -1
- data/lib/dodopayments/models/subscription_preview_change_plan_params.rb +10 -1
- data/lib/dodopayments/models.rb +4 -0
- data/lib/dodopayments/resources/checkout_sessions.rb +64 -1
- data/lib/dodopayments/resources/customers.rb +7 -1
- data/lib/dodopayments/resources/discounts.rb +31 -1
- data/lib/dodopayments/resources/license_keys.rb +5 -1
- data/lib/dodopayments/resources/subscriptions.rb +6 -2
- data/lib/dodopayments/version.rb +1 -1
- data/lib/dodopayments.rb +3 -0
- data/rbi/dodopayments/models/checkout_session_preview_params.rbi +32 -0
- data/rbi/dodopayments/models/checkout_session_preview_response.rbi +616 -0
- data/rbi/dodopayments/models/checkout_session_request.rbi +183 -0
- data/rbi/dodopayments/models/customer_list_params.rbi +33 -0
- data/rbi/dodopayments/models/discount_list_params.rbi +44 -0
- data/rbi/dodopayments/models/discount_retrieve_by_code_params.rbi +32 -0
- data/rbi/dodopayments/models/license_key_list_params.rbi +22 -0
- data/rbi/dodopayments/models/payment.rbi +54 -0
- data/rbi/dodopayments/models/payment_list_response.rbi +16 -0
- data/rbi/dodopayments/models/payment_method_types.rbi +18 -186
- data/rbi/dodopayments/models/product.rbi +11 -3
- data/rbi/dodopayments/models/subscription.rbi +50 -0
- data/rbi/dodopayments/models/subscription_change_plan_params.rbi +10 -0
- data/rbi/dodopayments/models/subscription_list_response.rbi +8 -0
- data/rbi/dodopayments/models/subscription_preview_change_plan_params.rbi +10 -0
- data/rbi/dodopayments/models.rbi +6 -0
- data/rbi/dodopayments/resources/checkout_sessions.rbi +104 -0
- data/rbi/dodopayments/resources/customers.rbi +9 -0
- data/rbi/dodopayments/resources/discounts.rbi +28 -0
- data/rbi/dodopayments/resources/license_keys.rbi +6 -0
- data/rbi/dodopayments/resources/subscriptions.rbi +8 -0
- data/sig/dodopayments/models/checkout_session_preview_params.rbs +15 -0
- data/sig/dodopayments/models/checkout_session_preview_response.rbs +330 -0
- data/sig/dodopayments/models/checkout_session_request.rbs +81 -0
- data/sig/dodopayments/models/customer_list_params.rbs +26 -1
- data/sig/dodopayments/models/discount_list_params.rbs +34 -1
- data/sig/dodopayments/models/discount_retrieve_by_code_params.rbs +15 -0
- data/sig/dodopayments/models/license_key_list_params.rbs +14 -0
- data/sig/dodopayments/models/payment.rbs +22 -0
- data/sig/dodopayments/models/payment_list_response.rbs +10 -0
- data/sig/dodopayments/models/payment_method_types.rbs +26 -196
- data/sig/dodopayments/models/product.rbs +8 -3
- data/sig/dodopayments/models/subscription.rbs +17 -0
- data/sig/dodopayments/models/subscription_change_plan_params.rbs +6 -1
- data/sig/dodopayments/models/subscription_list_response.rbs +5 -0
- data/sig/dodopayments/models/subscription_preview_change_plan_params.rbs +6 -1
- data/sig/dodopayments/models.rbs +4 -0
- data/sig/dodopayments/resources/checkout_sessions.rbs +25 -0
- data/sig/dodopayments/resources/customers.rbs +3 -0
- data/sig/dodopayments/resources/discounts.rbs +9 -0
- data/sig/dodopayments/resources/license_keys.rbs +2 -0
- data/sig/dodopayments/resources/subscriptions.rbs +2 -0
- metadata +11 -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(
|
|
@@ -120,6 +128,10 @@ module Dodopayments
|
|
|
120
128
|
sig { returns(T.nilable(String)) }
|
|
121
129
|
attr_accessor :payment_method_id
|
|
122
130
|
|
|
131
|
+
# Product collection ID for collection-based checkout flow
|
|
132
|
+
sig { returns(T.nilable(String)) }
|
|
133
|
+
attr_accessor :product_collection_id
|
|
134
|
+
|
|
123
135
|
# The url to redirect after payment failure or success.
|
|
124
136
|
sig { returns(T.nilable(String)) }
|
|
125
137
|
attr_accessor :return_url
|
|
@@ -167,6 +179,12 @@ module Dodopayments
|
|
|
167
179
|
),
|
|
168
180
|
billing_currency: T.nilable(Dodopayments::Currency::OrSymbol),
|
|
169
181
|
confirm: T::Boolean,
|
|
182
|
+
custom_fields:
|
|
183
|
+
T.nilable(
|
|
184
|
+
T::Array[
|
|
185
|
+
Dodopayments::CheckoutSessionRequest::CustomField::OrHash
|
|
186
|
+
]
|
|
187
|
+
),
|
|
170
188
|
customer:
|
|
171
189
|
T.nilable(
|
|
172
190
|
T.any(
|
|
@@ -183,6 +201,7 @@ module Dodopayments
|
|
|
183
201
|
metadata: T.nilable(T::Hash[Symbol, String]),
|
|
184
202
|
minimal_address: T::Boolean,
|
|
185
203
|
payment_method_id: T.nilable(String),
|
|
204
|
+
product_collection_id: T.nilable(String),
|
|
186
205
|
return_url: T.nilable(String),
|
|
187
206
|
short_link: T::Boolean,
|
|
188
207
|
show_saved_payment_methods: T::Boolean,
|
|
@@ -208,6 +227,8 @@ module Dodopayments
|
|
|
208
227
|
# If confirm is true, all the details will be finalized. If required data is
|
|
209
228
|
# missing, an API error is thrown.
|
|
210
229
|
confirm: nil,
|
|
230
|
+
# Custom fields to collect from customer during checkout (max 5 fields)
|
|
231
|
+
custom_fields: nil,
|
|
211
232
|
# Customer details for the session
|
|
212
233
|
customer: nil,
|
|
213
234
|
# Customization for the checkout session page
|
|
@@ -225,6 +246,8 @@ module Dodopayments
|
|
|
225
246
|
# Optional payment method ID to use for this checkout session. Only allowed when
|
|
226
247
|
# `confirm` is true. If provided, existing customer id must also be provided.
|
|
227
248
|
payment_method_id: nil,
|
|
249
|
+
# Product collection ID for collection-based checkout flow
|
|
250
|
+
product_collection_id: nil,
|
|
228
251
|
# The url to redirect after payment failure or success.
|
|
229
252
|
return_url: nil,
|
|
230
253
|
# If true, returns a shortened checkout URL. Defaults to false if not specified.
|
|
@@ -246,6 +269,10 @@ module Dodopayments
|
|
|
246
269
|
T.nilable(Dodopayments::CheckoutSessionRequest::BillingAddress),
|
|
247
270
|
billing_currency: T.nilable(Dodopayments::Currency::OrSymbol),
|
|
248
271
|
confirm: T::Boolean,
|
|
272
|
+
custom_fields:
|
|
273
|
+
T.nilable(
|
|
274
|
+
T::Array[Dodopayments::CheckoutSessionRequest::CustomField]
|
|
275
|
+
),
|
|
249
276
|
customer:
|
|
250
277
|
T.nilable(
|
|
251
278
|
T.any(
|
|
@@ -260,6 +287,7 @@ module Dodopayments
|
|
|
260
287
|
metadata: T.nilable(T::Hash[Symbol, String]),
|
|
261
288
|
minimal_address: T::Boolean,
|
|
262
289
|
payment_method_id: T.nilable(String),
|
|
290
|
+
product_collection_id: T.nilable(String),
|
|
263
291
|
return_url: T.nilable(String),
|
|
264
292
|
short_link: T::Boolean,
|
|
265
293
|
show_saved_payment_methods: T::Boolean,
|
|
@@ -408,6 +436,161 @@ module Dodopayments
|
|
|
408
436
|
end
|
|
409
437
|
end
|
|
410
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
|
+
|
|
411
594
|
class Customization < Dodopayments::Internal::Type::BaseModel
|
|
412
595
|
OrHash =
|
|
413
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
|
)
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Models
|
|
5
|
+
class DiscountRetrieveByCodeParams < Dodopayments::Internal::Type::BaseModel
|
|
6
|
+
extend Dodopayments::Internal::Type::RequestParameters::Converter
|
|
7
|
+
include Dodopayments::Internal::Type::RequestParameters
|
|
8
|
+
|
|
9
|
+
OrHash =
|
|
10
|
+
T.type_alias do
|
|
11
|
+
T.any(
|
|
12
|
+
Dodopayments::DiscountRetrieveByCodeParams,
|
|
13
|
+
Dodopayments::Internal::AnyHash
|
|
14
|
+
)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
sig do
|
|
18
|
+
params(request_options: Dodopayments::RequestOptions::OrHash).returns(
|
|
19
|
+
T.attached_class
|
|
20
|
+
)
|
|
21
|
+
end
|
|
22
|
+
def self.new(request_options: {})
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
sig do
|
|
26
|
+
override.returns({ request_options: Dodopayments::RequestOptions })
|
|
27
|
+
end
|
|
28
|
+
def to_hash
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -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
|
|
@@ -118,6 +124,10 @@ module Dodopayments
|
|
|
118
124
|
sig { returns(T.nilable(String)) }
|
|
119
125
|
attr_accessor :invoice_id
|
|
120
126
|
|
|
127
|
+
# URL to download the invoice PDF for this payment.
|
|
128
|
+
sig { returns(T.nilable(String)) }
|
|
129
|
+
attr_accessor :invoice_url
|
|
130
|
+
|
|
121
131
|
# Checkout URL
|
|
122
132
|
sig { returns(T.nilable(String)) }
|
|
123
133
|
attr_accessor :payment_link
|
|
@@ -178,10 +188,15 @@ module Dodopayments
|
|
|
178
188
|
card_network: T.nilable(String),
|
|
179
189
|
card_type: T.nilable(String),
|
|
180
190
|
checkout_session_id: T.nilable(String),
|
|
191
|
+
custom_field_responses:
|
|
192
|
+
T.nilable(
|
|
193
|
+
T::Array[Dodopayments::Payment::CustomFieldResponse::OrHash]
|
|
194
|
+
),
|
|
181
195
|
discount_id: T.nilable(String),
|
|
182
196
|
error_code: T.nilable(String),
|
|
183
197
|
error_message: T.nilable(String),
|
|
184
198
|
invoice_id: T.nilable(String),
|
|
199
|
+
invoice_url: T.nilable(String),
|
|
185
200
|
payment_link: T.nilable(String),
|
|
186
201
|
payment_method: T.nilable(String),
|
|
187
202
|
payment_method_type: T.nilable(String),
|
|
@@ -241,6 +256,8 @@ module Dodopayments
|
|
|
241
256
|
# If payment is made using a checkout session, this field is set to the id of the
|
|
242
257
|
# session.
|
|
243
258
|
checkout_session_id: nil,
|
|
259
|
+
# Customer's responses to custom fields collected during checkout
|
|
260
|
+
custom_field_responses: nil,
|
|
244
261
|
# The discount id if discount is applied
|
|
245
262
|
discount_id: nil,
|
|
246
263
|
# An error code if the payment failed
|
|
@@ -249,6 +266,8 @@ module Dodopayments
|
|
|
249
266
|
error_message: nil,
|
|
250
267
|
# Invoice ID for this payment. Uses India-specific invoice ID if available.
|
|
251
268
|
invoice_id: nil,
|
|
269
|
+
# URL to download the invoice PDF for this payment.
|
|
270
|
+
invoice_url: nil,
|
|
252
271
|
# Checkout URL
|
|
253
272
|
payment_link: nil,
|
|
254
273
|
# Payment method used by customer (e.g. "card", "bank_transfer")
|
|
@@ -296,10 +315,13 @@ module Dodopayments
|
|
|
296
315
|
card_network: T.nilable(String),
|
|
297
316
|
card_type: T.nilable(String),
|
|
298
317
|
checkout_session_id: T.nilable(String),
|
|
318
|
+
custom_field_responses:
|
|
319
|
+
T.nilable(T::Array[Dodopayments::Payment::CustomFieldResponse]),
|
|
299
320
|
discount_id: T.nilable(String),
|
|
300
321
|
error_code: T.nilable(String),
|
|
301
322
|
error_message: T.nilable(String),
|
|
302
323
|
invoice_id: T.nilable(String),
|
|
324
|
+
invoice_url: T.nilable(String),
|
|
303
325
|
payment_link: T.nilable(String),
|
|
304
326
|
payment_method: T.nilable(String),
|
|
305
327
|
payment_method_type: T.nilable(String),
|
|
@@ -415,6 +437,38 @@ module Dodopayments
|
|
|
415
437
|
end
|
|
416
438
|
end
|
|
417
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
|
+
|
|
418
472
|
class ProductCart < Dodopayments::Internal::Type::BaseModel
|
|
419
473
|
OrHash =
|
|
420
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),
|