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
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: fddfc5463bfdb2c80d2f98a580ba1a41eaa68a20d1cb4e9e3c8507d3778fea52
|
|
4
|
+
data.tar.gz: 9ca12b9e7007d21f3d886877d0c85baa3e4e5e331ecaf5a151b687f34fec62f0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c0904785bd1cd4537e85092279c8399695e1c42e59317de80cff033b4cb70cb2269743c96ee25dfccedb9685bd680e9570f1cef856404250f66c4f19beb933a9
|
|
7
|
+
data.tar.gz: b6a7fc6ae6078abc1d471cad412b953e336248ca26e0a3c8b3f03c83d64cfa3e34ff347789f53fbaecebf471df9bfe1d43a2c89a5b0ffc6ad59817d34b656b73
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.74.0 (2026-01-21)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v1.73.0...v1.74.0](https://github.com/dodopayments/dodopayments-ruby/compare/v1.73.0...v1.74.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** updated openapi spec to v1.74.0 ([81bd146](https://github.com/dodopayments/dodopayments-ruby/commit/81bd146a912f98174fed1ef0ad741f585d78a322))
|
|
10
|
+
|
|
11
|
+
## 1.73.0 (2026-01-20)
|
|
12
|
+
|
|
13
|
+
Full Changelog: [v1.71.1...v1.73.0](https://github.com/dodopayments/dodopayments-ruby/compare/v1.71.1...v1.73.0)
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* **api:** update openapi spec to v1.73.0 ([24b7c76](https://github.com/dodopayments/dodopayments-ruby/commit/24b7c763b9f8845d138ca8d286bce058831e27a9))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Chores
|
|
21
|
+
|
|
22
|
+
* **internal:** update `actions/checkout` version ([7ea17a7](https://github.com/dodopayments/dodopayments-ruby/commit/7ea17a7662be22901a344ddbe9b2b7788c08f781))
|
|
23
|
+
|
|
3
24
|
## 1.71.1 (2026-01-10)
|
|
4
25
|
|
|
5
26
|
Full Changelog: [v1.71.0...v1.71.1](https://github.com/dodopayments/dodopayments-ruby/compare/v1.71.0...v1.71.1)
|
data/README.md
CHANGED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Models
|
|
5
|
+
# @see Dodopayments::Resources::CheckoutSessions#preview
|
|
6
|
+
class CheckoutSessionPreviewParams < Dodopayments::Models::CheckoutSessionRequest
|
|
7
|
+
extend Dodopayments::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include Dodopayments::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
# @!method initialize(request_options: {})
|
|
11
|
+
# @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,426 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Models
|
|
5
|
+
# @see Dodopayments::Resources::CheckoutSessions#preview
|
|
6
|
+
class CheckoutSessionPreviewResponse < Dodopayments::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute billing_country
|
|
8
|
+
# Billing country
|
|
9
|
+
#
|
|
10
|
+
# @return [Symbol, Dodopayments::Models::CountryCode]
|
|
11
|
+
required :billing_country, enum: -> { Dodopayments::CountryCode }
|
|
12
|
+
|
|
13
|
+
# @!attribute currency
|
|
14
|
+
# Currency in which the calculations were made
|
|
15
|
+
#
|
|
16
|
+
# @return [Symbol, Dodopayments::Models::Currency]
|
|
17
|
+
required :currency, enum: -> { Dodopayments::Currency }
|
|
18
|
+
|
|
19
|
+
# @!attribute current_breakup
|
|
20
|
+
# Breakup of the current payment
|
|
21
|
+
#
|
|
22
|
+
# @return [Dodopayments::Models::CheckoutSessionPreviewResponse::CurrentBreakup]
|
|
23
|
+
required :current_breakup, -> { Dodopayments::Models::CheckoutSessionPreviewResponse::CurrentBreakup }
|
|
24
|
+
|
|
25
|
+
# @!attribute product_cart
|
|
26
|
+
# The total product cart
|
|
27
|
+
#
|
|
28
|
+
# @return [Array<Dodopayments::Models::CheckoutSessionPreviewResponse::ProductCart>]
|
|
29
|
+
required :product_cart,
|
|
30
|
+
-> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::Models::CheckoutSessionPreviewResponse::ProductCart] }
|
|
31
|
+
|
|
32
|
+
# @!attribute total_price
|
|
33
|
+
# Total calculate price of the product cart
|
|
34
|
+
#
|
|
35
|
+
# @return [Integer]
|
|
36
|
+
required :total_price, Integer
|
|
37
|
+
|
|
38
|
+
# @!attribute recurring_breakup
|
|
39
|
+
# Breakup of recurring payments (None for one-time only)
|
|
40
|
+
#
|
|
41
|
+
# @return [Dodopayments::Models::CheckoutSessionPreviewResponse::RecurringBreakup, nil]
|
|
42
|
+
optional :recurring_breakup,
|
|
43
|
+
-> { Dodopayments::Models::CheckoutSessionPreviewResponse::RecurringBreakup },
|
|
44
|
+
nil?: true
|
|
45
|
+
|
|
46
|
+
# @!attribute total_tax
|
|
47
|
+
# Total tax
|
|
48
|
+
#
|
|
49
|
+
# @return [Integer, nil]
|
|
50
|
+
optional :total_tax, Integer, nil?: true
|
|
51
|
+
|
|
52
|
+
# @!method initialize(billing_country:, currency:, current_breakup:, product_cart:, total_price:, recurring_breakup: nil, total_tax: nil)
|
|
53
|
+
# Data returned by the calculate checkout session API
|
|
54
|
+
#
|
|
55
|
+
# @param billing_country [Symbol, Dodopayments::Models::CountryCode] Billing country
|
|
56
|
+
#
|
|
57
|
+
# @param currency [Symbol, Dodopayments::Models::Currency] Currency in which the calculations were made
|
|
58
|
+
#
|
|
59
|
+
# @param current_breakup [Dodopayments::Models::CheckoutSessionPreviewResponse::CurrentBreakup] Breakup of the current payment
|
|
60
|
+
#
|
|
61
|
+
# @param product_cart [Array<Dodopayments::Models::CheckoutSessionPreviewResponse::ProductCart>] The total product cart
|
|
62
|
+
#
|
|
63
|
+
# @param total_price [Integer] Total calculate price of the product cart
|
|
64
|
+
#
|
|
65
|
+
# @param recurring_breakup [Dodopayments::Models::CheckoutSessionPreviewResponse::RecurringBreakup, nil] Breakup of recurring payments (None for one-time only)
|
|
66
|
+
#
|
|
67
|
+
# @param total_tax [Integer, nil] Total tax
|
|
68
|
+
|
|
69
|
+
# @see Dodopayments::Models::CheckoutSessionPreviewResponse#current_breakup
|
|
70
|
+
class CurrentBreakup < Dodopayments::Internal::Type::BaseModel
|
|
71
|
+
# @!attribute discount
|
|
72
|
+
# Total discount amount
|
|
73
|
+
#
|
|
74
|
+
# @return [Integer]
|
|
75
|
+
required :discount, Integer
|
|
76
|
+
|
|
77
|
+
# @!attribute subtotal
|
|
78
|
+
# Subtotal before discount (pre-tax original prices)
|
|
79
|
+
#
|
|
80
|
+
# @return [Integer]
|
|
81
|
+
required :subtotal, Integer
|
|
82
|
+
|
|
83
|
+
# @!attribute total_amount
|
|
84
|
+
# Total amount to be charged (final amount after all calculations)
|
|
85
|
+
#
|
|
86
|
+
# @return [Integer]
|
|
87
|
+
required :total_amount, Integer
|
|
88
|
+
|
|
89
|
+
# @!attribute tax
|
|
90
|
+
# Total tax amount
|
|
91
|
+
#
|
|
92
|
+
# @return [Integer, nil]
|
|
93
|
+
optional :tax, Integer, nil?: true
|
|
94
|
+
|
|
95
|
+
# @!method initialize(discount:, subtotal:, total_amount:, tax: nil)
|
|
96
|
+
# Breakup of the current payment
|
|
97
|
+
#
|
|
98
|
+
# @param discount [Integer] Total discount amount
|
|
99
|
+
#
|
|
100
|
+
# @param subtotal [Integer] Subtotal before discount (pre-tax original prices)
|
|
101
|
+
#
|
|
102
|
+
# @param total_amount [Integer] Total amount to be charged (final amount after all calculations)
|
|
103
|
+
#
|
|
104
|
+
# @param tax [Integer, nil] Total tax amount
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
class ProductCart < Dodopayments::Internal::Type::BaseModel
|
|
108
|
+
# @!attribute currency
|
|
109
|
+
# the currency in which the calculatiosn were made
|
|
110
|
+
#
|
|
111
|
+
# @return [Symbol, Dodopayments::Models::Currency]
|
|
112
|
+
required :currency, enum: -> { Dodopayments::Currency }
|
|
113
|
+
|
|
114
|
+
# @!attribute discounted_price
|
|
115
|
+
# discounted price
|
|
116
|
+
#
|
|
117
|
+
# @return [Integer]
|
|
118
|
+
required :discounted_price, Integer
|
|
119
|
+
|
|
120
|
+
# @!attribute is_subscription
|
|
121
|
+
# Whether this is a subscription product (affects tax calculation in breakup)
|
|
122
|
+
#
|
|
123
|
+
# @return [Boolean]
|
|
124
|
+
required :is_subscription, Dodopayments::Internal::Type::Boolean
|
|
125
|
+
|
|
126
|
+
# @!attribute is_usage_based
|
|
127
|
+
#
|
|
128
|
+
# @return [Boolean]
|
|
129
|
+
required :is_usage_based, Dodopayments::Internal::Type::Boolean
|
|
130
|
+
|
|
131
|
+
# @!attribute meters
|
|
132
|
+
#
|
|
133
|
+
# @return [Array<Dodopayments::Models::CheckoutSessionPreviewResponse::ProductCart::Meter>]
|
|
134
|
+
required :meters,
|
|
135
|
+
-> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::Models::CheckoutSessionPreviewResponse::ProductCart::Meter] }
|
|
136
|
+
|
|
137
|
+
# @!attribute og_currency
|
|
138
|
+
# the product currency
|
|
139
|
+
#
|
|
140
|
+
# @return [Symbol, Dodopayments::Models::Currency]
|
|
141
|
+
required :og_currency, enum: -> { Dodopayments::Currency }
|
|
142
|
+
|
|
143
|
+
# @!attribute og_price
|
|
144
|
+
# original price of the product
|
|
145
|
+
#
|
|
146
|
+
# @return [Integer]
|
|
147
|
+
required :og_price, Integer
|
|
148
|
+
|
|
149
|
+
# @!attribute product_id
|
|
150
|
+
# unique id of the product
|
|
151
|
+
#
|
|
152
|
+
# @return [String]
|
|
153
|
+
required :product_id, String
|
|
154
|
+
|
|
155
|
+
# @!attribute quantity
|
|
156
|
+
# Quanitity
|
|
157
|
+
#
|
|
158
|
+
# @return [Integer]
|
|
159
|
+
required :quantity, Integer
|
|
160
|
+
|
|
161
|
+
# @!attribute tax_category
|
|
162
|
+
# tax category
|
|
163
|
+
#
|
|
164
|
+
# @return [Symbol, Dodopayments::Models::TaxCategory]
|
|
165
|
+
required :tax_category, enum: -> { Dodopayments::TaxCategory }
|
|
166
|
+
|
|
167
|
+
# @!attribute tax_inclusive
|
|
168
|
+
# Whether tax is included in the price
|
|
169
|
+
#
|
|
170
|
+
# @return [Boolean]
|
|
171
|
+
required :tax_inclusive, Dodopayments::Internal::Type::Boolean
|
|
172
|
+
|
|
173
|
+
# @!attribute tax_rate
|
|
174
|
+
# tax rate
|
|
175
|
+
#
|
|
176
|
+
# @return [Integer]
|
|
177
|
+
required :tax_rate, Integer
|
|
178
|
+
|
|
179
|
+
# @!attribute addons
|
|
180
|
+
#
|
|
181
|
+
# @return [Array<Dodopayments::Models::CheckoutSessionPreviewResponse::ProductCart::Addon>, nil]
|
|
182
|
+
optional :addons,
|
|
183
|
+
-> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::Models::CheckoutSessionPreviewResponse::ProductCart::Addon] },
|
|
184
|
+
nil?: true
|
|
185
|
+
|
|
186
|
+
# @!attribute description
|
|
187
|
+
#
|
|
188
|
+
# @return [String, nil]
|
|
189
|
+
optional :description, String, nil?: true
|
|
190
|
+
|
|
191
|
+
# @!attribute discount_amount
|
|
192
|
+
# discount percentage
|
|
193
|
+
#
|
|
194
|
+
# @return [Integer, nil]
|
|
195
|
+
optional :discount_amount, Integer, nil?: true
|
|
196
|
+
|
|
197
|
+
# @!attribute discount_cycle
|
|
198
|
+
# number of cycles the discount will apply
|
|
199
|
+
#
|
|
200
|
+
# @return [Integer, nil]
|
|
201
|
+
optional :discount_cycle, Integer, nil?: true
|
|
202
|
+
|
|
203
|
+
# @!attribute name
|
|
204
|
+
# name of the product
|
|
205
|
+
#
|
|
206
|
+
# @return [String, nil]
|
|
207
|
+
optional :name, String, nil?: true
|
|
208
|
+
|
|
209
|
+
# @!attribute tax
|
|
210
|
+
# total tax
|
|
211
|
+
#
|
|
212
|
+
# @return [Integer, nil]
|
|
213
|
+
optional :tax, Integer, nil?: true
|
|
214
|
+
|
|
215
|
+
# @!method initialize(currency:, discounted_price:, is_subscription:, is_usage_based:, meters:, og_currency:, og_price:, product_id:, quantity:, tax_category:, tax_inclusive:, tax_rate:, addons: nil, description: nil, discount_amount: nil, discount_cycle: nil, name: nil, tax: nil)
|
|
216
|
+
# @param currency [Symbol, Dodopayments::Models::Currency] the currency in which the calculatiosn were made
|
|
217
|
+
#
|
|
218
|
+
# @param discounted_price [Integer] discounted price
|
|
219
|
+
#
|
|
220
|
+
# @param is_subscription [Boolean] Whether this is a subscription product (affects tax calculation in breakup)
|
|
221
|
+
#
|
|
222
|
+
# @param is_usage_based [Boolean]
|
|
223
|
+
#
|
|
224
|
+
# @param meters [Array<Dodopayments::Models::CheckoutSessionPreviewResponse::ProductCart::Meter>]
|
|
225
|
+
#
|
|
226
|
+
# @param og_currency [Symbol, Dodopayments::Models::Currency] the product currency
|
|
227
|
+
#
|
|
228
|
+
# @param og_price [Integer] original price of the product
|
|
229
|
+
#
|
|
230
|
+
# @param product_id [String] unique id of the product
|
|
231
|
+
#
|
|
232
|
+
# @param quantity [Integer] Quanitity
|
|
233
|
+
#
|
|
234
|
+
# @param tax_category [Symbol, Dodopayments::Models::TaxCategory] tax category
|
|
235
|
+
#
|
|
236
|
+
# @param tax_inclusive [Boolean] Whether tax is included in the price
|
|
237
|
+
#
|
|
238
|
+
# @param tax_rate [Integer] tax rate
|
|
239
|
+
#
|
|
240
|
+
# @param addons [Array<Dodopayments::Models::CheckoutSessionPreviewResponse::ProductCart::Addon>, nil]
|
|
241
|
+
#
|
|
242
|
+
# @param description [String, nil]
|
|
243
|
+
#
|
|
244
|
+
# @param discount_amount [Integer, nil] discount percentage
|
|
245
|
+
#
|
|
246
|
+
# @param discount_cycle [Integer, nil] number of cycles the discount will apply
|
|
247
|
+
#
|
|
248
|
+
# @param name [String, nil] name of the product
|
|
249
|
+
#
|
|
250
|
+
# @param tax [Integer, nil] total tax
|
|
251
|
+
|
|
252
|
+
class Meter < Dodopayments::Internal::Type::BaseModel
|
|
253
|
+
# @!attribute measurement_unit
|
|
254
|
+
#
|
|
255
|
+
# @return [String]
|
|
256
|
+
required :measurement_unit, String
|
|
257
|
+
|
|
258
|
+
# @!attribute name
|
|
259
|
+
#
|
|
260
|
+
# @return [String]
|
|
261
|
+
required :name, String
|
|
262
|
+
|
|
263
|
+
# @!attribute price_per_unit
|
|
264
|
+
#
|
|
265
|
+
# @return [String]
|
|
266
|
+
required :price_per_unit, String
|
|
267
|
+
|
|
268
|
+
# @!attribute description
|
|
269
|
+
#
|
|
270
|
+
# @return [String, nil]
|
|
271
|
+
optional :description, String, nil?: true
|
|
272
|
+
|
|
273
|
+
# @!attribute free_threshold
|
|
274
|
+
#
|
|
275
|
+
# @return [Integer, nil]
|
|
276
|
+
optional :free_threshold, Integer, nil?: true
|
|
277
|
+
|
|
278
|
+
# @!method initialize(measurement_unit:, name:, price_per_unit:, description: nil, free_threshold: nil)
|
|
279
|
+
# @param measurement_unit [String]
|
|
280
|
+
# @param name [String]
|
|
281
|
+
# @param price_per_unit [String]
|
|
282
|
+
# @param description [String, nil]
|
|
283
|
+
# @param free_threshold [Integer, nil]
|
|
284
|
+
end
|
|
285
|
+
|
|
286
|
+
class Addon < Dodopayments::Internal::Type::BaseModel
|
|
287
|
+
# @!attribute addon_id
|
|
288
|
+
#
|
|
289
|
+
# @return [String]
|
|
290
|
+
required :addon_id, String
|
|
291
|
+
|
|
292
|
+
# @!attribute currency
|
|
293
|
+
#
|
|
294
|
+
# @return [Symbol, Dodopayments::Models::Currency]
|
|
295
|
+
required :currency, enum: -> { Dodopayments::Currency }
|
|
296
|
+
|
|
297
|
+
# @!attribute discounted_price
|
|
298
|
+
#
|
|
299
|
+
# @return [Integer]
|
|
300
|
+
required :discounted_price, Integer
|
|
301
|
+
|
|
302
|
+
# @!attribute name
|
|
303
|
+
#
|
|
304
|
+
# @return [String]
|
|
305
|
+
required :name, String
|
|
306
|
+
|
|
307
|
+
# @!attribute og_currency
|
|
308
|
+
#
|
|
309
|
+
# @return [Symbol, Dodopayments::Models::Currency]
|
|
310
|
+
required :og_currency, enum: -> { Dodopayments::Currency }
|
|
311
|
+
|
|
312
|
+
# @!attribute og_price
|
|
313
|
+
#
|
|
314
|
+
# @return [Integer]
|
|
315
|
+
required :og_price, Integer
|
|
316
|
+
|
|
317
|
+
# @!attribute quantity
|
|
318
|
+
#
|
|
319
|
+
# @return [Integer]
|
|
320
|
+
required :quantity, Integer
|
|
321
|
+
|
|
322
|
+
# @!attribute tax_category
|
|
323
|
+
# Represents the different categories of taxation applicable to various products
|
|
324
|
+
# and services.
|
|
325
|
+
#
|
|
326
|
+
# @return [Symbol, Dodopayments::Models::TaxCategory]
|
|
327
|
+
required :tax_category, enum: -> { Dodopayments::TaxCategory }
|
|
328
|
+
|
|
329
|
+
# @!attribute tax_inclusive
|
|
330
|
+
#
|
|
331
|
+
# @return [Boolean]
|
|
332
|
+
required :tax_inclusive, Dodopayments::Internal::Type::Boolean
|
|
333
|
+
|
|
334
|
+
# @!attribute tax_rate
|
|
335
|
+
#
|
|
336
|
+
# @return [Integer]
|
|
337
|
+
required :tax_rate, Integer
|
|
338
|
+
|
|
339
|
+
# @!attribute description
|
|
340
|
+
#
|
|
341
|
+
# @return [String, nil]
|
|
342
|
+
optional :description, String, nil?: true
|
|
343
|
+
|
|
344
|
+
# @!attribute discount_amount
|
|
345
|
+
#
|
|
346
|
+
# @return [Integer, nil]
|
|
347
|
+
optional :discount_amount, Integer, nil?: true
|
|
348
|
+
|
|
349
|
+
# @!attribute tax
|
|
350
|
+
#
|
|
351
|
+
# @return [Integer, nil]
|
|
352
|
+
optional :tax, Integer, nil?: true
|
|
353
|
+
|
|
354
|
+
# @!method initialize(addon_id:, currency:, discounted_price:, name:, og_currency:, og_price:, quantity:, tax_category:, tax_inclusive:, tax_rate:, description: nil, discount_amount: nil, tax: nil)
|
|
355
|
+
# Some parameter documentations has been truncated, see
|
|
356
|
+
# {Dodopayments::Models::CheckoutSessionPreviewResponse::ProductCart::Addon} for
|
|
357
|
+
# more details.
|
|
358
|
+
#
|
|
359
|
+
# @param addon_id [String]
|
|
360
|
+
#
|
|
361
|
+
# @param currency [Symbol, Dodopayments::Models::Currency]
|
|
362
|
+
#
|
|
363
|
+
# @param discounted_price [Integer]
|
|
364
|
+
#
|
|
365
|
+
# @param name [String]
|
|
366
|
+
#
|
|
367
|
+
# @param og_currency [Symbol, Dodopayments::Models::Currency]
|
|
368
|
+
#
|
|
369
|
+
# @param og_price [Integer]
|
|
370
|
+
#
|
|
371
|
+
# @param quantity [Integer]
|
|
372
|
+
#
|
|
373
|
+
# @param tax_category [Symbol, Dodopayments::Models::TaxCategory] Represents the different categories of taxation applicable to various products a
|
|
374
|
+
#
|
|
375
|
+
# @param tax_inclusive [Boolean]
|
|
376
|
+
#
|
|
377
|
+
# @param tax_rate [Integer]
|
|
378
|
+
#
|
|
379
|
+
# @param description [String, nil]
|
|
380
|
+
#
|
|
381
|
+
# @param discount_amount [Integer, nil]
|
|
382
|
+
#
|
|
383
|
+
# @param tax [Integer, nil]
|
|
384
|
+
end
|
|
385
|
+
end
|
|
386
|
+
|
|
387
|
+
# @see Dodopayments::Models::CheckoutSessionPreviewResponse#recurring_breakup
|
|
388
|
+
class RecurringBreakup < Dodopayments::Internal::Type::BaseModel
|
|
389
|
+
# @!attribute discount
|
|
390
|
+
# Total discount amount
|
|
391
|
+
#
|
|
392
|
+
# @return [Integer]
|
|
393
|
+
required :discount, Integer
|
|
394
|
+
|
|
395
|
+
# @!attribute subtotal
|
|
396
|
+
# Subtotal before discount (pre-tax original prices)
|
|
397
|
+
#
|
|
398
|
+
# @return [Integer]
|
|
399
|
+
required :subtotal, Integer
|
|
400
|
+
|
|
401
|
+
# @!attribute total_amount
|
|
402
|
+
# Total recurring amount including tax
|
|
403
|
+
#
|
|
404
|
+
# @return [Integer]
|
|
405
|
+
required :total_amount, Integer
|
|
406
|
+
|
|
407
|
+
# @!attribute tax
|
|
408
|
+
# Total tax on recurring payments
|
|
409
|
+
#
|
|
410
|
+
# @return [Integer, nil]
|
|
411
|
+
optional :tax, Integer, nil?: true
|
|
412
|
+
|
|
413
|
+
# @!method initialize(discount:, subtotal:, total_amount:, tax: nil)
|
|
414
|
+
# Breakup of recurring payments (None for one-time only)
|
|
415
|
+
#
|
|
416
|
+
# @param discount [Integer] Total discount amount
|
|
417
|
+
#
|
|
418
|
+
# @param subtotal [Integer] Subtotal before discount (pre-tax original prices)
|
|
419
|
+
#
|
|
420
|
+
# @param total_amount [Integer] Total recurring amount including tax
|
|
421
|
+
#
|
|
422
|
+
# @param tax [Integer, nil] Total tax on recurring payments
|
|
423
|
+
end
|
|
424
|
+
end
|
|
425
|
+
end
|
|
426
|
+
end
|
|
@@ -41,6 +41,16 @@ module Dodopayments
|
|
|
41
41
|
# @return [Boolean, nil]
|
|
42
42
|
optional :confirm, Dodopayments::Internal::Type::Boolean
|
|
43
43
|
|
|
44
|
+
# @!attribute custom_fields
|
|
45
|
+
# Custom fields to collect from customer during checkout (max 5 fields)
|
|
46
|
+
#
|
|
47
|
+
# @return [Array<Dodopayments::Models::CheckoutSessionRequest::CustomField>, nil]
|
|
48
|
+
optional :custom_fields,
|
|
49
|
+
-> {
|
|
50
|
+
Dodopayments::Internal::Type::ArrayOf[Dodopayments::CheckoutSessionRequest::CustomField]
|
|
51
|
+
},
|
|
52
|
+
nil?: true
|
|
53
|
+
|
|
44
54
|
# @!attribute customer
|
|
45
55
|
# Customer details for the session
|
|
46
56
|
#
|
|
@@ -90,6 +100,12 @@ module Dodopayments
|
|
|
90
100
|
# @return [String, nil]
|
|
91
101
|
optional :payment_method_id, String, nil?: true
|
|
92
102
|
|
|
103
|
+
# @!attribute product_collection_id
|
|
104
|
+
# Product collection ID for collection-based checkout flow
|
|
105
|
+
#
|
|
106
|
+
# @return [String, nil]
|
|
107
|
+
optional :product_collection_id, String, nil?: true
|
|
108
|
+
|
|
93
109
|
# @!attribute return_url
|
|
94
110
|
# The url to redirect after payment failure or success.
|
|
95
111
|
#
|
|
@@ -113,7 +129,7 @@ module Dodopayments
|
|
|
113
129
|
# @return [Dodopayments::Models::CheckoutSessionRequest::SubscriptionData, nil]
|
|
114
130
|
optional :subscription_data, -> { Dodopayments::CheckoutSessionRequest::SubscriptionData }, nil?: true
|
|
115
131
|
|
|
116
|
-
# @!method initialize(product_cart:, allowed_payment_method_types: nil, billing_address: nil, billing_currency: nil, confirm: nil, customer: nil, customization: nil, discount_code: nil, feature_flags: nil, force_3ds: nil, metadata: nil, minimal_address: nil, payment_method_id: nil, return_url: nil, short_link: nil, show_saved_payment_methods: nil, subscription_data: nil)
|
|
132
|
+
# @!method initialize(product_cart:, allowed_payment_method_types: nil, billing_address: nil, billing_currency: nil, confirm: nil, custom_fields: nil, customer: nil, customization: nil, discount_code: nil, feature_flags: nil, force_3ds: nil, metadata: nil, minimal_address: nil, payment_method_id: nil, product_collection_id: nil, return_url: nil, short_link: nil, show_saved_payment_methods: nil, subscription_data: nil)
|
|
117
133
|
# Some parameter documentations has been truncated, see
|
|
118
134
|
# {Dodopayments::Models::CheckoutSessionRequest} for more details.
|
|
119
135
|
#
|
|
@@ -127,6 +143,8 @@ module Dodopayments
|
|
|
127
143
|
#
|
|
128
144
|
# @param confirm [Boolean] If confirm is true, all the details will be finalized. If required data is missi
|
|
129
145
|
#
|
|
146
|
+
# @param custom_fields [Array<Dodopayments::Models::CheckoutSessionRequest::CustomField>, nil] Custom fields to collect from customer during checkout (max 5 fields)
|
|
147
|
+
#
|
|
130
148
|
# @param customer [Dodopayments::Models::AttachExistingCustomer, Dodopayments::Models::NewCustomer, nil] Customer details for the session
|
|
131
149
|
#
|
|
132
150
|
# @param customization [Dodopayments::Models::CheckoutSessionRequest::Customization] Customization for the checkout session page
|
|
@@ -143,6 +161,8 @@ module Dodopayments
|
|
|
143
161
|
#
|
|
144
162
|
# @param payment_method_id [String, nil] Optional payment method ID to use for this checkout session.
|
|
145
163
|
#
|
|
164
|
+
# @param product_collection_id [String, nil] Product collection ID for collection-based checkout flow
|
|
165
|
+
#
|
|
146
166
|
# @param return_url [String, nil] The url to redirect after payment failure or success.
|
|
147
167
|
#
|
|
148
168
|
# @param short_link [Boolean] If true, returns a shortened checkout URL.
|
|
@@ -240,6 +260,79 @@ module Dodopayments
|
|
|
240
260
|
# @param zipcode [String, nil] Postal code or ZIP code
|
|
241
261
|
end
|
|
242
262
|
|
|
263
|
+
class CustomField < Dodopayments::Internal::Type::BaseModel
|
|
264
|
+
# @!attribute field_type
|
|
265
|
+
# Type of field determining validation rules
|
|
266
|
+
#
|
|
267
|
+
# @return [Symbol, Dodopayments::Models::CheckoutSessionRequest::CustomField::FieldType]
|
|
268
|
+
required :field_type, enum: -> { Dodopayments::CheckoutSessionRequest::CustomField::FieldType }
|
|
269
|
+
|
|
270
|
+
# @!attribute key
|
|
271
|
+
# Unique identifier for this field (used as key in responses)
|
|
272
|
+
#
|
|
273
|
+
# @return [String]
|
|
274
|
+
required :key, String
|
|
275
|
+
|
|
276
|
+
# @!attribute label
|
|
277
|
+
# Display label shown to customer
|
|
278
|
+
#
|
|
279
|
+
# @return [String]
|
|
280
|
+
required :label, String
|
|
281
|
+
|
|
282
|
+
# @!attribute options
|
|
283
|
+
# Options for dropdown type (required for dropdown, ignored for others)
|
|
284
|
+
#
|
|
285
|
+
# @return [Array<String>, nil]
|
|
286
|
+
optional :options, Dodopayments::Internal::Type::ArrayOf[String], nil?: true
|
|
287
|
+
|
|
288
|
+
# @!attribute placeholder
|
|
289
|
+
# Placeholder text for the input
|
|
290
|
+
#
|
|
291
|
+
# @return [String, nil]
|
|
292
|
+
optional :placeholder, String, nil?: true
|
|
293
|
+
|
|
294
|
+
# @!attribute required
|
|
295
|
+
# Whether this field is required
|
|
296
|
+
#
|
|
297
|
+
# @return [Boolean, nil]
|
|
298
|
+
optional :required, Dodopayments::Internal::Type::Boolean
|
|
299
|
+
|
|
300
|
+
# @!method initialize(field_type:, key:, label:, options: nil, placeholder: nil, required: nil)
|
|
301
|
+
# Definition of a custom field for checkout
|
|
302
|
+
#
|
|
303
|
+
# @param field_type [Symbol, Dodopayments::Models::CheckoutSessionRequest::CustomField::FieldType] Type of field determining validation rules
|
|
304
|
+
#
|
|
305
|
+
# @param key [String] Unique identifier for this field (used as key in responses)
|
|
306
|
+
#
|
|
307
|
+
# @param label [String] Display label shown to customer
|
|
308
|
+
#
|
|
309
|
+
# @param options [Array<String>, nil] Options for dropdown type (required for dropdown, ignored for others)
|
|
310
|
+
#
|
|
311
|
+
# @param placeholder [String, nil] Placeholder text for the input
|
|
312
|
+
#
|
|
313
|
+
# @param required [Boolean] Whether this field is required
|
|
314
|
+
|
|
315
|
+
# Type of field determining validation rules
|
|
316
|
+
#
|
|
317
|
+
# @see Dodopayments::Models::CheckoutSessionRequest::CustomField#field_type
|
|
318
|
+
module FieldType
|
|
319
|
+
extend Dodopayments::Internal::Type::Enum
|
|
320
|
+
|
|
321
|
+
TEXT = :text
|
|
322
|
+
NUMBER = :number
|
|
323
|
+
EMAIL = :email
|
|
324
|
+
URL = :url
|
|
325
|
+
PHONE = :phone
|
|
326
|
+
DATE = :date
|
|
327
|
+
DATETIME = :datetime
|
|
328
|
+
DROPDOWN = :dropdown
|
|
329
|
+
BOOLEAN = :boolean
|
|
330
|
+
|
|
331
|
+
# @!method self.values
|
|
332
|
+
# @return [Array<Symbol>]
|
|
333
|
+
end
|
|
334
|
+
end
|
|
335
|
+
|
|
243
336
|
# @see Dodopayments::Models::CheckoutSessionRequest#customization
|
|
244
337
|
class Customization < Dodopayments::Internal::Type::BaseModel
|
|
245
338
|
# @!attribute force_language
|
|
@@ -7,12 +7,30 @@ module Dodopayments
|
|
|
7
7
|
extend Dodopayments::Internal::Type::RequestParameters::Converter
|
|
8
8
|
include Dodopayments::Internal::Type::RequestParameters
|
|
9
9
|
|
|
10
|
+
# @!attribute created_at_gte
|
|
11
|
+
# Filter customers created on or after this timestamp
|
|
12
|
+
#
|
|
13
|
+
# @return [Time, nil]
|
|
14
|
+
optional :created_at_gte, Time
|
|
15
|
+
|
|
16
|
+
# @!attribute created_at_lte
|
|
17
|
+
# Filter customers created on or before this timestamp
|
|
18
|
+
#
|
|
19
|
+
# @return [Time, nil]
|
|
20
|
+
optional :created_at_lte, Time
|
|
21
|
+
|
|
10
22
|
# @!attribute email
|
|
11
23
|
# Filter by customer email
|
|
12
24
|
#
|
|
13
25
|
# @return [String, nil]
|
|
14
26
|
optional :email, String
|
|
15
27
|
|
|
28
|
+
# @!attribute name
|
|
29
|
+
# Filter by customer name (partial match, case-insensitive)
|
|
30
|
+
#
|
|
31
|
+
# @return [String, nil]
|
|
32
|
+
optional :name, String
|
|
33
|
+
|
|
16
34
|
# @!attribute page_number
|
|
17
35
|
# Page number default is 0
|
|
18
36
|
#
|
|
@@ -25,9 +43,15 @@ module Dodopayments
|
|
|
25
43
|
# @return [Integer, nil]
|
|
26
44
|
optional :page_size, Integer
|
|
27
45
|
|
|
28
|
-
# @!method initialize(email: nil, page_number: nil, page_size: nil, request_options: {})
|
|
46
|
+
# @!method initialize(created_at_gte: nil, created_at_lte: nil, email: nil, name: nil, page_number: nil, page_size: nil, request_options: {})
|
|
47
|
+
# @param created_at_gte [Time] Filter customers created on or after this timestamp
|
|
48
|
+
#
|
|
49
|
+
# @param created_at_lte [Time] Filter customers created on or before this timestamp
|
|
50
|
+
#
|
|
29
51
|
# @param email [String] Filter by customer email
|
|
30
52
|
#
|
|
53
|
+
# @param name [String] Filter by customer name (partial match, case-insensitive)
|
|
54
|
+
#
|
|
31
55
|
# @param page_number [Integer] Page number default is 0
|
|
32
56
|
#
|
|
33
57
|
# @param page_size [Integer] Page size default is 10 max is 100
|