dodopayments 1.71.1 → 1.73.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 +13 -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 +9 -1
- data/lib/dodopayments/models/discount_retrieve_by_code_params.rb +14 -0
- data/lib/dodopayments/models/payment.rb +9 -1
- data/lib/dodopayments/models/payment_method_types.rb +13 -98
- data/lib/dodopayments/models/product.rb +9 -1
- data/lib/dodopayments/models/subscription_change_plan_params.rb +10 -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 +60 -1
- data/lib/dodopayments/resources/discounts.rb +22 -0
- 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 +8 -0
- data/rbi/dodopayments/models/discount_retrieve_by_code_params.rbi +32 -0
- data/rbi/dodopayments/models/payment.rbi +8 -0
- data/rbi/dodopayments/models/payment_method_types.rbi +18 -186
- data/rbi/dodopayments/models/product.rbi +11 -3
- data/rbi/dodopayments/models/subscription_change_plan_params.rbi +10 -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 +88 -0
- data/rbi/dodopayments/resources/discounts.rbi +16 -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 +5 -0
- data/sig/dodopayments/models/discount_retrieve_by_code_params.rbs +15 -0
- data/sig/dodopayments/models/payment.rbs +5 -0
- data/sig/dodopayments/models/payment_method_types.rbs +26 -196
- data/sig/dodopayments/models/product.rbs +8 -3
- data/sig/dodopayments/models/subscription_change_plan_params.rbs +6 -1
- 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 +23 -0
- data/sig/dodopayments/resources/discounts.rbs +5 -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: 206c885a380fd2eb42aaa3826ba174c9b1118055a64ad8ccd4eb92e05cf117db
|
|
4
|
+
data.tar.gz: 8371a888e8d37fc3799ab5d6cc75c7129c7a986dffd962d8ce9118568f547962
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2e94297871fda20bfada022dadc76db5a1b05be192217d38dbcfe3384a1c9807315466e5df91cd4df6af9aec640242c995759454d9325c07aa83ae9f95e0f97f
|
|
7
|
+
data.tar.gz: 3d0eb977f57a68c9ff95a7b8acd6bd902b32d3287f0cf9b91f84f446e4fea83e6793beda61c8b56fb40b90f1b7867b6fbc5b47db9ce401c7b1edb900a83f3191
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.73.0 (2026-01-20)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v1.71.1...v1.73.0](https://github.com/dodopayments/dodopayments-ruby/compare/v1.71.1...v1.73.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** update openapi spec to v1.73.0 ([24b7c76](https://github.com/dodopayments/dodopayments-ruby/commit/24b7c763b9f8845d138ca8d286bce058831e27a9))
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Chores
|
|
13
|
+
|
|
14
|
+
* **internal:** update `actions/checkout` version ([7ea17a7](https://github.com/dodopayments/dodopayments-ruby/commit/7ea17a7662be22901a344ddbe9b2b7788c08f781))
|
|
15
|
+
|
|
3
16
|
## 1.71.1 (2026-01-10)
|
|
4
17
|
|
|
5
18
|
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
|
|
@@ -90,6 +90,12 @@ module Dodopayments
|
|
|
90
90
|
# @return [String, nil]
|
|
91
91
|
optional :payment_method_id, String, nil?: true
|
|
92
92
|
|
|
93
|
+
# @!attribute product_collection_id
|
|
94
|
+
# Product collection ID for collection-based checkout flow
|
|
95
|
+
#
|
|
96
|
+
# @return [String, nil]
|
|
97
|
+
optional :product_collection_id, String, nil?: true
|
|
98
|
+
|
|
93
99
|
# @!attribute return_url
|
|
94
100
|
# The url to redirect after payment failure or success.
|
|
95
101
|
#
|
|
@@ -113,7 +119,7 @@ module Dodopayments
|
|
|
113
119
|
# @return [Dodopayments::Models::CheckoutSessionRequest::SubscriptionData, nil]
|
|
114
120
|
optional :subscription_data, -> { Dodopayments::CheckoutSessionRequest::SubscriptionData }, nil?: true
|
|
115
121
|
|
|
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)
|
|
122
|
+
# @!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, product_collection_id: nil, return_url: nil, short_link: nil, show_saved_payment_methods: nil, subscription_data: nil)
|
|
117
123
|
# Some parameter documentations has been truncated, see
|
|
118
124
|
# {Dodopayments::Models::CheckoutSessionRequest} for more details.
|
|
119
125
|
#
|
|
@@ -143,6 +149,8 @@ module Dodopayments
|
|
|
143
149
|
#
|
|
144
150
|
# @param payment_method_id [String, nil] Optional payment method ID to use for this checkout session.
|
|
145
151
|
#
|
|
152
|
+
# @param product_collection_id [String, nil] Product collection ID for collection-based checkout flow
|
|
153
|
+
#
|
|
146
154
|
# @param return_url [String, nil] The url to redirect after payment failure or success.
|
|
147
155
|
#
|
|
148
156
|
# @param short_link [Boolean] If true, returns a shortened checkout URL.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Models
|
|
5
|
+
# @see Dodopayments::Resources::Discounts#retrieve_by_code
|
|
6
|
+
class DiscountRetrieveByCodeParams < Dodopayments::Internal::Type::BaseModel
|
|
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
|
|
@@ -154,6 +154,12 @@ module Dodopayments
|
|
|
154
154
|
# @return [String, nil]
|
|
155
155
|
optional :invoice_id, String, nil?: true
|
|
156
156
|
|
|
157
|
+
# @!attribute invoice_url
|
|
158
|
+
# URL to download the invoice PDF for this payment.
|
|
159
|
+
#
|
|
160
|
+
# @return [String, nil]
|
|
161
|
+
optional :invoice_url, String, nil?: true
|
|
162
|
+
|
|
157
163
|
# @!attribute payment_link
|
|
158
164
|
# Checkout URL
|
|
159
165
|
#
|
|
@@ -212,7 +218,7 @@ module Dodopayments
|
|
|
212
218
|
# @return [Time, nil]
|
|
213
219
|
optional :updated_at, Time, nil?: true
|
|
214
220
|
|
|
215
|
-
# @!method initialize(billing:, brand_id:, business_id:, created_at:, currency:, customer:, digital_products_delivered:, disputes:, metadata:, payment_id:, refunds:, settlement_amount:, settlement_currency:, total_amount:, card_holder_name: nil, card_issuing_country: nil, card_last_four: nil, card_network: nil, card_type: nil, checkout_session_id: nil, discount_id: nil, error_code: nil, error_message: nil, invoice_id: nil, payment_link: nil, payment_method: nil, payment_method_type: nil, product_cart: nil, settlement_tax: nil, status: nil, subscription_id: nil, tax: nil, updated_at: nil)
|
|
221
|
+
# @!method initialize(billing:, brand_id:, business_id:, created_at:, currency:, customer:, digital_products_delivered:, disputes:, metadata:, payment_id:, refunds:, settlement_amount:, settlement_currency:, total_amount:, card_holder_name: nil, card_issuing_country: nil, card_last_four: nil, card_network: nil, card_type: nil, checkout_session_id: nil, discount_id: nil, error_code: nil, error_message: nil, invoice_id: nil, invoice_url: nil, payment_link: nil, payment_method: nil, payment_method_type: nil, product_cart: nil, settlement_tax: nil, status: nil, subscription_id: nil, tax: nil, updated_at: nil)
|
|
216
222
|
# Some parameter documentations has been truncated, see
|
|
217
223
|
# {Dodopayments::Models::Payment} for more details.
|
|
218
224
|
#
|
|
@@ -264,6 +270,8 @@ module Dodopayments
|
|
|
264
270
|
#
|
|
265
271
|
# @param invoice_id [String, nil] Invoice ID for this payment. Uses India-specific invoice ID if available.
|
|
266
272
|
#
|
|
273
|
+
# @param invoice_url [String, nil] URL to download the invoice PDF for this payment.
|
|
274
|
+
#
|
|
267
275
|
# @param payment_link [String, nil] Checkout URL
|
|
268
276
|
#
|
|
269
277
|
# @param payment_method [String, nil] Payment method used by customer (e.g. "card", "bank_transfer")
|
|
@@ -5,110 +5,25 @@ module Dodopayments
|
|
|
5
5
|
module PaymentMethodTypes
|
|
6
6
|
extend Dodopayments::Internal::Type::Enum
|
|
7
7
|
|
|
8
|
-
ACH = :ach
|
|
9
|
-
AFFIRM = :affirm
|
|
10
|
-
AFTERPAY_CLEARPAY = :afterpay_clearpay
|
|
11
|
-
ALFAMART = :alfamart
|
|
12
|
-
ALI_PAY = :ali_pay
|
|
13
|
-
ALI_PAY_HK = :ali_pay_hk
|
|
14
|
-
ALMA = :alma
|
|
15
|
-
AMAZON_PAY = :amazon_pay
|
|
16
|
-
APPLE_PAY = :apple_pay
|
|
17
|
-
ATOME = :atome
|
|
18
|
-
BACS = :bacs
|
|
19
|
-
BANCONTACT_CARD = :bancontact_card
|
|
20
|
-
BECS = :becs
|
|
21
|
-
BENEFIT = :benefit
|
|
22
|
-
BIZUM = :bizum
|
|
23
|
-
BLIK = :blik
|
|
24
|
-
BOLETO = :boleto
|
|
25
|
-
BCA_BANK_TRANSFER = :bca_bank_transfer
|
|
26
|
-
BNI_VA = :bni_va
|
|
27
|
-
BRI_VA = :bri_va
|
|
28
|
-
CARD_REDIRECT = :card_redirect
|
|
29
|
-
CIMB_VA = :cimb_va
|
|
30
|
-
CLASSIC = :classic
|
|
31
8
|
CREDIT = :credit
|
|
32
|
-
CRYPTO_CURRENCY = :crypto_currency
|
|
33
|
-
CASHAPP = :cashapp
|
|
34
|
-
DANA = :dana
|
|
35
|
-
DANAMON_VA = :danamon_va
|
|
36
9
|
DEBIT = :debit
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
FPS = :fps
|
|
42
|
-
EVOUCHER = :evoucher
|
|
43
|
-
GIROPAY = :giropay
|
|
44
|
-
GIVEX = :givex
|
|
10
|
+
UPI_COLLECT = :upi_collect
|
|
11
|
+
UPI_INTENT = :upi_intent
|
|
12
|
+
APPLE_PAY = :apple_pay
|
|
13
|
+
CASHAPP = :cashapp
|
|
45
14
|
GOOGLE_PAY = :google_pay
|
|
46
|
-
GO_PAY = :go_pay
|
|
47
|
-
GCASH = :gcash
|
|
48
|
-
IDEAL = :ideal
|
|
49
|
-
INTERAC = :interac
|
|
50
|
-
INDOMARET = :indomaret
|
|
51
|
-
KLARNA = :klarna
|
|
52
|
-
KAKAO_PAY = :kakao_pay
|
|
53
|
-
LOCAL_BANK_REDIRECT = :local_bank_redirect
|
|
54
|
-
MANDIRI_VA = :mandiri_va
|
|
55
|
-
KNET = :knet
|
|
56
|
-
MB_WAY = :mb_way
|
|
57
|
-
MOBILE_PAY = :mobile_pay
|
|
58
|
-
MOMO = :momo
|
|
59
|
-
MOMO_ATM = :momo_atm
|
|
60
15
|
MULTIBANCO = :multibanco
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
ONLINE_BANKING_FPX = :online_banking_fpx
|
|
65
|
-
ONLINE_BANKING_POLAND = :online_banking_poland
|
|
66
|
-
ONLINE_BANKING_SLOVAKIA = :online_banking_slovakia
|
|
67
|
-
OXXO = :oxxo
|
|
68
|
-
PAGO_EFECTIVO = :pago_efectivo
|
|
69
|
-
PERMATA_BANK_TRANSFER = :permata_bank_transfer
|
|
70
|
-
OPEN_BANKING_UK = :open_banking_uk
|
|
71
|
-
PAY_BRIGHT = :pay_bright
|
|
72
|
-
PAYPAL = :paypal
|
|
73
|
-
PAZE = :paze
|
|
74
|
-
PIX = :pix
|
|
75
|
-
PAY_SAFE_CARD = :pay_safe_card
|
|
16
|
+
BANCONTACT_CARD = :bancontact_card
|
|
17
|
+
EPS = :eps
|
|
18
|
+
IDEAL = :ideal
|
|
76
19
|
PRZELEWY24 = :przelewy24
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
RED_PAGOS = :red_pagos
|
|
81
|
-
SAMSUNG_PAY = :samsung_pay
|
|
20
|
+
PAYPAL = :paypal
|
|
21
|
+
AFFIRM = :affirm
|
|
22
|
+
KLARNA = :klarna
|
|
82
23
|
SEPA = :sepa
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
TOUCH_N_GO = :touch_n_go
|
|
87
|
-
TRUSTLY = :trustly
|
|
88
|
-
TWINT = :twint
|
|
89
|
-
UPI_COLLECT = :upi_collect
|
|
90
|
-
UPI_INTENT = :upi_intent
|
|
91
|
-
VIPPS = :vipps
|
|
92
|
-
VIET_QR = :viet_qr
|
|
93
|
-
VENMO = :venmo
|
|
94
|
-
WALLEY = :walley
|
|
95
|
-
WE_CHAT_PAY = :we_chat_pay
|
|
96
|
-
SEVEN_ELEVEN = :seven_eleven
|
|
97
|
-
LAWSON = :lawson
|
|
98
|
-
MINI_STOP = :mini_stop
|
|
99
|
-
FAMILY_MART = :family_mart
|
|
100
|
-
SEICOMART = :seicomart
|
|
101
|
-
PAY_EASY = :pay_easy
|
|
102
|
-
LOCAL_BANK_TRANSFER = :local_bank_transfer
|
|
103
|
-
MIFINITY = :mifinity
|
|
104
|
-
OPEN_BANKING_PIS = :open_banking_pis
|
|
105
|
-
DIRECT_CARRIER_BILLING = :direct_carrier_billing
|
|
106
|
-
INSTANT_BANK_TRANSFER = :instant_bank_transfer
|
|
107
|
-
BILLIE = :billie
|
|
108
|
-
ZIP = :zip
|
|
109
|
-
REVOLUT_PAY = :revolut_pay
|
|
110
|
-
NAVER_PAY = :naver_pay
|
|
111
|
-
PAYCO = :payco
|
|
24
|
+
ACH = :ach
|
|
25
|
+
AMAZON_PAY = :amazon_pay
|
|
26
|
+
AFTERPAY_CLEARPAY = :afterpay_clearpay
|
|
112
27
|
|
|
113
28
|
# @!method self.values
|
|
114
29
|
# @return [Array<Symbol>]
|