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
|
@@ -0,0 +1,616 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Models
|
|
5
|
+
class CheckoutSessionPreviewResponse < Dodopayments::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(
|
|
9
|
+
Dodopayments::Models::CheckoutSessionPreviewResponse,
|
|
10
|
+
Dodopayments::Internal::AnyHash
|
|
11
|
+
)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# Billing country
|
|
15
|
+
sig { returns(Dodopayments::CountryCode::TaggedSymbol) }
|
|
16
|
+
attr_accessor :billing_country
|
|
17
|
+
|
|
18
|
+
# Currency in which the calculations were made
|
|
19
|
+
sig { returns(Dodopayments::Currency::TaggedSymbol) }
|
|
20
|
+
attr_accessor :currency
|
|
21
|
+
|
|
22
|
+
# Breakup of the current payment
|
|
23
|
+
sig do
|
|
24
|
+
returns(
|
|
25
|
+
Dodopayments::Models::CheckoutSessionPreviewResponse::CurrentBreakup
|
|
26
|
+
)
|
|
27
|
+
end
|
|
28
|
+
attr_reader :current_breakup
|
|
29
|
+
|
|
30
|
+
sig do
|
|
31
|
+
params(
|
|
32
|
+
current_breakup:
|
|
33
|
+
Dodopayments::Models::CheckoutSessionPreviewResponse::CurrentBreakup::OrHash
|
|
34
|
+
).void
|
|
35
|
+
end
|
|
36
|
+
attr_writer :current_breakup
|
|
37
|
+
|
|
38
|
+
# The total product cart
|
|
39
|
+
sig do
|
|
40
|
+
returns(
|
|
41
|
+
T::Array[
|
|
42
|
+
Dodopayments::Models::CheckoutSessionPreviewResponse::ProductCart
|
|
43
|
+
]
|
|
44
|
+
)
|
|
45
|
+
end
|
|
46
|
+
attr_accessor :product_cart
|
|
47
|
+
|
|
48
|
+
# Total calculate price of the product cart
|
|
49
|
+
sig { returns(Integer) }
|
|
50
|
+
attr_accessor :total_price
|
|
51
|
+
|
|
52
|
+
# Breakup of recurring payments (None for one-time only)
|
|
53
|
+
sig do
|
|
54
|
+
returns(
|
|
55
|
+
T.nilable(
|
|
56
|
+
Dodopayments::Models::CheckoutSessionPreviewResponse::RecurringBreakup
|
|
57
|
+
)
|
|
58
|
+
)
|
|
59
|
+
end
|
|
60
|
+
attr_reader :recurring_breakup
|
|
61
|
+
|
|
62
|
+
sig do
|
|
63
|
+
params(
|
|
64
|
+
recurring_breakup:
|
|
65
|
+
T.nilable(
|
|
66
|
+
Dodopayments::Models::CheckoutSessionPreviewResponse::RecurringBreakup::OrHash
|
|
67
|
+
)
|
|
68
|
+
).void
|
|
69
|
+
end
|
|
70
|
+
attr_writer :recurring_breakup
|
|
71
|
+
|
|
72
|
+
# Total tax
|
|
73
|
+
sig { returns(T.nilable(Integer)) }
|
|
74
|
+
attr_accessor :total_tax
|
|
75
|
+
|
|
76
|
+
# Data returned by the calculate checkout session API
|
|
77
|
+
sig do
|
|
78
|
+
params(
|
|
79
|
+
billing_country: Dodopayments::CountryCode::OrSymbol,
|
|
80
|
+
currency: Dodopayments::Currency::OrSymbol,
|
|
81
|
+
current_breakup:
|
|
82
|
+
Dodopayments::Models::CheckoutSessionPreviewResponse::CurrentBreakup::OrHash,
|
|
83
|
+
product_cart:
|
|
84
|
+
T::Array[
|
|
85
|
+
Dodopayments::Models::CheckoutSessionPreviewResponse::ProductCart::OrHash
|
|
86
|
+
],
|
|
87
|
+
total_price: Integer,
|
|
88
|
+
recurring_breakup:
|
|
89
|
+
T.nilable(
|
|
90
|
+
Dodopayments::Models::CheckoutSessionPreviewResponse::RecurringBreakup::OrHash
|
|
91
|
+
),
|
|
92
|
+
total_tax: T.nilable(Integer)
|
|
93
|
+
).returns(T.attached_class)
|
|
94
|
+
end
|
|
95
|
+
def self.new(
|
|
96
|
+
# Billing country
|
|
97
|
+
billing_country:,
|
|
98
|
+
# Currency in which the calculations were made
|
|
99
|
+
currency:,
|
|
100
|
+
# Breakup of the current payment
|
|
101
|
+
current_breakup:,
|
|
102
|
+
# The total product cart
|
|
103
|
+
product_cart:,
|
|
104
|
+
# Total calculate price of the product cart
|
|
105
|
+
total_price:,
|
|
106
|
+
# Breakup of recurring payments (None for one-time only)
|
|
107
|
+
recurring_breakup: nil,
|
|
108
|
+
# Total tax
|
|
109
|
+
total_tax: nil
|
|
110
|
+
)
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
sig do
|
|
114
|
+
override.returns(
|
|
115
|
+
{
|
|
116
|
+
billing_country: Dodopayments::CountryCode::TaggedSymbol,
|
|
117
|
+
currency: Dodopayments::Currency::TaggedSymbol,
|
|
118
|
+
current_breakup:
|
|
119
|
+
Dodopayments::Models::CheckoutSessionPreviewResponse::CurrentBreakup,
|
|
120
|
+
product_cart:
|
|
121
|
+
T::Array[
|
|
122
|
+
Dodopayments::Models::CheckoutSessionPreviewResponse::ProductCart
|
|
123
|
+
],
|
|
124
|
+
total_price: Integer,
|
|
125
|
+
recurring_breakup:
|
|
126
|
+
T.nilable(
|
|
127
|
+
Dodopayments::Models::CheckoutSessionPreviewResponse::RecurringBreakup
|
|
128
|
+
),
|
|
129
|
+
total_tax: T.nilable(Integer)
|
|
130
|
+
}
|
|
131
|
+
)
|
|
132
|
+
end
|
|
133
|
+
def to_hash
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
class CurrentBreakup < Dodopayments::Internal::Type::BaseModel
|
|
137
|
+
OrHash =
|
|
138
|
+
T.type_alias do
|
|
139
|
+
T.any(
|
|
140
|
+
Dodopayments::Models::CheckoutSessionPreviewResponse::CurrentBreakup,
|
|
141
|
+
Dodopayments::Internal::AnyHash
|
|
142
|
+
)
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
# Total discount amount
|
|
146
|
+
sig { returns(Integer) }
|
|
147
|
+
attr_accessor :discount
|
|
148
|
+
|
|
149
|
+
# Subtotal before discount (pre-tax original prices)
|
|
150
|
+
sig { returns(Integer) }
|
|
151
|
+
attr_accessor :subtotal
|
|
152
|
+
|
|
153
|
+
# Total amount to be charged (final amount after all calculations)
|
|
154
|
+
sig { returns(Integer) }
|
|
155
|
+
attr_accessor :total_amount
|
|
156
|
+
|
|
157
|
+
# Total tax amount
|
|
158
|
+
sig { returns(T.nilable(Integer)) }
|
|
159
|
+
attr_accessor :tax
|
|
160
|
+
|
|
161
|
+
# Breakup of the current payment
|
|
162
|
+
sig do
|
|
163
|
+
params(
|
|
164
|
+
discount: Integer,
|
|
165
|
+
subtotal: Integer,
|
|
166
|
+
total_amount: Integer,
|
|
167
|
+
tax: T.nilable(Integer)
|
|
168
|
+
).returns(T.attached_class)
|
|
169
|
+
end
|
|
170
|
+
def self.new(
|
|
171
|
+
# Total discount amount
|
|
172
|
+
discount:,
|
|
173
|
+
# Subtotal before discount (pre-tax original prices)
|
|
174
|
+
subtotal:,
|
|
175
|
+
# Total amount to be charged (final amount after all calculations)
|
|
176
|
+
total_amount:,
|
|
177
|
+
# Total tax amount
|
|
178
|
+
tax: nil
|
|
179
|
+
)
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
sig do
|
|
183
|
+
override.returns(
|
|
184
|
+
{
|
|
185
|
+
discount: Integer,
|
|
186
|
+
subtotal: Integer,
|
|
187
|
+
total_amount: Integer,
|
|
188
|
+
tax: T.nilable(Integer)
|
|
189
|
+
}
|
|
190
|
+
)
|
|
191
|
+
end
|
|
192
|
+
def to_hash
|
|
193
|
+
end
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
class ProductCart < Dodopayments::Internal::Type::BaseModel
|
|
197
|
+
OrHash =
|
|
198
|
+
T.type_alias do
|
|
199
|
+
T.any(
|
|
200
|
+
Dodopayments::Models::CheckoutSessionPreviewResponse::ProductCart,
|
|
201
|
+
Dodopayments::Internal::AnyHash
|
|
202
|
+
)
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
# the currency in which the calculatiosn were made
|
|
206
|
+
sig { returns(Dodopayments::Currency::TaggedSymbol) }
|
|
207
|
+
attr_accessor :currency
|
|
208
|
+
|
|
209
|
+
# discounted price
|
|
210
|
+
sig { returns(Integer) }
|
|
211
|
+
attr_accessor :discounted_price
|
|
212
|
+
|
|
213
|
+
# Whether this is a subscription product (affects tax calculation in breakup)
|
|
214
|
+
sig { returns(T::Boolean) }
|
|
215
|
+
attr_accessor :is_subscription
|
|
216
|
+
|
|
217
|
+
sig { returns(T::Boolean) }
|
|
218
|
+
attr_accessor :is_usage_based
|
|
219
|
+
|
|
220
|
+
sig do
|
|
221
|
+
returns(
|
|
222
|
+
T::Array[
|
|
223
|
+
Dodopayments::Models::CheckoutSessionPreviewResponse::ProductCart::Meter
|
|
224
|
+
]
|
|
225
|
+
)
|
|
226
|
+
end
|
|
227
|
+
attr_accessor :meters
|
|
228
|
+
|
|
229
|
+
# the product currency
|
|
230
|
+
sig { returns(Dodopayments::Currency::TaggedSymbol) }
|
|
231
|
+
attr_accessor :og_currency
|
|
232
|
+
|
|
233
|
+
# original price of the product
|
|
234
|
+
sig { returns(Integer) }
|
|
235
|
+
attr_accessor :og_price
|
|
236
|
+
|
|
237
|
+
# unique id of the product
|
|
238
|
+
sig { returns(String) }
|
|
239
|
+
attr_accessor :product_id
|
|
240
|
+
|
|
241
|
+
# Quanitity
|
|
242
|
+
sig { returns(Integer) }
|
|
243
|
+
attr_accessor :quantity
|
|
244
|
+
|
|
245
|
+
# tax category
|
|
246
|
+
sig { returns(Dodopayments::TaxCategory::TaggedSymbol) }
|
|
247
|
+
attr_accessor :tax_category
|
|
248
|
+
|
|
249
|
+
# Whether tax is included in the price
|
|
250
|
+
sig { returns(T::Boolean) }
|
|
251
|
+
attr_accessor :tax_inclusive
|
|
252
|
+
|
|
253
|
+
# tax rate
|
|
254
|
+
sig { returns(Integer) }
|
|
255
|
+
attr_accessor :tax_rate
|
|
256
|
+
|
|
257
|
+
sig do
|
|
258
|
+
returns(
|
|
259
|
+
T.nilable(
|
|
260
|
+
T::Array[
|
|
261
|
+
Dodopayments::Models::CheckoutSessionPreviewResponse::ProductCart::Addon
|
|
262
|
+
]
|
|
263
|
+
)
|
|
264
|
+
)
|
|
265
|
+
end
|
|
266
|
+
attr_accessor :addons
|
|
267
|
+
|
|
268
|
+
sig { returns(T.nilable(String)) }
|
|
269
|
+
attr_accessor :description
|
|
270
|
+
|
|
271
|
+
# discount percentage
|
|
272
|
+
sig { returns(T.nilable(Integer)) }
|
|
273
|
+
attr_accessor :discount_amount
|
|
274
|
+
|
|
275
|
+
# number of cycles the discount will apply
|
|
276
|
+
sig { returns(T.nilable(Integer)) }
|
|
277
|
+
attr_accessor :discount_cycle
|
|
278
|
+
|
|
279
|
+
# name of the product
|
|
280
|
+
sig { returns(T.nilable(String)) }
|
|
281
|
+
attr_accessor :name
|
|
282
|
+
|
|
283
|
+
# total tax
|
|
284
|
+
sig { returns(T.nilable(Integer)) }
|
|
285
|
+
attr_accessor :tax
|
|
286
|
+
|
|
287
|
+
sig do
|
|
288
|
+
params(
|
|
289
|
+
currency: Dodopayments::Currency::OrSymbol,
|
|
290
|
+
discounted_price: Integer,
|
|
291
|
+
is_subscription: T::Boolean,
|
|
292
|
+
is_usage_based: T::Boolean,
|
|
293
|
+
meters:
|
|
294
|
+
T::Array[
|
|
295
|
+
Dodopayments::Models::CheckoutSessionPreviewResponse::ProductCart::Meter::OrHash
|
|
296
|
+
],
|
|
297
|
+
og_currency: Dodopayments::Currency::OrSymbol,
|
|
298
|
+
og_price: Integer,
|
|
299
|
+
product_id: String,
|
|
300
|
+
quantity: Integer,
|
|
301
|
+
tax_category: Dodopayments::TaxCategory::OrSymbol,
|
|
302
|
+
tax_inclusive: T::Boolean,
|
|
303
|
+
tax_rate: Integer,
|
|
304
|
+
addons:
|
|
305
|
+
T.nilable(
|
|
306
|
+
T::Array[
|
|
307
|
+
Dodopayments::Models::CheckoutSessionPreviewResponse::ProductCart::Addon::OrHash
|
|
308
|
+
]
|
|
309
|
+
),
|
|
310
|
+
description: T.nilable(String),
|
|
311
|
+
discount_amount: T.nilable(Integer),
|
|
312
|
+
discount_cycle: T.nilable(Integer),
|
|
313
|
+
name: T.nilable(String),
|
|
314
|
+
tax: T.nilable(Integer)
|
|
315
|
+
).returns(T.attached_class)
|
|
316
|
+
end
|
|
317
|
+
def self.new(
|
|
318
|
+
# the currency in which the calculatiosn were made
|
|
319
|
+
currency:,
|
|
320
|
+
# discounted price
|
|
321
|
+
discounted_price:,
|
|
322
|
+
# Whether this is a subscription product (affects tax calculation in breakup)
|
|
323
|
+
is_subscription:,
|
|
324
|
+
is_usage_based:,
|
|
325
|
+
meters:,
|
|
326
|
+
# the product currency
|
|
327
|
+
og_currency:,
|
|
328
|
+
# original price of the product
|
|
329
|
+
og_price:,
|
|
330
|
+
# unique id of the product
|
|
331
|
+
product_id:,
|
|
332
|
+
# Quanitity
|
|
333
|
+
quantity:,
|
|
334
|
+
# tax category
|
|
335
|
+
tax_category:,
|
|
336
|
+
# Whether tax is included in the price
|
|
337
|
+
tax_inclusive:,
|
|
338
|
+
# tax rate
|
|
339
|
+
tax_rate:,
|
|
340
|
+
addons: nil,
|
|
341
|
+
description: nil,
|
|
342
|
+
# discount percentage
|
|
343
|
+
discount_amount: nil,
|
|
344
|
+
# number of cycles the discount will apply
|
|
345
|
+
discount_cycle: nil,
|
|
346
|
+
# name of the product
|
|
347
|
+
name: nil,
|
|
348
|
+
# total tax
|
|
349
|
+
tax: nil
|
|
350
|
+
)
|
|
351
|
+
end
|
|
352
|
+
|
|
353
|
+
sig do
|
|
354
|
+
override.returns(
|
|
355
|
+
{
|
|
356
|
+
currency: Dodopayments::Currency::TaggedSymbol,
|
|
357
|
+
discounted_price: Integer,
|
|
358
|
+
is_subscription: T::Boolean,
|
|
359
|
+
is_usage_based: T::Boolean,
|
|
360
|
+
meters:
|
|
361
|
+
T::Array[
|
|
362
|
+
Dodopayments::Models::CheckoutSessionPreviewResponse::ProductCart::Meter
|
|
363
|
+
],
|
|
364
|
+
og_currency: Dodopayments::Currency::TaggedSymbol,
|
|
365
|
+
og_price: Integer,
|
|
366
|
+
product_id: String,
|
|
367
|
+
quantity: Integer,
|
|
368
|
+
tax_category: Dodopayments::TaxCategory::TaggedSymbol,
|
|
369
|
+
tax_inclusive: T::Boolean,
|
|
370
|
+
tax_rate: Integer,
|
|
371
|
+
addons:
|
|
372
|
+
T.nilable(
|
|
373
|
+
T::Array[
|
|
374
|
+
Dodopayments::Models::CheckoutSessionPreviewResponse::ProductCart::Addon
|
|
375
|
+
]
|
|
376
|
+
),
|
|
377
|
+
description: T.nilable(String),
|
|
378
|
+
discount_amount: T.nilable(Integer),
|
|
379
|
+
discount_cycle: T.nilable(Integer),
|
|
380
|
+
name: T.nilable(String),
|
|
381
|
+
tax: T.nilable(Integer)
|
|
382
|
+
}
|
|
383
|
+
)
|
|
384
|
+
end
|
|
385
|
+
def to_hash
|
|
386
|
+
end
|
|
387
|
+
|
|
388
|
+
class Meter < Dodopayments::Internal::Type::BaseModel
|
|
389
|
+
OrHash =
|
|
390
|
+
T.type_alias do
|
|
391
|
+
T.any(
|
|
392
|
+
Dodopayments::Models::CheckoutSessionPreviewResponse::ProductCart::Meter,
|
|
393
|
+
Dodopayments::Internal::AnyHash
|
|
394
|
+
)
|
|
395
|
+
end
|
|
396
|
+
|
|
397
|
+
sig { returns(String) }
|
|
398
|
+
attr_accessor :measurement_unit
|
|
399
|
+
|
|
400
|
+
sig { returns(String) }
|
|
401
|
+
attr_accessor :name
|
|
402
|
+
|
|
403
|
+
sig { returns(String) }
|
|
404
|
+
attr_accessor :price_per_unit
|
|
405
|
+
|
|
406
|
+
sig { returns(T.nilable(String)) }
|
|
407
|
+
attr_accessor :description
|
|
408
|
+
|
|
409
|
+
sig { returns(T.nilable(Integer)) }
|
|
410
|
+
attr_accessor :free_threshold
|
|
411
|
+
|
|
412
|
+
sig do
|
|
413
|
+
params(
|
|
414
|
+
measurement_unit: String,
|
|
415
|
+
name: String,
|
|
416
|
+
price_per_unit: String,
|
|
417
|
+
description: T.nilable(String),
|
|
418
|
+
free_threshold: T.nilable(Integer)
|
|
419
|
+
).returns(T.attached_class)
|
|
420
|
+
end
|
|
421
|
+
def self.new(
|
|
422
|
+
measurement_unit:,
|
|
423
|
+
name:,
|
|
424
|
+
price_per_unit:,
|
|
425
|
+
description: nil,
|
|
426
|
+
free_threshold: nil
|
|
427
|
+
)
|
|
428
|
+
end
|
|
429
|
+
|
|
430
|
+
sig do
|
|
431
|
+
override.returns(
|
|
432
|
+
{
|
|
433
|
+
measurement_unit: String,
|
|
434
|
+
name: String,
|
|
435
|
+
price_per_unit: String,
|
|
436
|
+
description: T.nilable(String),
|
|
437
|
+
free_threshold: T.nilable(Integer)
|
|
438
|
+
}
|
|
439
|
+
)
|
|
440
|
+
end
|
|
441
|
+
def to_hash
|
|
442
|
+
end
|
|
443
|
+
end
|
|
444
|
+
|
|
445
|
+
class Addon < Dodopayments::Internal::Type::BaseModel
|
|
446
|
+
OrHash =
|
|
447
|
+
T.type_alias do
|
|
448
|
+
T.any(
|
|
449
|
+
Dodopayments::Models::CheckoutSessionPreviewResponse::ProductCart::Addon,
|
|
450
|
+
Dodopayments::Internal::AnyHash
|
|
451
|
+
)
|
|
452
|
+
end
|
|
453
|
+
|
|
454
|
+
sig { returns(String) }
|
|
455
|
+
attr_accessor :addon_id
|
|
456
|
+
|
|
457
|
+
sig { returns(Dodopayments::Currency::TaggedSymbol) }
|
|
458
|
+
attr_accessor :currency
|
|
459
|
+
|
|
460
|
+
sig { returns(Integer) }
|
|
461
|
+
attr_accessor :discounted_price
|
|
462
|
+
|
|
463
|
+
sig { returns(String) }
|
|
464
|
+
attr_accessor :name
|
|
465
|
+
|
|
466
|
+
sig { returns(Dodopayments::Currency::TaggedSymbol) }
|
|
467
|
+
attr_accessor :og_currency
|
|
468
|
+
|
|
469
|
+
sig { returns(Integer) }
|
|
470
|
+
attr_accessor :og_price
|
|
471
|
+
|
|
472
|
+
sig { returns(Integer) }
|
|
473
|
+
attr_accessor :quantity
|
|
474
|
+
|
|
475
|
+
# Represents the different categories of taxation applicable to various products
|
|
476
|
+
# and services.
|
|
477
|
+
sig { returns(Dodopayments::TaxCategory::TaggedSymbol) }
|
|
478
|
+
attr_accessor :tax_category
|
|
479
|
+
|
|
480
|
+
sig { returns(T::Boolean) }
|
|
481
|
+
attr_accessor :tax_inclusive
|
|
482
|
+
|
|
483
|
+
sig { returns(Integer) }
|
|
484
|
+
attr_accessor :tax_rate
|
|
485
|
+
|
|
486
|
+
sig { returns(T.nilable(String)) }
|
|
487
|
+
attr_accessor :description
|
|
488
|
+
|
|
489
|
+
sig { returns(T.nilable(Integer)) }
|
|
490
|
+
attr_accessor :discount_amount
|
|
491
|
+
|
|
492
|
+
sig { returns(T.nilable(Integer)) }
|
|
493
|
+
attr_accessor :tax
|
|
494
|
+
|
|
495
|
+
sig do
|
|
496
|
+
params(
|
|
497
|
+
addon_id: String,
|
|
498
|
+
currency: Dodopayments::Currency::OrSymbol,
|
|
499
|
+
discounted_price: Integer,
|
|
500
|
+
name: String,
|
|
501
|
+
og_currency: Dodopayments::Currency::OrSymbol,
|
|
502
|
+
og_price: Integer,
|
|
503
|
+
quantity: Integer,
|
|
504
|
+
tax_category: Dodopayments::TaxCategory::OrSymbol,
|
|
505
|
+
tax_inclusive: T::Boolean,
|
|
506
|
+
tax_rate: Integer,
|
|
507
|
+
description: T.nilable(String),
|
|
508
|
+
discount_amount: T.nilable(Integer),
|
|
509
|
+
tax: T.nilable(Integer)
|
|
510
|
+
).returns(T.attached_class)
|
|
511
|
+
end
|
|
512
|
+
def self.new(
|
|
513
|
+
addon_id:,
|
|
514
|
+
currency:,
|
|
515
|
+
discounted_price:,
|
|
516
|
+
name:,
|
|
517
|
+
og_currency:,
|
|
518
|
+
og_price:,
|
|
519
|
+
quantity:,
|
|
520
|
+
# Represents the different categories of taxation applicable to various products
|
|
521
|
+
# and services.
|
|
522
|
+
tax_category:,
|
|
523
|
+
tax_inclusive:,
|
|
524
|
+
tax_rate:,
|
|
525
|
+
description: nil,
|
|
526
|
+
discount_amount: nil,
|
|
527
|
+
tax: nil
|
|
528
|
+
)
|
|
529
|
+
end
|
|
530
|
+
|
|
531
|
+
sig do
|
|
532
|
+
override.returns(
|
|
533
|
+
{
|
|
534
|
+
addon_id: String,
|
|
535
|
+
currency: Dodopayments::Currency::TaggedSymbol,
|
|
536
|
+
discounted_price: Integer,
|
|
537
|
+
name: String,
|
|
538
|
+
og_currency: Dodopayments::Currency::TaggedSymbol,
|
|
539
|
+
og_price: Integer,
|
|
540
|
+
quantity: Integer,
|
|
541
|
+
tax_category: Dodopayments::TaxCategory::TaggedSymbol,
|
|
542
|
+
tax_inclusive: T::Boolean,
|
|
543
|
+
tax_rate: Integer,
|
|
544
|
+
description: T.nilable(String),
|
|
545
|
+
discount_amount: T.nilable(Integer),
|
|
546
|
+
tax: T.nilable(Integer)
|
|
547
|
+
}
|
|
548
|
+
)
|
|
549
|
+
end
|
|
550
|
+
def to_hash
|
|
551
|
+
end
|
|
552
|
+
end
|
|
553
|
+
end
|
|
554
|
+
|
|
555
|
+
class RecurringBreakup < Dodopayments::Internal::Type::BaseModel
|
|
556
|
+
OrHash =
|
|
557
|
+
T.type_alias do
|
|
558
|
+
T.any(
|
|
559
|
+
Dodopayments::Models::CheckoutSessionPreviewResponse::RecurringBreakup,
|
|
560
|
+
Dodopayments::Internal::AnyHash
|
|
561
|
+
)
|
|
562
|
+
end
|
|
563
|
+
|
|
564
|
+
# Total discount amount
|
|
565
|
+
sig { returns(Integer) }
|
|
566
|
+
attr_accessor :discount
|
|
567
|
+
|
|
568
|
+
# Subtotal before discount (pre-tax original prices)
|
|
569
|
+
sig { returns(Integer) }
|
|
570
|
+
attr_accessor :subtotal
|
|
571
|
+
|
|
572
|
+
# Total recurring amount including tax
|
|
573
|
+
sig { returns(Integer) }
|
|
574
|
+
attr_accessor :total_amount
|
|
575
|
+
|
|
576
|
+
# Total tax on recurring payments
|
|
577
|
+
sig { returns(T.nilable(Integer)) }
|
|
578
|
+
attr_accessor :tax
|
|
579
|
+
|
|
580
|
+
# Breakup of recurring payments (None for one-time only)
|
|
581
|
+
sig do
|
|
582
|
+
params(
|
|
583
|
+
discount: Integer,
|
|
584
|
+
subtotal: Integer,
|
|
585
|
+
total_amount: Integer,
|
|
586
|
+
tax: T.nilable(Integer)
|
|
587
|
+
).returns(T.attached_class)
|
|
588
|
+
end
|
|
589
|
+
def self.new(
|
|
590
|
+
# Total discount amount
|
|
591
|
+
discount:,
|
|
592
|
+
# Subtotal before discount (pre-tax original prices)
|
|
593
|
+
subtotal:,
|
|
594
|
+
# Total recurring amount including tax
|
|
595
|
+
total_amount:,
|
|
596
|
+
# Total tax on recurring payments
|
|
597
|
+
tax: nil
|
|
598
|
+
)
|
|
599
|
+
end
|
|
600
|
+
|
|
601
|
+
sig do
|
|
602
|
+
override.returns(
|
|
603
|
+
{
|
|
604
|
+
discount: Integer,
|
|
605
|
+
subtotal: Integer,
|
|
606
|
+
total_amount: Integer,
|
|
607
|
+
tax: T.nilable(Integer)
|
|
608
|
+
}
|
|
609
|
+
)
|
|
610
|
+
end
|
|
611
|
+
def to_hash
|
|
612
|
+
end
|
|
613
|
+
end
|
|
614
|
+
end
|
|
615
|
+
end
|
|
616
|
+
end
|