dodopayments 2.2.0 → 2.3.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 +17 -0
- data/README.md +3 -3
- data/lib/dodopayments/client.rb +8 -0
- data/lib/dodopayments/models/checkout_session_customization.rb +4 -4
- data/lib/dodopayments/models/checkout_session_request.rb +10 -1
- data/lib/dodopayments/models/customer_retrieve_payment_methods_response.rb +13 -1
- data/lib/dodopayments/models/customers/customer_portal_create_params.rb +13 -1
- data/lib/dodopayments/models/invoices/payment_retrieve_payout_params.rb +22 -0
- data/lib/dodopayments/models/payment_method_types.rb +3 -0
- data/lib/dodopayments/models/product_collection_create_params.rb +98 -0
- data/lib/dodopayments/models/product_collection_create_response.rb +226 -0
- data/lib/dodopayments/models/product_collection_delete_params.rb +20 -0
- data/lib/dodopayments/models/product_collection_list_params.rb +46 -0
- data/lib/dodopayments/models/product_collection_list_response.rb +65 -0
- data/lib/dodopayments/models/product_collection_retrieve_params.rb +20 -0
- data/lib/dodopayments/models/product_collection_retrieve_response.rb +226 -0
- data/lib/dodopayments/models/product_collection_unarchive_params.rb +20 -0
- data/lib/dodopayments/models/product_collection_unarchive_response.rb +33 -0
- data/lib/dodopayments/models/product_collection_update_images_params.rb +29 -0
- data/lib/dodopayments/models/product_collection_update_images_response.rb +25 -0
- data/lib/dodopayments/models/product_collection_update_params.rb +61 -0
- data/lib/dodopayments/models/product_collections/group_create_params.rb +71 -0
- data/lib/dodopayments/models/product_collections/group_create_response.rb +160 -0
- data/lib/dodopayments/models/product_collections/group_delete_params.rb +28 -0
- data/lib/dodopayments/models/product_collections/group_update_params.rb +59 -0
- data/lib/dodopayments/models/product_collections/groups/item_create_params.rb +60 -0
- data/lib/dodopayments/models/product_collections/groups/item_create_response.rb +136 -0
- data/lib/dodopayments/models/product_collections/groups/item_delete_params.rb +36 -0
- data/lib/dodopayments/models/product_collections/groups/item_update_params.rb +47 -0
- data/lib/dodopayments/models/subscription.rb +107 -1
- data/lib/dodopayments/models/subscription_cancel_change_plan_params.rb +20 -0
- data/lib/dodopayments/models/subscription_list_response.rb +109 -1
- data/lib/dodopayments/models/subscription_preview_change_plan_response.rb +10 -1
- data/lib/dodopayments/models/update_subscription_plan_req.rb +29 -1
- data/lib/dodopayments/models/your_webhook_url_create_params.rb +32 -0
- data/lib/dodopayments/models.rb +20 -0
- data/lib/dodopayments/resources/checkout_sessions.rb +6 -2
- data/lib/dodopayments/resources/customers/customer_portal.rb +6 -1
- data/lib/dodopayments/resources/invoices/payments.rb +18 -0
- data/lib/dodopayments/resources/product_collections/groups/items.rb +111 -0
- data/lib/dodopayments/resources/product_collections/groups.rb +109 -0
- data/lib/dodopayments/resources/product_collections.rb +179 -0
- data/lib/dodopayments/resources/subscriptions.rb +24 -2
- data/lib/dodopayments/resources/your_webhook_url.rb +56 -0
- data/lib/dodopayments/version.rb +1 -1
- data/lib/dodopayments.rb +30 -3
- data/rbi/dodopayments/client.rbi +6 -0
- data/rbi/dodopayments/models/checkout_session_customization.rbi +12 -13
- data/rbi/dodopayments/models/checkout_session_request.rbi +10 -0
- data/rbi/dodopayments/models/credit_entitlement_cart_response.rbi +4 -4
- data/rbi/dodopayments/models/credit_entitlements/credit_ledger_entry.rbi +2 -2
- data/rbi/dodopayments/models/customer_retrieve_payment_methods_response.rbi +6 -0
- data/rbi/dodopayments/models/customers/customer_portal_create_params.rbi +13 -0
- data/rbi/dodopayments/models/dispute.rbi +4 -4
- data/rbi/dodopayments/models/get_dispute.rbi +4 -4
- data/rbi/dodopayments/models/invoices/payment_retrieve_payout_params.rbi +40 -0
- data/rbi/dodopayments/models/license_key.rbi +2 -2
- data/rbi/dodopayments/models/meter_cart_response_item.rbi +2 -2
- data/rbi/dodopayments/models/payment.rbi +10 -12
- data/rbi/dodopayments/models/payment_method_types.rbi +3 -0
- data/rbi/dodopayments/models/product_collection_create_params.rbi +180 -0
- data/rbi/dodopayments/models/product_collection_create_response.rbi +303 -0
- data/rbi/dodopayments/models/product_collection_delete_params.rbi +38 -0
- data/rbi/dodopayments/models/product_collection_list_params.rbi +82 -0
- data/rbi/dodopayments/models/product_collection_list_response.rbi +88 -0
- data/rbi/dodopayments/models/product_collection_retrieve_params.rbi +38 -0
- data/rbi/dodopayments/models/product_collection_retrieve_response.rbi +305 -0
- data/rbi/dodopayments/models/product_collection_unarchive_params.rbi +38 -0
- data/rbi/dodopayments/models/product_collection_unarchive_response.rbi +56 -0
- data/rbi/dodopayments/models/product_collection_update_images_params.rbi +52 -0
- data/rbi/dodopayments/models/product_collection_update_images_response.rbi +40 -0
- data/rbi/dodopayments/models/product_collection_update_params.rbi +84 -0
- data/rbi/dodopayments/models/product_collections/group_create_params.rbi +123 -0
- data/rbi/dodopayments/models/product_collections/group_create_response.rbi +204 -0
- data/rbi/dodopayments/models/product_collections/group_delete_params.rbi +48 -0
- data/rbi/dodopayments/models/product_collections/group_update_params.rbi +80 -0
- data/rbi/dodopayments/models/product_collections/groups/item_create_params.rbi +113 -0
- data/rbi/dodopayments/models/product_collections/groups/item_create_response.rbi +156 -0
- data/rbi/dodopayments/models/product_collections/groups/item_delete_params.rbi +55 -0
- data/rbi/dodopayments/models/product_collections/groups/item_update_params.rbi +68 -0
- data/rbi/dodopayments/models/refund.rbi +4 -4
- data/rbi/dodopayments/models/refund_list_item.rbi +4 -4
- data/rbi/dodopayments/models/subscription.rbi +169 -10
- data/rbi/dodopayments/models/subscription_cancel_change_plan_params.rbi +41 -0
- data/rbi/dodopayments/models/subscription_list_response.rbi +179 -0
- data/rbi/dodopayments/models/subscription_preview_change_plan_response.rbi +12 -1
- data/rbi/dodopayments/models/update_subscription_plan_req.rbi +70 -0
- data/rbi/dodopayments/models/your_webhook_url_create_params.rbi +56 -0
- data/rbi/dodopayments/models.rbi +28 -0
- data/rbi/dodopayments/resources/checkout_sessions.rbi +8 -0
- data/rbi/dodopayments/resources/customers/customer_portal.rbi +4 -0
- data/rbi/dodopayments/resources/invoices/payments.rbi +9 -0
- data/rbi/dodopayments/resources/product_collections/groups/items.rbi +83 -0
- data/rbi/dodopayments/resources/product_collections/groups.rbi +90 -0
- data/rbi/dodopayments/resources/product_collections.rbi +149 -0
- data/rbi/dodopayments/resources/subscriptions.rbi +27 -0
- data/rbi/dodopayments/resources/your_webhook_url.rbi +53 -0
- data/sig/dodopayments/client.rbs +4 -0
- data/sig/dodopayments/models/checkout_session_customization.rbs +4 -8
- data/sig/dodopayments/models/checkout_session_request.rbs +5 -0
- data/sig/dodopayments/models/customers/customer_portal_create_params.rbs +7 -1
- data/sig/dodopayments/models/invoices/payment_retrieve_payout_params.rbs +25 -0
- data/sig/dodopayments/models/product_collection_create_params.rbs +80 -0
- data/sig/dodopayments/models/product_collection_create_response.rbs +179 -0
- data/sig/dodopayments/models/product_collection_delete_params.rbs +23 -0
- data/sig/dodopayments/models/product_collection_list_params.rbs +49 -0
- data/sig/dodopayments/models/product_collection_list_response.rbs +50 -0
- data/sig/dodopayments/models/product_collection_retrieve_params.rbs +23 -0
- data/sig/dodopayments/models/product_collection_retrieve_response.rbs +179 -0
- data/sig/dodopayments/models/product_collection_unarchive_params.rbs +23 -0
- data/sig/dodopayments/models/product_collection_unarchive_response.rbs +30 -0
- data/sig/dodopayments/models/product_collection_update_images_params.rbs +28 -0
- data/sig/dodopayments/models/product_collection_update_images_response.rbs +16 -0
- data/sig/dodopayments/models/product_collection_update_params.rbs +51 -0
- data/sig/dodopayments/models/product_collections/group_create_params.rbs +55 -0
- data/sig/dodopayments/models/product_collections/group_create_response.rbs +129 -0
- data/sig/dodopayments/models/product_collections/group_delete_params.rbs +30 -0
- data/sig/dodopayments/models/product_collections/group_update_params.rbs +48 -0
- data/sig/dodopayments/models/product_collections/groups/item_create_params.rbs +52 -0
- data/sig/dodopayments/models/product_collections/groups/item_create_response.rbs +104 -0
- data/sig/dodopayments/models/product_collections/groups/item_delete_params.rbs +36 -0
- data/sig/dodopayments/models/product_collections/groups/item_update_params.rbs +40 -0
- data/sig/dodopayments/models/subscription.rbs +75 -0
- data/sig/dodopayments/models/subscription_cancel_change_plan_params.rbs +24 -0
- data/sig/dodopayments/models/subscription_list_response.rbs +75 -0
- data/sig/dodopayments/models/subscription_preview_change_plan_response.rbs +5 -0
- data/sig/dodopayments/models/update_subscription_plan_req.rbs +25 -1
- data/sig/dodopayments/models/your_webhook_url_create_params.rbs +42 -0
- data/sig/dodopayments/models.rbs +20 -0
- data/sig/dodopayments/resources/checkout_sessions.rbs +2 -0
- data/sig/dodopayments/resources/customers/customer_portal.rbs +1 -0
- data/sig/dodopayments/resources/invoices/payments.rbs +5 -0
- data/sig/dodopayments/resources/product_collections/groups/items.rbs +33 -0
- data/sig/dodopayments/resources/product_collections/groups.rbs +34 -0
- data/sig/dodopayments/resources/product_collections.rbs +56 -0
- data/sig/dodopayments/resources/subscriptions.rbs +7 -0
- data/sig/dodopayments/resources/your_webhook_url.rbs +18 -0
- metadata +83 -2
|
@@ -156,13 +156,21 @@ module Dodopayments
|
|
|
156
156
|
# @return [String, nil]
|
|
157
157
|
optional :product_name, String, nil?: true
|
|
158
158
|
|
|
159
|
+
# @!attribute scheduled_change
|
|
160
|
+
# Scheduled plan change details, if any
|
|
161
|
+
#
|
|
162
|
+
# @return [Dodopayments::Models::SubscriptionListResponse::ScheduledChange, nil]
|
|
163
|
+
optional :scheduled_change,
|
|
164
|
+
-> { Dodopayments::Models::SubscriptionListResponse::ScheduledChange },
|
|
165
|
+
nil?: true
|
|
166
|
+
|
|
159
167
|
# @!attribute tax_id
|
|
160
168
|
# Tax identifier provided for this subscription (if applicable)
|
|
161
169
|
#
|
|
162
170
|
# @return [String, nil]
|
|
163
171
|
optional :tax_id, String, nil?: true
|
|
164
172
|
|
|
165
|
-
# @!method initialize(billing:, cancel_at_next_billing_date:, created_at:, currency:, customer:, metadata:, next_billing_date:, on_demand:, payment_frequency_count:, payment_frequency_interval:, previous_billing_date:, product_id:, quantity:, recurring_pre_tax_amount:, status:, subscription_id:, subscription_period_count:, subscription_period_interval:, tax_inclusive:, trial_period_days:, cancelled_at: nil, discount_cycles_remaining: nil, discount_id: nil, payment_method_id: nil, product_name: nil, tax_id: nil)
|
|
173
|
+
# @!method initialize(billing:, cancel_at_next_billing_date:, created_at:, currency:, customer:, metadata:, next_billing_date:, on_demand:, payment_frequency_count:, payment_frequency_interval:, previous_billing_date:, product_id:, quantity:, recurring_pre_tax_amount:, status:, subscription_id:, subscription_period_count:, subscription_period_interval:, tax_inclusive:, trial_period_days:, cancelled_at: nil, discount_cycles_remaining: nil, discount_id: nil, payment_method_id: nil, product_name: nil, scheduled_change: nil, tax_id: nil)
|
|
166
174
|
# Some parameter documentations has been truncated, see
|
|
167
175
|
# {Dodopayments::Models::SubscriptionListResponse} for more details.
|
|
168
176
|
#
|
|
@@ -218,7 +226,107 @@ module Dodopayments
|
|
|
218
226
|
#
|
|
219
227
|
# @param product_name [String, nil] Name of the product associated with this subscription
|
|
220
228
|
#
|
|
229
|
+
# @param scheduled_change [Dodopayments::Models::SubscriptionListResponse::ScheduledChange, nil] Scheduled plan change details, if any
|
|
230
|
+
#
|
|
221
231
|
# @param tax_id [String, nil] Tax identifier provided for this subscription (if applicable)
|
|
232
|
+
|
|
233
|
+
# @see Dodopayments::Models::SubscriptionListResponse#scheduled_change
|
|
234
|
+
class ScheduledChange < Dodopayments::Internal::Type::BaseModel
|
|
235
|
+
# @!attribute id
|
|
236
|
+
# The scheduled plan change ID
|
|
237
|
+
#
|
|
238
|
+
# @return [String]
|
|
239
|
+
required :id, String
|
|
240
|
+
|
|
241
|
+
# @!attribute addons
|
|
242
|
+
# Addons included in the scheduled change
|
|
243
|
+
#
|
|
244
|
+
# @return [Array<Dodopayments::Models::SubscriptionListResponse::ScheduledChange::Addon>]
|
|
245
|
+
required :addons,
|
|
246
|
+
-> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::Models::SubscriptionListResponse::ScheduledChange::Addon] }
|
|
247
|
+
|
|
248
|
+
# @!attribute created_at
|
|
249
|
+
# When this scheduled change was created
|
|
250
|
+
#
|
|
251
|
+
# @return [Time]
|
|
252
|
+
required :created_at, Time
|
|
253
|
+
|
|
254
|
+
# @!attribute effective_at
|
|
255
|
+
# When the change will be applied
|
|
256
|
+
#
|
|
257
|
+
# @return [Time]
|
|
258
|
+
required :effective_at, Time
|
|
259
|
+
|
|
260
|
+
# @!attribute product_id
|
|
261
|
+
# The product ID the subscription will change to
|
|
262
|
+
#
|
|
263
|
+
# @return [String]
|
|
264
|
+
required :product_id, String
|
|
265
|
+
|
|
266
|
+
# @!attribute quantity
|
|
267
|
+
# Quantity for the new plan
|
|
268
|
+
#
|
|
269
|
+
# @return [Integer]
|
|
270
|
+
required :quantity, Integer
|
|
271
|
+
|
|
272
|
+
# @!attribute product_description
|
|
273
|
+
# Description of the product being changed to
|
|
274
|
+
#
|
|
275
|
+
# @return [String, nil]
|
|
276
|
+
optional :product_description, String, nil?: true
|
|
277
|
+
|
|
278
|
+
# @!attribute product_name
|
|
279
|
+
# Name of the product being changed to
|
|
280
|
+
#
|
|
281
|
+
# @return [String, nil]
|
|
282
|
+
optional :product_name, String, nil?: true
|
|
283
|
+
|
|
284
|
+
# @!method initialize(id:, addons:, created_at:, effective_at:, product_id:, quantity:, product_description: nil, product_name: nil)
|
|
285
|
+
# Scheduled plan change details, if any
|
|
286
|
+
#
|
|
287
|
+
# @param id [String] The scheduled plan change ID
|
|
288
|
+
#
|
|
289
|
+
# @param addons [Array<Dodopayments::Models::SubscriptionListResponse::ScheduledChange::Addon>] Addons included in the scheduled change
|
|
290
|
+
#
|
|
291
|
+
# @param created_at [Time] When this scheduled change was created
|
|
292
|
+
#
|
|
293
|
+
# @param effective_at [Time] When the change will be applied
|
|
294
|
+
#
|
|
295
|
+
# @param product_id [String] The product ID the subscription will change to
|
|
296
|
+
#
|
|
297
|
+
# @param quantity [Integer] Quantity for the new plan
|
|
298
|
+
#
|
|
299
|
+
# @param product_description [String, nil] Description of the product being changed to
|
|
300
|
+
#
|
|
301
|
+
# @param product_name [String, nil] Name of the product being changed to
|
|
302
|
+
|
|
303
|
+
class Addon < Dodopayments::Internal::Type::BaseModel
|
|
304
|
+
# @!attribute addon_id
|
|
305
|
+
# The addon ID
|
|
306
|
+
#
|
|
307
|
+
# @return [String]
|
|
308
|
+
required :addon_id, String
|
|
309
|
+
|
|
310
|
+
# @!attribute name
|
|
311
|
+
# Name of the addon
|
|
312
|
+
#
|
|
313
|
+
# @return [String]
|
|
314
|
+
required :name, String
|
|
315
|
+
|
|
316
|
+
# @!attribute quantity
|
|
317
|
+
# Quantity of the addon
|
|
318
|
+
#
|
|
319
|
+
# @return [Integer]
|
|
320
|
+
required :quantity, Integer
|
|
321
|
+
|
|
322
|
+
# @!method initialize(addon_id:, name:, quantity:)
|
|
323
|
+
# @param addon_id [String] The addon ID
|
|
324
|
+
#
|
|
325
|
+
# @param name [String] Name of the addon
|
|
326
|
+
#
|
|
327
|
+
# @param quantity [Integer] Quantity of the addon
|
|
328
|
+
end
|
|
329
|
+
end
|
|
222
330
|
end
|
|
223
331
|
end
|
|
224
332
|
end
|
|
@@ -23,6 +23,12 @@ module Dodopayments
|
|
|
23
23
|
|
|
24
24
|
# @see Dodopayments::Models::SubscriptionPreviewChangePlanResponse#immediate_charge
|
|
25
25
|
class ImmediateCharge < Dodopayments::Internal::Type::BaseModel
|
|
26
|
+
# @!attribute effective_at
|
|
27
|
+
# When the plan change will be effective
|
|
28
|
+
#
|
|
29
|
+
# @return [Time]
|
|
30
|
+
required :effective_at, Time
|
|
31
|
+
|
|
26
32
|
# @!attribute line_items
|
|
27
33
|
#
|
|
28
34
|
# @return [Array<Dodopayments::Models::SubscriptionPreviewChangePlanResponse::ImmediateCharge::LineItem::Subscription, Dodopayments::Models::SubscriptionPreviewChangePlanResponse::ImmediateCharge::LineItem::Addon, Dodopayments::Models::SubscriptionPreviewChangePlanResponse::ImmediateCharge::LineItem::Meter>]
|
|
@@ -35,8 +41,11 @@ module Dodopayments
|
|
|
35
41
|
required :summary,
|
|
36
42
|
-> { Dodopayments::Models::SubscriptionPreviewChangePlanResponse::ImmediateCharge::Summary }
|
|
37
43
|
|
|
38
|
-
# @!method initialize(line_items:, summary:)
|
|
44
|
+
# @!method initialize(effective_at:, line_items:, summary:)
|
|
45
|
+
# @param effective_at [Time] When the plan change will be effective
|
|
46
|
+
#
|
|
39
47
|
# @param line_items [Array<Dodopayments::Models::SubscriptionPreviewChangePlanResponse::ImmediateCharge::LineItem::Subscription, Dodopayments::Models::SubscriptionPreviewChangePlanResponse::ImmediateCharge::LineItem::Addon, Dodopayments::Models::SubscriptionPreviewChangePlanResponse::ImmediateCharge::LineItem::Meter>]
|
|
48
|
+
#
|
|
40
49
|
# @param summary [Dodopayments::Models::SubscriptionPreviewChangePlanResponse::ImmediateCharge::Summary]
|
|
41
50
|
|
|
42
51
|
module LineItem
|
|
@@ -38,6 +38,15 @@ module Dodopayments
|
|
|
38
38
|
# @return [String, nil]
|
|
39
39
|
optional :discount_code, String, nil?: true
|
|
40
40
|
|
|
41
|
+
# @!attribute effective_at
|
|
42
|
+
# When to apply the plan change.
|
|
43
|
+
#
|
|
44
|
+
# - `immediately` (default): Apply the plan change right away
|
|
45
|
+
# - `next_billing_date`: Schedule the change for the next billing date
|
|
46
|
+
#
|
|
47
|
+
# @return [Symbol, Dodopayments::Models::UpdateSubscriptionPlanReq::EffectiveAt, nil]
|
|
48
|
+
optional :effective_at, enum: -> { Dodopayments::UpdateSubscriptionPlanReq::EffectiveAt }
|
|
49
|
+
|
|
41
50
|
# @!attribute metadata
|
|
42
51
|
# Metadata for the payment. If not passed, the metadata of the subscription will
|
|
43
52
|
# be taken
|
|
@@ -59,7 +68,7 @@ module Dodopayments
|
|
|
59
68
|
enum: -> { Dodopayments::UpdateSubscriptionPlanReq::OnPaymentFailure },
|
|
60
69
|
nil?: true
|
|
61
70
|
|
|
62
|
-
# @!method initialize(product_id:, proration_billing_mode:, quantity:, addons: nil, discount_code: nil, metadata: nil, on_payment_failure: nil)
|
|
71
|
+
# @!method initialize(product_id:, proration_billing_mode:, quantity:, addons: nil, discount_code: nil, effective_at: nil, metadata: nil, on_payment_failure: nil)
|
|
63
72
|
# Some parameter documentations has been truncated, see
|
|
64
73
|
# {Dodopayments::Models::UpdateSubscriptionPlanReq} for more details.
|
|
65
74
|
#
|
|
@@ -73,6 +82,8 @@ module Dodopayments
|
|
|
73
82
|
#
|
|
74
83
|
# @param discount_code [String, nil] Optional discount code to apply to the new plan.
|
|
75
84
|
#
|
|
85
|
+
# @param effective_at [Symbol, Dodopayments::Models::UpdateSubscriptionPlanReq::EffectiveAt] When to apply the plan change.
|
|
86
|
+
#
|
|
76
87
|
# @param metadata [Hash{Symbol=>String}, nil] Metadata for the payment. If not passed, the metadata of the subscription will b
|
|
77
88
|
#
|
|
78
89
|
# @param on_payment_failure [Symbol, Dodopayments::Models::UpdateSubscriptionPlanReq::OnPaymentFailure, nil] Controls behavior when the plan change payment fails.
|
|
@@ -86,6 +97,23 @@ module Dodopayments
|
|
|
86
97
|
PRORATED_IMMEDIATELY = :prorated_immediately
|
|
87
98
|
FULL_IMMEDIATELY = :full_immediately
|
|
88
99
|
DIFFERENCE_IMMEDIATELY = :difference_immediately
|
|
100
|
+
DO_NOT_BILL = :do_not_bill
|
|
101
|
+
|
|
102
|
+
# @!method self.values
|
|
103
|
+
# @return [Array<Symbol>]
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# When to apply the plan change.
|
|
107
|
+
#
|
|
108
|
+
# - `immediately` (default): Apply the plan change right away
|
|
109
|
+
# - `next_billing_date`: Schedule the change for the next billing date
|
|
110
|
+
#
|
|
111
|
+
# @see Dodopayments::Models::UpdateSubscriptionPlanReq#effective_at
|
|
112
|
+
module EffectiveAt
|
|
113
|
+
extend Dodopayments::Internal::Type::Enum
|
|
114
|
+
|
|
115
|
+
IMMEDIATELY = :immediately
|
|
116
|
+
NEXT_BILLING_DATE = :next_billing_date
|
|
89
117
|
|
|
90
118
|
# @!method self.values
|
|
91
119
|
# @return [Array<Symbol>]
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Models
|
|
5
|
+
# @see Dodopayments::Resources::YourWebhookURL#create
|
|
6
|
+
class YourWebhookURLCreateParams < Dodopayments::Models::WebhookPayload
|
|
7
|
+
extend Dodopayments::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include Dodopayments::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
# @!attribute webhook_id
|
|
11
|
+
#
|
|
12
|
+
# @return [String]
|
|
13
|
+
required :webhook_id, String
|
|
14
|
+
|
|
15
|
+
# @!attribute webhook_signature
|
|
16
|
+
#
|
|
17
|
+
# @return [String]
|
|
18
|
+
required :webhook_signature, String
|
|
19
|
+
|
|
20
|
+
# @!attribute webhook_timestamp
|
|
21
|
+
#
|
|
22
|
+
# @return [String]
|
|
23
|
+
required :webhook_timestamp, String
|
|
24
|
+
|
|
25
|
+
# @!method initialize(webhook_id:, webhook_signature:, webhook_timestamp:, request_options: {})
|
|
26
|
+
# @param webhook_id [String]
|
|
27
|
+
# @param webhook_signature [String]
|
|
28
|
+
# @param webhook_timestamp [String]
|
|
29
|
+
# @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
data/lib/dodopayments/models.rb
CHANGED
|
@@ -313,6 +313,22 @@ module Dodopayments
|
|
|
313
313
|
|
|
314
314
|
ProductArchiveParams = Dodopayments::Models::ProductArchiveParams
|
|
315
315
|
|
|
316
|
+
ProductCollectionCreateParams = Dodopayments::Models::ProductCollectionCreateParams
|
|
317
|
+
|
|
318
|
+
ProductCollectionDeleteParams = Dodopayments::Models::ProductCollectionDeleteParams
|
|
319
|
+
|
|
320
|
+
ProductCollectionListParams = Dodopayments::Models::ProductCollectionListParams
|
|
321
|
+
|
|
322
|
+
ProductCollectionRetrieveParams = Dodopayments::Models::ProductCollectionRetrieveParams
|
|
323
|
+
|
|
324
|
+
ProductCollections = Dodopayments::Models::ProductCollections
|
|
325
|
+
|
|
326
|
+
ProductCollectionUnarchiveParams = Dodopayments::Models::ProductCollectionUnarchiveParams
|
|
327
|
+
|
|
328
|
+
ProductCollectionUpdateImagesParams = Dodopayments::Models::ProductCollectionUpdateImagesParams
|
|
329
|
+
|
|
330
|
+
ProductCollectionUpdateParams = Dodopayments::Models::ProductCollectionUpdateParams
|
|
331
|
+
|
|
316
332
|
ProductCreateParams = Dodopayments::Models::ProductCreateParams
|
|
317
333
|
|
|
318
334
|
ProductItemReq = Dodopayments::Models::ProductItemReq
|
|
@@ -349,6 +365,8 @@ module Dodopayments
|
|
|
349
365
|
|
|
350
366
|
SubscriptionActiveWebhookEvent = Dodopayments::Models::SubscriptionActiveWebhookEvent
|
|
351
367
|
|
|
368
|
+
SubscriptionCancelChangePlanParams = Dodopayments::Models::SubscriptionCancelChangePlanParams
|
|
369
|
+
|
|
352
370
|
SubscriptionCancelledWebhookEvent = Dodopayments::Models::SubscriptionCancelledWebhookEvent
|
|
353
371
|
|
|
354
372
|
SubscriptionChangePlanParams = Dodopayments::Models::SubscriptionChangePlanParams
|
|
@@ -430,4 +448,6 @@ module Dodopayments
|
|
|
430
448
|
WebhookUnwrapParams = Dodopayments::Models::WebhookUnwrapParams
|
|
431
449
|
|
|
432
450
|
WebhookUpdateParams = Dodopayments::Models::WebhookUpdateParams
|
|
451
|
+
|
|
452
|
+
YourWebhookURLCreateParams = Dodopayments::Models::YourWebhookURLCreateParams
|
|
433
453
|
end
|
|
@@ -6,7 +6,7 @@ module Dodopayments
|
|
|
6
6
|
# Some parameter documentations has been truncated, see
|
|
7
7
|
# {Dodopayments::Models::CheckoutSessionCreateParams} for more details.
|
|
8
8
|
#
|
|
9
|
-
# @overload create(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, tax_id: nil, request_options: {})
|
|
9
|
+
# @overload create(product_cart:, allowed_payment_method_types: nil, billing_address: nil, billing_currency: nil, cancel_url: 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, tax_id: nil, request_options: {})
|
|
10
10
|
#
|
|
11
11
|
# @param product_cart [Array<Dodopayments::Models::ProductItemReq>]
|
|
12
12
|
#
|
|
@@ -16,6 +16,8 @@ module Dodopayments
|
|
|
16
16
|
#
|
|
17
17
|
# @param billing_currency [Symbol, Dodopayments::Models::Currency, nil] This field is ingored if adaptive pricing is disabled
|
|
18
18
|
#
|
|
19
|
+
# @param cancel_url [String, nil] The URL to redirect the customer if they cancel or go back from the checkout.
|
|
20
|
+
#
|
|
19
21
|
# @param confirm [Boolean] If confirm is true, all the details will be finalized. If required data is missi
|
|
20
22
|
#
|
|
21
23
|
# @param custom_fields [Array<Dodopayments::Models::CustomField>, nil] Custom fields to collect from customer during checkout (max 5 fields)
|
|
@@ -84,7 +86,7 @@ module Dodopayments
|
|
|
84
86
|
# Some parameter documentations has been truncated, see
|
|
85
87
|
# {Dodopayments::Models::CheckoutSessionPreviewParams} for more details.
|
|
86
88
|
#
|
|
87
|
-
# @overload preview(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, tax_id: nil, request_options: {})
|
|
89
|
+
# @overload preview(product_cart:, allowed_payment_method_types: nil, billing_address: nil, billing_currency: nil, cancel_url: 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, tax_id: nil, request_options: {})
|
|
88
90
|
#
|
|
89
91
|
# @param product_cart [Array<Dodopayments::Models::ProductItemReq>]
|
|
90
92
|
#
|
|
@@ -94,6 +96,8 @@ module Dodopayments
|
|
|
94
96
|
#
|
|
95
97
|
# @param billing_currency [Symbol, Dodopayments::Models::Currency, nil] This field is ingored if adaptive pricing is disabled
|
|
96
98
|
#
|
|
99
|
+
# @param cancel_url [String, nil] The URL to redirect the customer if they cancel or go back from the checkout.
|
|
100
|
+
#
|
|
97
101
|
# @param confirm [Boolean] If confirm is true, all the details will be finalized. If required data is missi
|
|
98
102
|
#
|
|
99
103
|
# @param custom_fields [Array<Dodopayments::Models::CustomField>, nil] Custom fields to collect from customer during checkout (max 5 fields)
|
|
@@ -4,10 +4,15 @@ module Dodopayments
|
|
|
4
4
|
module Resources
|
|
5
5
|
class Customers
|
|
6
6
|
class CustomerPortal
|
|
7
|
-
#
|
|
7
|
+
# Some parameter documentations has been truncated, see
|
|
8
|
+
# {Dodopayments::Models::Customers::CustomerPortalCreateParams} for more details.
|
|
9
|
+
#
|
|
10
|
+
# @overload create(customer_id, return_url: nil, send_email: nil, request_options: {})
|
|
8
11
|
#
|
|
9
12
|
# @param customer_id [String] Customer Id
|
|
10
13
|
#
|
|
14
|
+
# @param return_url [String] Optional return URL for this session. Overrides the business-level default.
|
|
15
|
+
#
|
|
11
16
|
# @param send_email [Boolean] If true, will send link to user.
|
|
12
17
|
#
|
|
13
18
|
# @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
@@ -22,6 +22,24 @@ module Dodopayments
|
|
|
22
22
|
)
|
|
23
23
|
end
|
|
24
24
|
|
|
25
|
+
# @overload retrieve_payout(payout_id, request_options: {})
|
|
26
|
+
#
|
|
27
|
+
# @param payout_id [String]
|
|
28
|
+
# @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
29
|
+
#
|
|
30
|
+
# @return [StringIO]
|
|
31
|
+
#
|
|
32
|
+
# @see Dodopayments::Models::Invoices::PaymentRetrievePayoutParams
|
|
33
|
+
def retrieve_payout(payout_id, params = {})
|
|
34
|
+
@client.request(
|
|
35
|
+
method: :get,
|
|
36
|
+
path: ["invoices/payouts/%1$s", payout_id],
|
|
37
|
+
headers: {"accept" => "application/pdf"},
|
|
38
|
+
model: StringIO,
|
|
39
|
+
options: params[:request_options]
|
|
40
|
+
)
|
|
41
|
+
end
|
|
42
|
+
|
|
25
43
|
# @overload retrieve_refund(refund_id, request_options: {})
|
|
26
44
|
#
|
|
27
45
|
# @param refund_id [String]
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Resources
|
|
5
|
+
class ProductCollections
|
|
6
|
+
class Groups
|
|
7
|
+
class Items
|
|
8
|
+
# @overload create(group_id, id:, products:, request_options: {})
|
|
9
|
+
#
|
|
10
|
+
# @param group_id [String] Path param: Product Collection Group Id
|
|
11
|
+
#
|
|
12
|
+
# @param id [String] Path param: Product Collection Id
|
|
13
|
+
#
|
|
14
|
+
# @param products [Array<Dodopayments::Models::ProductCollections::Groups::ItemCreateParams::Product>] Body param: Products to add to the group
|
|
15
|
+
#
|
|
16
|
+
# @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
17
|
+
#
|
|
18
|
+
# @return [Array<Dodopayments::Models::ProductCollections::Groups::ItemCreateResponseItem>]
|
|
19
|
+
#
|
|
20
|
+
# @see Dodopayments::Models::ProductCollections::Groups::ItemCreateParams
|
|
21
|
+
def create(group_id, params)
|
|
22
|
+
parsed, options = Dodopayments::ProductCollections::Groups::ItemCreateParams.dump_request(params)
|
|
23
|
+
id =
|
|
24
|
+
parsed.delete(:id) do
|
|
25
|
+
raise ArgumentError.new("missing required path argument #{_1}")
|
|
26
|
+
end
|
|
27
|
+
@client.request(
|
|
28
|
+
method: :post,
|
|
29
|
+
path: ["product-collections/%1$s/groups/%2$s/items", id, group_id],
|
|
30
|
+
body: parsed,
|
|
31
|
+
model: Dodopayments::Internal::Type::ArrayOf[Dodopayments::Models::ProductCollections::Groups::ItemCreateResponseItem],
|
|
32
|
+
options: options
|
|
33
|
+
)
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# @overload update(item_id, id:, group_id:, status:, request_options: {})
|
|
37
|
+
#
|
|
38
|
+
# @param item_id [String] Path param: Collection item Id (product membership in group)
|
|
39
|
+
#
|
|
40
|
+
# @param id [String] Path param: Product Collection Id
|
|
41
|
+
#
|
|
42
|
+
# @param group_id [String] Path param: Product Collection Group Id
|
|
43
|
+
#
|
|
44
|
+
# @param status [Boolean] Body param: Status of the product in the group
|
|
45
|
+
#
|
|
46
|
+
# @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
47
|
+
#
|
|
48
|
+
# @return [nil]
|
|
49
|
+
#
|
|
50
|
+
# @see Dodopayments::Models::ProductCollections::Groups::ItemUpdateParams
|
|
51
|
+
def update(item_id, params)
|
|
52
|
+
parsed, options = Dodopayments::ProductCollections::Groups::ItemUpdateParams.dump_request(params)
|
|
53
|
+
id =
|
|
54
|
+
parsed.delete(:id) do
|
|
55
|
+
raise ArgumentError.new("missing required path argument #{_1}")
|
|
56
|
+
end
|
|
57
|
+
group_id =
|
|
58
|
+
parsed.delete(:group_id) do
|
|
59
|
+
raise ArgumentError.new("missing required path argument #{_1}")
|
|
60
|
+
end
|
|
61
|
+
@client.request(
|
|
62
|
+
method: :patch,
|
|
63
|
+
path: ["product-collections/%1$s/groups/%2$s/items/%3$s", id, group_id, item_id],
|
|
64
|
+
body: parsed,
|
|
65
|
+
model: NilClass,
|
|
66
|
+
options: options
|
|
67
|
+
)
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# @overload delete(item_id, id:, group_id:, request_options: {})
|
|
71
|
+
#
|
|
72
|
+
# @param item_id [String] Collection item Id (product membership in group)
|
|
73
|
+
#
|
|
74
|
+
# @param id [String] Product Collection Id
|
|
75
|
+
#
|
|
76
|
+
# @param group_id [String] Product Collection Group Id
|
|
77
|
+
#
|
|
78
|
+
# @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
79
|
+
#
|
|
80
|
+
# @return [nil]
|
|
81
|
+
#
|
|
82
|
+
# @see Dodopayments::Models::ProductCollections::Groups::ItemDeleteParams
|
|
83
|
+
def delete(item_id, params)
|
|
84
|
+
parsed, options = Dodopayments::ProductCollections::Groups::ItemDeleteParams.dump_request(params)
|
|
85
|
+
id =
|
|
86
|
+
parsed.delete(:id) do
|
|
87
|
+
raise ArgumentError.new("missing required path argument #{_1}")
|
|
88
|
+
end
|
|
89
|
+
group_id =
|
|
90
|
+
parsed.delete(:group_id) do
|
|
91
|
+
raise ArgumentError.new("missing required path argument #{_1}")
|
|
92
|
+
end
|
|
93
|
+
@client.request(
|
|
94
|
+
method: :delete,
|
|
95
|
+
path: ["product-collections/%1$s/groups/%2$s/items/%3$s", id, group_id, item_id],
|
|
96
|
+
model: NilClass,
|
|
97
|
+
options: options
|
|
98
|
+
)
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
# @api private
|
|
102
|
+
#
|
|
103
|
+
# @param client [Dodopayments::Client]
|
|
104
|
+
def initialize(client:)
|
|
105
|
+
@client = client
|
|
106
|
+
end
|
|
107
|
+
end
|
|
108
|
+
end
|
|
109
|
+
end
|
|
110
|
+
end
|
|
111
|
+
end
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Resources
|
|
5
|
+
class ProductCollections
|
|
6
|
+
class Groups
|
|
7
|
+
# @return [Dodopayments::Resources::ProductCollections::Groups::Items]
|
|
8
|
+
attr_reader :items
|
|
9
|
+
|
|
10
|
+
# Some parameter documentations has been truncated, see
|
|
11
|
+
# {Dodopayments::Models::ProductCollections::GroupCreateParams} for more details.
|
|
12
|
+
#
|
|
13
|
+
# @overload create(id, products:, group_name: nil, status: nil, request_options: {})
|
|
14
|
+
#
|
|
15
|
+
# @param id [String] Product Collection Id
|
|
16
|
+
#
|
|
17
|
+
# @param products [Array<Dodopayments::Models::ProductCollections::GroupCreateParams::Product>] Products in this group
|
|
18
|
+
#
|
|
19
|
+
# @param group_name [String, nil] Optional group name. Multiple groups can have null names, but named groups must
|
|
20
|
+
#
|
|
21
|
+
# @param status [Boolean, nil] Status of the group (defaults to true if not provided)
|
|
22
|
+
#
|
|
23
|
+
# @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
24
|
+
#
|
|
25
|
+
# @return [Dodopayments::Models::ProductCollections::GroupCreateResponse]
|
|
26
|
+
#
|
|
27
|
+
# @see Dodopayments::Models::ProductCollections::GroupCreateParams
|
|
28
|
+
def create(id, params)
|
|
29
|
+
parsed, options = Dodopayments::ProductCollections::GroupCreateParams.dump_request(params)
|
|
30
|
+
@client.request(
|
|
31
|
+
method: :post,
|
|
32
|
+
path: ["product-collections/%1$s/groups", id],
|
|
33
|
+
body: parsed,
|
|
34
|
+
model: Dodopayments::Models::ProductCollections::GroupCreateResponse,
|
|
35
|
+
options: options
|
|
36
|
+
)
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# Some parameter documentations has been truncated, see
|
|
40
|
+
# {Dodopayments::Models::ProductCollections::GroupUpdateParams} for more details.
|
|
41
|
+
#
|
|
42
|
+
# @overload update(group_id, id:, group_name: nil, product_order: nil, status: nil, request_options: {})
|
|
43
|
+
#
|
|
44
|
+
# @param group_id [String] Path param: Product Collection Group Id
|
|
45
|
+
#
|
|
46
|
+
# @param id [String] Path param: Product Collection Id
|
|
47
|
+
#
|
|
48
|
+
# @param group_name [String, nil] Body param: Optional group name update: Some(Some(name)) = set name, Some(None)
|
|
49
|
+
#
|
|
50
|
+
# @param product_order [Array<String>, nil] Body param: Optional new order for products in this group (array of product_coll
|
|
51
|
+
#
|
|
52
|
+
# @param status [Boolean, nil] Body param: Optional status update
|
|
53
|
+
#
|
|
54
|
+
# @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
55
|
+
#
|
|
56
|
+
# @return [nil]
|
|
57
|
+
#
|
|
58
|
+
# @see Dodopayments::Models::ProductCollections::GroupUpdateParams
|
|
59
|
+
def update(group_id, params)
|
|
60
|
+
parsed, options = Dodopayments::ProductCollections::GroupUpdateParams.dump_request(params)
|
|
61
|
+
id =
|
|
62
|
+
parsed.delete(:id) do
|
|
63
|
+
raise ArgumentError.new("missing required path argument #{_1}")
|
|
64
|
+
end
|
|
65
|
+
@client.request(
|
|
66
|
+
method: :patch,
|
|
67
|
+
path: ["product-collections/%1$s/groups/%2$s", id, group_id],
|
|
68
|
+
body: parsed,
|
|
69
|
+
model: NilClass,
|
|
70
|
+
options: options
|
|
71
|
+
)
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
# @overload delete(group_id, id:, request_options: {})
|
|
75
|
+
#
|
|
76
|
+
# @param group_id [String] Product Collection Group Id
|
|
77
|
+
#
|
|
78
|
+
# @param id [String] Product Collection Id
|
|
79
|
+
#
|
|
80
|
+
# @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
81
|
+
#
|
|
82
|
+
# @return [nil]
|
|
83
|
+
#
|
|
84
|
+
# @see Dodopayments::Models::ProductCollections::GroupDeleteParams
|
|
85
|
+
def delete(group_id, params)
|
|
86
|
+
parsed, options = Dodopayments::ProductCollections::GroupDeleteParams.dump_request(params)
|
|
87
|
+
id =
|
|
88
|
+
parsed.delete(:id) do
|
|
89
|
+
raise ArgumentError.new("missing required path argument #{_1}")
|
|
90
|
+
end
|
|
91
|
+
@client.request(
|
|
92
|
+
method: :delete,
|
|
93
|
+
path: ["product-collections/%1$s/groups/%2$s", id, group_id],
|
|
94
|
+
model: NilClass,
|
|
95
|
+
options: options
|
|
96
|
+
)
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# @api private
|
|
100
|
+
#
|
|
101
|
+
# @param client [Dodopayments::Client]
|
|
102
|
+
def initialize(client:)
|
|
103
|
+
@client = client
|
|
104
|
+
@items = Dodopayments::Resources::ProductCollections::Groups::Items.new(client: client)
|
|
105
|
+
end
|
|
106
|
+
end
|
|
107
|
+
end
|
|
108
|
+
end
|
|
109
|
+
end
|