dodopayments 2.10.0 → 2.11.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 +10 -0
- data/README.md +9 -9
- data/lib/dodopayments/client.rb +4 -0
- data/lib/dodopayments/models/checkout_session_flags.rb +15 -1
- data/lib/dodopayments/models/checkout_session_request.rb +11 -1
- data/lib/dodopayments/models/checkout_session_response.rb +33 -1
- data/lib/dodopayments/models/discount_detail.rb +143 -0
- data/lib/dodopayments/models/filter_type.rb +71 -0
- data/lib/dodopayments/models/github_permission.rb +19 -0
- data/lib/dodopayments/models/integration_config.rb +3 -19
- data/lib/dodopayments/models/integration_config_response.rb +3 -19
- data/lib/dodopayments/models/invoices/payment_retrieve_payout_params.rb +22 -0
- data/lib/dodopayments/models/meter_filter.rb +3 -331
- data/lib/dodopayments/models/payment.rb +3 -141
- data/lib/dodopayments/models/payment_create_params.rb +11 -1
- data/lib/dodopayments/models/payment_method_types.rb +1 -0
- data/lib/dodopayments/models/product_collection.rb +74 -0
- data/lib/dodopayments/models/product_collection_create_params.rb +47 -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_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 +22 -0
- data/lib/dodopayments/models/product_collections/group_delete_params.rb +28 -0
- data/lib/dodopayments/models/product_collections/group_product.rb +26 -0
- data/lib/dodopayments/models/product_collections/group_update_params.rb +59 -0
- data/lib/dodopayments/models/product_collections/groups/item_create_params.rb +41 -0
- data/lib/dodopayments/models/product_collections/groups/item_create_response.rb +15 -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/product_collections/groups/product_collection_product.rb +132 -0
- data/lib/dodopayments/models/product_collections/product_collection_group_details.rb +42 -0
- data/lib/dodopayments/models/product_collections/product_collection_group_response.rb +39 -0
- data/lib/dodopayments/models/subscription.rb +13 -142
- data/lib/dodopayments/models/subscription_create_params.rb +11 -1
- data/lib/dodopayments/models/subscription_list_response.rb +10 -1
- data/lib/dodopayments/models/subscription_update_params.rb +12 -1
- data/lib/dodopayments/models/subscription_update_payment_method_params.rb +9 -9
- data/lib/dodopayments/models/webhook_event_type.rb +1 -5
- data/lib/dodopayments/models.rb +24 -0
- data/lib/dodopayments/resources/checkout_sessions.rb +6 -2
- data/lib/dodopayments/resources/invoices/payments.rb +18 -0
- data/lib/dodopayments/resources/payments.rb +3 -1
- 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 +9 -5
- data/lib/dodopayments/version.rb +1 -1
- data/lib/dodopayments.rb +29 -0
- data/rbi/dodopayments/client.rbi +3 -0
- data/rbi/dodopayments/models/checkout_session_flags.rbi +23 -0
- data/rbi/dodopayments/models/checkout_session_request.rbi +12 -0
- data/rbi/dodopayments/models/checkout_session_response.rbi +43 -5
- data/rbi/dodopayments/models/discount_detail.rbi +161 -0
- data/rbi/dodopayments/models/filter_type.rbi +112 -0
- data/rbi/dodopayments/models/github_permission.rbi +26 -0
- data/rbi/dodopayments/models/integration_config.rbi +3 -59
- data/rbi/dodopayments/models/integration_config_response.rbi +3 -59
- data/rbi/dodopayments/models/invoices/payment_retrieve_payout_params.rbi +40 -0
- data/rbi/dodopayments/models/meter_filter.rbi +3 -572
- data/rbi/dodopayments/models/payment.rbi +3 -163
- data/rbi/dodopayments/models/payment_create_params.rbi +12 -0
- data/rbi/dodopayments/models/payment_method_types.rbi +1 -0
- data/rbi/dodopayments/models/product_collection.rbi +108 -0
- data/rbi/dodopayments/models/product_collection_create_params.rbi +82 -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_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 +40 -0
- data/rbi/dodopayments/models/product_collections/group_delete_params.rbi +48 -0
- data/rbi/dodopayments/models/product_collections/group_product.rbi +46 -0
- data/rbi/dodopayments/models/product_collections/group_update_params.rbi +80 -0
- data/rbi/dodopayments/models/product_collections/groups/item_create_params.rbi +68 -0
- data/rbi/dodopayments/models/product_collections/groups/item_create_response.rbi +17 -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/product_collections/groups/product_collection_product.rbi +148 -0
- data/rbi/dodopayments/models/product_collections/product_collection_group_details.rbi +67 -0
- data/rbi/dodopayments/models/product_collections/product_collection_group_response.rbi +68 -0
- data/rbi/dodopayments/models/subscription.rbi +13 -164
- data/rbi/dodopayments/models/subscription_create_params.rbi +12 -0
- data/rbi/dodopayments/models/subscription_list_response.rbi +10 -0
- data/rbi/dodopayments/models/subscription_update_params.rbi +14 -0
- data/rbi/dodopayments/models/subscription_update_payment_method_params.rbi +16 -16
- data/rbi/dodopayments/models/webhook_event_type.rbi +4 -18
- data/rbi/dodopayments/models.rbi +31 -0
- data/rbi/dodopayments/resources/checkout_sessions.rbi +10 -0
- data/rbi/dodopayments/resources/invoices/payments.rbi +9 -0
- data/rbi/dodopayments/resources/payments.rbi +5 -0
- data/rbi/dodopayments/resources/product_collections/groups/items.rbi +83 -0
- data/rbi/dodopayments/resources/product_collections/groups.rbi +88 -0
- data/rbi/dodopayments/resources/product_collections.rbi +149 -0
- data/rbi/dodopayments/resources/subscriptions.rbi +15 -4
- data/sig/dodopayments/client.rbs +2 -0
- data/sig/dodopayments/models/checkout_session_flags.rbs +7 -0
- data/sig/dodopayments/models/checkout_session_request.rbs +5 -0
- data/sig/dodopayments/models/checkout_session_response.rbs +27 -3
- data/sig/dodopayments/models/discount_detail.rbs +95 -0
- data/sig/dodopayments/models/filter_type.rbs +52 -0
- data/sig/dodopayments/models/github_permission.rbs +17 -0
- data/sig/dodopayments/models/integration_config.rbs +4 -18
- data/sig/dodopayments/models/integration_config_response.rbs +4 -18
- data/sig/dodopayments/models/invoices/payment_retrieve_payout_params.rbs +25 -0
- data/sig/dodopayments/models/meter_filter.rbs +4 -252
- data/sig/dodopayments/models/payment.rbs +4 -96
- data/sig/dodopayments/models/payment_create_params.rbs +5 -0
- data/sig/dodopayments/models/payment_method_types.rbs +2 -0
- data/sig/dodopayments/models/product_collection.rbs +55 -0
- data/sig/dodopayments/models/product_collection_create_params.rbs +41 -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_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 +27 -0
- data/sig/dodopayments/models/product_collections/group_delete_params.rbs +30 -0
- data/sig/dodopayments/models/product_collections/group_product.rbs +17 -0
- data/sig/dodopayments/models/product_collections/group_update_params.rbs +48 -0
- data/sig/dodopayments/models/product_collections/groups/item_create_params.rbs +40 -0
- data/sig/dodopayments/models/product_collections/groups/item_create_response.rbs +12 -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/product_collections/groups/product_collection_product.rbs +99 -0
- data/sig/dodopayments/models/product_collections/product_collection_group_details.rbs +34 -0
- data/sig/dodopayments/models/product_collections/product_collection_group_response.rbs +39 -0
- data/sig/dodopayments/models/subscription.rbs +9 -96
- data/sig/dodopayments/models/subscription_create_params.rbs +5 -0
- data/sig/dodopayments/models/subscription_list_response.rbs +5 -0
- data/sig/dodopayments/models/subscription_update_params.rbs +5 -0
- data/sig/dodopayments/models/subscription_update_payment_method_params.rbs +9 -9
- data/sig/dodopayments/models/webhook_event_type.rbs +2 -10
- data/sig/dodopayments/models.rbs +24 -0
- data/sig/dodopayments/resources/checkout_sessions.rbs +2 -0
- data/sig/dodopayments/resources/invoices/payments.rbs +5 -0
- data/sig/dodopayments/resources/payments.rbs +1 -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 +3 -1
- metadata +89 -2
|
@@ -111,7 +111,7 @@ module Dodopayments
|
|
|
111
111
|
attr_accessor :discount_id
|
|
112
112
|
|
|
113
113
|
# All stacked discounts applied, ordered by position
|
|
114
|
-
sig { returns(T.nilable(T::Array[Dodopayments::
|
|
114
|
+
sig { returns(T.nilable(T::Array[Dodopayments::DiscountDetail])) }
|
|
115
115
|
attr_accessor :discounts
|
|
116
116
|
|
|
117
117
|
# An error code if the payment failed
|
|
@@ -200,8 +200,7 @@ module Dodopayments
|
|
|
200
200
|
custom_field_responses:
|
|
201
201
|
T.nilable(T::Array[Dodopayments::CustomFieldResponse::OrHash]),
|
|
202
202
|
discount_id: T.nilable(String),
|
|
203
|
-
discounts:
|
|
204
|
-
T.nilable(T::Array[Dodopayments::Payment::Discount::OrHash]),
|
|
203
|
+
discounts: T.nilable(T::Array[Dodopayments::DiscountDetail::OrHash]),
|
|
205
204
|
error_code: T.nilable(String),
|
|
206
205
|
error_message: T.nilable(String),
|
|
207
206
|
invoice_id: T.nilable(String),
|
|
@@ -333,7 +332,7 @@ module Dodopayments
|
|
|
333
332
|
custom_field_responses:
|
|
334
333
|
T.nilable(T::Array[Dodopayments::CustomFieldResponse]),
|
|
335
334
|
discount_id: T.nilable(String),
|
|
336
|
-
discounts: T.nilable(T::Array[Dodopayments::
|
|
335
|
+
discounts: T.nilable(T::Array[Dodopayments::DiscountDetail]),
|
|
337
336
|
error_code: T.nilable(String),
|
|
338
337
|
error_message: T.nilable(String),
|
|
339
338
|
invoice_id: T.nilable(String),
|
|
@@ -356,165 +355,6 @@ module Dodopayments
|
|
|
356
355
|
def to_hash
|
|
357
356
|
end
|
|
358
357
|
|
|
359
|
-
class Discount < Dodopayments::Internal::Type::BaseModel
|
|
360
|
-
OrHash =
|
|
361
|
-
T.type_alias do
|
|
362
|
-
T.any(
|
|
363
|
-
Dodopayments::Payment::Discount,
|
|
364
|
-
Dodopayments::Internal::AnyHash
|
|
365
|
-
)
|
|
366
|
-
end
|
|
367
|
-
|
|
368
|
-
# The discount amount (basis points for percentage, USD cents for flat)
|
|
369
|
-
sig { returns(Integer) }
|
|
370
|
-
attr_accessor :amount
|
|
371
|
-
|
|
372
|
-
# The business this discount belongs to
|
|
373
|
-
sig { returns(String) }
|
|
374
|
-
attr_accessor :business_id
|
|
375
|
-
|
|
376
|
-
# The discount code
|
|
377
|
-
sig { returns(String) }
|
|
378
|
-
attr_accessor :code
|
|
379
|
-
|
|
380
|
-
# Timestamp when the discount was created
|
|
381
|
-
sig { returns(Time) }
|
|
382
|
-
attr_accessor :created_at
|
|
383
|
-
|
|
384
|
-
# The unique discount ID
|
|
385
|
-
sig { returns(String) }
|
|
386
|
-
attr_accessor :discount_id
|
|
387
|
-
|
|
388
|
-
# Additional metadata
|
|
389
|
-
sig { returns(T::Hash[Symbol, String]) }
|
|
390
|
-
attr_accessor :metadata
|
|
391
|
-
|
|
392
|
-
# Position of this discount in the stack (0-based)
|
|
393
|
-
sig { returns(Integer) }
|
|
394
|
-
attr_accessor :position
|
|
395
|
-
|
|
396
|
-
# Whether this discount should be preserved when a subscription changes plans
|
|
397
|
-
sig { returns(T::Boolean) }
|
|
398
|
-
attr_accessor :preserve_on_plan_change
|
|
399
|
-
|
|
400
|
-
# List of product IDs to which this discount is restricted
|
|
401
|
-
sig { returns(T::Array[String]) }
|
|
402
|
-
attr_accessor :restricted_to
|
|
403
|
-
|
|
404
|
-
# How many times this discount has been used
|
|
405
|
-
sig { returns(Integer) }
|
|
406
|
-
attr_accessor :times_used
|
|
407
|
-
|
|
408
|
-
# The type of discount
|
|
409
|
-
sig { returns(Dodopayments::DiscountType::TaggedSymbol) }
|
|
410
|
-
attr_accessor :type
|
|
411
|
-
|
|
412
|
-
# Remaining billing cycles for this discount on this subscription (None for
|
|
413
|
-
# one-time payments)
|
|
414
|
-
sig { returns(T.nilable(Integer)) }
|
|
415
|
-
attr_accessor :cycles_remaining
|
|
416
|
-
|
|
417
|
-
# Optional date/time after which discount is expired
|
|
418
|
-
sig { returns(T.nilable(Time)) }
|
|
419
|
-
attr_accessor :expires_at
|
|
420
|
-
|
|
421
|
-
# Name for the Discount
|
|
422
|
-
sig { returns(T.nilable(String)) }
|
|
423
|
-
attr_accessor :name
|
|
424
|
-
|
|
425
|
-
# Number of subscription billing cycles this discount is valid for
|
|
426
|
-
sig { returns(T.nilable(Integer)) }
|
|
427
|
-
attr_accessor :subscription_cycles
|
|
428
|
-
|
|
429
|
-
# Usage limit for this discount, if any
|
|
430
|
-
sig { returns(T.nilable(Integer)) }
|
|
431
|
-
attr_accessor :usage_limit
|
|
432
|
-
|
|
433
|
-
# Response struct for a discount with its position in a stack and optional
|
|
434
|
-
# cycle-tracking information (for subscriptions).
|
|
435
|
-
sig do
|
|
436
|
-
params(
|
|
437
|
-
amount: Integer,
|
|
438
|
-
business_id: String,
|
|
439
|
-
code: String,
|
|
440
|
-
created_at: Time,
|
|
441
|
-
discount_id: String,
|
|
442
|
-
metadata: T::Hash[Symbol, String],
|
|
443
|
-
position: Integer,
|
|
444
|
-
preserve_on_plan_change: T::Boolean,
|
|
445
|
-
restricted_to: T::Array[String],
|
|
446
|
-
times_used: Integer,
|
|
447
|
-
type: Dodopayments::DiscountType::OrSymbol,
|
|
448
|
-
cycles_remaining: T.nilable(Integer),
|
|
449
|
-
expires_at: T.nilable(Time),
|
|
450
|
-
name: T.nilable(String),
|
|
451
|
-
subscription_cycles: T.nilable(Integer),
|
|
452
|
-
usage_limit: T.nilable(Integer)
|
|
453
|
-
).returns(T.attached_class)
|
|
454
|
-
end
|
|
455
|
-
def self.new(
|
|
456
|
-
# The discount amount (basis points for percentage, USD cents for flat)
|
|
457
|
-
amount:,
|
|
458
|
-
# The business this discount belongs to
|
|
459
|
-
business_id:,
|
|
460
|
-
# The discount code
|
|
461
|
-
code:,
|
|
462
|
-
# Timestamp when the discount was created
|
|
463
|
-
created_at:,
|
|
464
|
-
# The unique discount ID
|
|
465
|
-
discount_id:,
|
|
466
|
-
# Additional metadata
|
|
467
|
-
metadata:,
|
|
468
|
-
# Position of this discount in the stack (0-based)
|
|
469
|
-
position:,
|
|
470
|
-
# Whether this discount should be preserved when a subscription changes plans
|
|
471
|
-
preserve_on_plan_change:,
|
|
472
|
-
# List of product IDs to which this discount is restricted
|
|
473
|
-
restricted_to:,
|
|
474
|
-
# How many times this discount has been used
|
|
475
|
-
times_used:,
|
|
476
|
-
# The type of discount
|
|
477
|
-
type:,
|
|
478
|
-
# Remaining billing cycles for this discount on this subscription (None for
|
|
479
|
-
# one-time payments)
|
|
480
|
-
cycles_remaining: nil,
|
|
481
|
-
# Optional date/time after which discount is expired
|
|
482
|
-
expires_at: nil,
|
|
483
|
-
# Name for the Discount
|
|
484
|
-
name: nil,
|
|
485
|
-
# Number of subscription billing cycles this discount is valid for
|
|
486
|
-
subscription_cycles: nil,
|
|
487
|
-
# Usage limit for this discount, if any
|
|
488
|
-
usage_limit: nil
|
|
489
|
-
)
|
|
490
|
-
end
|
|
491
|
-
|
|
492
|
-
sig do
|
|
493
|
-
override.returns(
|
|
494
|
-
{
|
|
495
|
-
amount: Integer,
|
|
496
|
-
business_id: String,
|
|
497
|
-
code: String,
|
|
498
|
-
created_at: Time,
|
|
499
|
-
discount_id: String,
|
|
500
|
-
metadata: T::Hash[Symbol, String],
|
|
501
|
-
position: Integer,
|
|
502
|
-
preserve_on_plan_change: T::Boolean,
|
|
503
|
-
restricted_to: T::Array[String],
|
|
504
|
-
times_used: Integer,
|
|
505
|
-
type: Dodopayments::DiscountType::TaggedSymbol,
|
|
506
|
-
cycles_remaining: T.nilable(Integer),
|
|
507
|
-
expires_at: T.nilable(Time),
|
|
508
|
-
name: T.nilable(String),
|
|
509
|
-
subscription_cycles: T.nilable(Integer),
|
|
510
|
-
usage_limit: T.nilable(Integer)
|
|
511
|
-
}
|
|
512
|
-
)
|
|
513
|
-
end
|
|
514
|
-
def to_hash
|
|
515
|
-
end
|
|
516
|
-
end
|
|
517
|
-
|
|
518
358
|
class ProductCart < Dodopayments::Internal::Type::BaseModel
|
|
519
359
|
OrHash =
|
|
520
360
|
T.type_alias do
|
|
@@ -54,6 +54,12 @@ module Dodopayments
|
|
|
54
54
|
sig { returns(T.nilable(Dodopayments::Currency::OrSymbol)) }
|
|
55
55
|
attr_accessor :billing_currency
|
|
56
56
|
|
|
57
|
+
# Optional business / legal name associated with the tax id. When provided
|
|
58
|
+
# together with a valid tax id for a B2B purchase, this name is rendered on the
|
|
59
|
+
# invoice instead of the customer's personal name.
|
|
60
|
+
sig { returns(T.nilable(String)) }
|
|
61
|
+
attr_accessor :customer_business_name
|
|
62
|
+
|
|
57
63
|
# DEPRECATED: Use discount_codes instead. Cannot be used together with
|
|
58
64
|
# discount_codes.
|
|
59
65
|
sig { returns(T.nilable(String)) }
|
|
@@ -137,6 +143,7 @@ module Dodopayments
|
|
|
137
143
|
allowed_payment_method_types:
|
|
138
144
|
T.nilable(T::Array[Dodopayments::PaymentMethodTypes::OrSymbol]),
|
|
139
145
|
billing_currency: T.nilable(Dodopayments::Currency::OrSymbol),
|
|
146
|
+
customer_business_name: T.nilable(String),
|
|
140
147
|
discount_code: T.nilable(String),
|
|
141
148
|
discount_codes: T.nilable(T::Array[String]),
|
|
142
149
|
force_3ds: T.nilable(T::Boolean),
|
|
@@ -172,6 +179,10 @@ module Dodopayments
|
|
|
172
179
|
# Fix the currency in which the end customer is billed. If Dodo Payments cannot
|
|
173
180
|
# support that currency for this transaction, it will not proceed
|
|
174
181
|
billing_currency: nil,
|
|
182
|
+
# Optional business / legal name associated with the tax id. When provided
|
|
183
|
+
# together with a valid tax id for a B2B purchase, this name is rendered on the
|
|
184
|
+
# invoice instead of the customer's personal name.
|
|
185
|
+
customer_business_name: nil,
|
|
175
186
|
# DEPRECATED: Use discount_codes instead. Cannot be used together with
|
|
176
187
|
# discount_codes.
|
|
177
188
|
discount_code: nil,
|
|
@@ -224,6 +235,7 @@ module Dodopayments
|
|
|
224
235
|
allowed_payment_method_types:
|
|
225
236
|
T.nilable(T::Array[Dodopayments::PaymentMethodTypes::OrSymbol]),
|
|
226
237
|
billing_currency: T.nilable(Dodopayments::Currency::OrSymbol),
|
|
238
|
+
customer_business_name: T.nilable(String),
|
|
227
239
|
discount_code: T.nilable(String),
|
|
228
240
|
discount_codes: T.nilable(T::Array[String]),
|
|
229
241
|
force_3ds: T.nilable(T::Boolean),
|
|
@@ -159,6 +159,7 @@ module Dodopayments
|
|
|
159
159
|
Dodopayments::PaymentMethodTypes::TaggedSymbol
|
|
160
160
|
)
|
|
161
161
|
SOFORT = T.let(:sofort, Dodopayments::PaymentMethodTypes::TaggedSymbol)
|
|
162
|
+
SUNBIT = T.let(:sunbit, Dodopayments::PaymentMethodTypes::TaggedSymbol)
|
|
162
163
|
SWISH = T.let(:swish, Dodopayments::PaymentMethodTypes::TaggedSymbol)
|
|
163
164
|
TOUCH_N_GO =
|
|
164
165
|
T.let(:touch_n_go, Dodopayments::PaymentMethodTypes::TaggedSymbol)
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Models
|
|
5
|
+
class ProductCollection < Dodopayments::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(
|
|
9
|
+
Dodopayments::ProductCollection,
|
|
10
|
+
Dodopayments::Internal::AnyHash
|
|
11
|
+
)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# Unique identifier for the product collection
|
|
15
|
+
sig { returns(String) }
|
|
16
|
+
attr_accessor :id
|
|
17
|
+
|
|
18
|
+
# Brand ID for the collection
|
|
19
|
+
sig { returns(String) }
|
|
20
|
+
attr_accessor :brand_id
|
|
21
|
+
|
|
22
|
+
# Timestamp when the collection was created
|
|
23
|
+
sig { returns(Time) }
|
|
24
|
+
attr_accessor :created_at
|
|
25
|
+
|
|
26
|
+
# Groups in this collection
|
|
27
|
+
sig do
|
|
28
|
+
returns(
|
|
29
|
+
T::Array[
|
|
30
|
+
Dodopayments::ProductCollections::ProductCollectionGroupResponse
|
|
31
|
+
]
|
|
32
|
+
)
|
|
33
|
+
end
|
|
34
|
+
attr_accessor :groups
|
|
35
|
+
|
|
36
|
+
# Name of the collection
|
|
37
|
+
sig { returns(String) }
|
|
38
|
+
attr_accessor :name
|
|
39
|
+
|
|
40
|
+
# Timestamp when the collection was last updated
|
|
41
|
+
sig { returns(Time) }
|
|
42
|
+
attr_accessor :updated_at
|
|
43
|
+
|
|
44
|
+
# Description of the collection
|
|
45
|
+
sig { returns(T.nilable(String)) }
|
|
46
|
+
attr_accessor :description
|
|
47
|
+
|
|
48
|
+
# URL of the collection image
|
|
49
|
+
sig { returns(T.nilable(String)) }
|
|
50
|
+
attr_accessor :image
|
|
51
|
+
|
|
52
|
+
sig do
|
|
53
|
+
params(
|
|
54
|
+
id: String,
|
|
55
|
+
brand_id: String,
|
|
56
|
+
created_at: Time,
|
|
57
|
+
groups:
|
|
58
|
+
T::Array[
|
|
59
|
+
Dodopayments::ProductCollections::ProductCollectionGroupResponse::OrHash
|
|
60
|
+
],
|
|
61
|
+
name: String,
|
|
62
|
+
updated_at: Time,
|
|
63
|
+
description: T.nilable(String),
|
|
64
|
+
image: T.nilable(String)
|
|
65
|
+
).returns(T.attached_class)
|
|
66
|
+
end
|
|
67
|
+
def self.new(
|
|
68
|
+
# Unique identifier for the product collection
|
|
69
|
+
id:,
|
|
70
|
+
# Brand ID for the collection
|
|
71
|
+
brand_id:,
|
|
72
|
+
# Timestamp when the collection was created
|
|
73
|
+
created_at:,
|
|
74
|
+
# Groups in this collection
|
|
75
|
+
groups:,
|
|
76
|
+
# Name of the collection
|
|
77
|
+
name:,
|
|
78
|
+
# Timestamp when the collection was last updated
|
|
79
|
+
updated_at:,
|
|
80
|
+
# Description of the collection
|
|
81
|
+
description: nil,
|
|
82
|
+
# URL of the collection image
|
|
83
|
+
image: nil
|
|
84
|
+
)
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
sig do
|
|
88
|
+
override.returns(
|
|
89
|
+
{
|
|
90
|
+
id: String,
|
|
91
|
+
brand_id: String,
|
|
92
|
+
created_at: Time,
|
|
93
|
+
groups:
|
|
94
|
+
T::Array[
|
|
95
|
+
Dodopayments::ProductCollections::ProductCollectionGroupResponse
|
|
96
|
+
],
|
|
97
|
+
name: String,
|
|
98
|
+
updated_at: Time,
|
|
99
|
+
description: T.nilable(String),
|
|
100
|
+
image: T.nilable(String)
|
|
101
|
+
}
|
|
102
|
+
)
|
|
103
|
+
end
|
|
104
|
+
def to_hash
|
|
105
|
+
end
|
|
106
|
+
end
|
|
107
|
+
end
|
|
108
|
+
end
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Models
|
|
5
|
+
class ProductCollectionCreateParams < Dodopayments::Internal::Type::BaseModel
|
|
6
|
+
extend Dodopayments::Internal::Type::RequestParameters::Converter
|
|
7
|
+
include Dodopayments::Internal::Type::RequestParameters
|
|
8
|
+
|
|
9
|
+
OrHash =
|
|
10
|
+
T.type_alias do
|
|
11
|
+
T.any(
|
|
12
|
+
Dodopayments::ProductCollectionCreateParams,
|
|
13
|
+
Dodopayments::Internal::AnyHash
|
|
14
|
+
)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# Groups of products in this collection
|
|
18
|
+
sig do
|
|
19
|
+
returns(
|
|
20
|
+
T::Array[
|
|
21
|
+
Dodopayments::ProductCollections::ProductCollectionGroupDetails
|
|
22
|
+
]
|
|
23
|
+
)
|
|
24
|
+
end
|
|
25
|
+
attr_accessor :groups
|
|
26
|
+
|
|
27
|
+
# Name of the product collection
|
|
28
|
+
sig { returns(String) }
|
|
29
|
+
attr_accessor :name
|
|
30
|
+
|
|
31
|
+
# Brand id for the collection, if not provided will default to primary brand
|
|
32
|
+
sig { returns(T.nilable(String)) }
|
|
33
|
+
attr_accessor :brand_id
|
|
34
|
+
|
|
35
|
+
# Optional description of the product collection
|
|
36
|
+
sig { returns(T.nilable(String)) }
|
|
37
|
+
attr_accessor :description
|
|
38
|
+
|
|
39
|
+
sig do
|
|
40
|
+
params(
|
|
41
|
+
groups:
|
|
42
|
+
T::Array[
|
|
43
|
+
Dodopayments::ProductCollections::ProductCollectionGroupDetails::OrHash
|
|
44
|
+
],
|
|
45
|
+
name: String,
|
|
46
|
+
brand_id: T.nilable(String),
|
|
47
|
+
description: T.nilable(String),
|
|
48
|
+
request_options: Dodopayments::RequestOptions::OrHash
|
|
49
|
+
).returns(T.attached_class)
|
|
50
|
+
end
|
|
51
|
+
def self.new(
|
|
52
|
+
# Groups of products in this collection
|
|
53
|
+
groups:,
|
|
54
|
+
# Name of the product collection
|
|
55
|
+
name:,
|
|
56
|
+
# Brand id for the collection, if not provided will default to primary brand
|
|
57
|
+
brand_id: nil,
|
|
58
|
+
# Optional description of the product collection
|
|
59
|
+
description: nil,
|
|
60
|
+
request_options: {}
|
|
61
|
+
)
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
sig do
|
|
65
|
+
override.returns(
|
|
66
|
+
{
|
|
67
|
+
groups:
|
|
68
|
+
T::Array[
|
|
69
|
+
Dodopayments::ProductCollections::ProductCollectionGroupDetails
|
|
70
|
+
],
|
|
71
|
+
name: String,
|
|
72
|
+
brand_id: T.nilable(String),
|
|
73
|
+
description: T.nilable(String),
|
|
74
|
+
request_options: Dodopayments::RequestOptions
|
|
75
|
+
}
|
|
76
|
+
)
|
|
77
|
+
end
|
|
78
|
+
def to_hash
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
end
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Models
|
|
5
|
+
class ProductCollectionDeleteParams < Dodopayments::Internal::Type::BaseModel
|
|
6
|
+
extend Dodopayments::Internal::Type::RequestParameters::Converter
|
|
7
|
+
include Dodopayments::Internal::Type::RequestParameters
|
|
8
|
+
|
|
9
|
+
OrHash =
|
|
10
|
+
T.type_alias do
|
|
11
|
+
T.any(
|
|
12
|
+
Dodopayments::ProductCollectionDeleteParams,
|
|
13
|
+
Dodopayments::Internal::AnyHash
|
|
14
|
+
)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
sig { returns(String) }
|
|
18
|
+
attr_accessor :id
|
|
19
|
+
|
|
20
|
+
sig do
|
|
21
|
+
params(
|
|
22
|
+
id: String,
|
|
23
|
+
request_options: Dodopayments::RequestOptions::OrHash
|
|
24
|
+
).returns(T.attached_class)
|
|
25
|
+
end
|
|
26
|
+
def self.new(id:, request_options: {})
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
sig do
|
|
30
|
+
override.returns(
|
|
31
|
+
{ id: String, request_options: Dodopayments::RequestOptions }
|
|
32
|
+
)
|
|
33
|
+
end
|
|
34
|
+
def to_hash
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Models
|
|
5
|
+
class ProductCollectionListParams < Dodopayments::Internal::Type::BaseModel
|
|
6
|
+
extend Dodopayments::Internal::Type::RequestParameters::Converter
|
|
7
|
+
include Dodopayments::Internal::Type::RequestParameters
|
|
8
|
+
|
|
9
|
+
OrHash =
|
|
10
|
+
T.type_alias do
|
|
11
|
+
T.any(
|
|
12
|
+
Dodopayments::ProductCollectionListParams,
|
|
13
|
+
Dodopayments::Internal::AnyHash
|
|
14
|
+
)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# List archived collections
|
|
18
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
19
|
+
attr_reader :archived
|
|
20
|
+
|
|
21
|
+
sig { params(archived: T::Boolean).void }
|
|
22
|
+
attr_writer :archived
|
|
23
|
+
|
|
24
|
+
# Filter by Brand id
|
|
25
|
+
sig { returns(T.nilable(String)) }
|
|
26
|
+
attr_reader :brand_id
|
|
27
|
+
|
|
28
|
+
sig { params(brand_id: String).void }
|
|
29
|
+
attr_writer :brand_id
|
|
30
|
+
|
|
31
|
+
# Page number default is 0
|
|
32
|
+
sig { returns(T.nilable(Integer)) }
|
|
33
|
+
attr_reader :page_number
|
|
34
|
+
|
|
35
|
+
sig { params(page_number: Integer).void }
|
|
36
|
+
attr_writer :page_number
|
|
37
|
+
|
|
38
|
+
# Page size default is 10 max is 100
|
|
39
|
+
sig { returns(T.nilable(Integer)) }
|
|
40
|
+
attr_reader :page_size
|
|
41
|
+
|
|
42
|
+
sig { params(page_size: Integer).void }
|
|
43
|
+
attr_writer :page_size
|
|
44
|
+
|
|
45
|
+
sig do
|
|
46
|
+
params(
|
|
47
|
+
archived: T::Boolean,
|
|
48
|
+
brand_id: String,
|
|
49
|
+
page_number: Integer,
|
|
50
|
+
page_size: Integer,
|
|
51
|
+
request_options: Dodopayments::RequestOptions::OrHash
|
|
52
|
+
).returns(T.attached_class)
|
|
53
|
+
end
|
|
54
|
+
def self.new(
|
|
55
|
+
# List archived collections
|
|
56
|
+
archived: nil,
|
|
57
|
+
# Filter by Brand id
|
|
58
|
+
brand_id: nil,
|
|
59
|
+
# Page number default is 0
|
|
60
|
+
page_number: nil,
|
|
61
|
+
# Page size default is 10 max is 100
|
|
62
|
+
page_size: nil,
|
|
63
|
+
request_options: {}
|
|
64
|
+
)
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
sig do
|
|
68
|
+
override.returns(
|
|
69
|
+
{
|
|
70
|
+
archived: T::Boolean,
|
|
71
|
+
brand_id: String,
|
|
72
|
+
page_number: Integer,
|
|
73
|
+
page_size: Integer,
|
|
74
|
+
request_options: Dodopayments::RequestOptions
|
|
75
|
+
}
|
|
76
|
+
)
|
|
77
|
+
end
|
|
78
|
+
def to_hash
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
end
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Models
|
|
5
|
+
class ProductCollectionListResponse < Dodopayments::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(
|
|
9
|
+
Dodopayments::Models::ProductCollectionListResponse,
|
|
10
|
+
Dodopayments::Internal::AnyHash
|
|
11
|
+
)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# Collection ID
|
|
15
|
+
sig { returns(String) }
|
|
16
|
+
attr_accessor :id
|
|
17
|
+
|
|
18
|
+
# Timestamp when created
|
|
19
|
+
sig { returns(Time) }
|
|
20
|
+
attr_accessor :created_at
|
|
21
|
+
|
|
22
|
+
# Collection name
|
|
23
|
+
sig { returns(String) }
|
|
24
|
+
attr_accessor :name
|
|
25
|
+
|
|
26
|
+
# Number of products in the collection
|
|
27
|
+
sig { returns(Integer) }
|
|
28
|
+
attr_accessor :products_count
|
|
29
|
+
|
|
30
|
+
# Timestamp when last updated
|
|
31
|
+
sig { returns(Time) }
|
|
32
|
+
attr_accessor :updated_at
|
|
33
|
+
|
|
34
|
+
# Collection description
|
|
35
|
+
sig { returns(T.nilable(String)) }
|
|
36
|
+
attr_accessor :description
|
|
37
|
+
|
|
38
|
+
# Collection image URL
|
|
39
|
+
sig { returns(T.nilable(String)) }
|
|
40
|
+
attr_accessor :image
|
|
41
|
+
|
|
42
|
+
sig do
|
|
43
|
+
params(
|
|
44
|
+
id: String,
|
|
45
|
+
created_at: Time,
|
|
46
|
+
name: String,
|
|
47
|
+
products_count: Integer,
|
|
48
|
+
updated_at: Time,
|
|
49
|
+
description: T.nilable(String),
|
|
50
|
+
image: T.nilable(String)
|
|
51
|
+
).returns(T.attached_class)
|
|
52
|
+
end
|
|
53
|
+
def self.new(
|
|
54
|
+
# Collection ID
|
|
55
|
+
id:,
|
|
56
|
+
# Timestamp when created
|
|
57
|
+
created_at:,
|
|
58
|
+
# Collection name
|
|
59
|
+
name:,
|
|
60
|
+
# Number of products in the collection
|
|
61
|
+
products_count:,
|
|
62
|
+
# Timestamp when last updated
|
|
63
|
+
updated_at:,
|
|
64
|
+
# Collection description
|
|
65
|
+
description: nil,
|
|
66
|
+
# Collection image URL
|
|
67
|
+
image: nil
|
|
68
|
+
)
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
sig do
|
|
72
|
+
override.returns(
|
|
73
|
+
{
|
|
74
|
+
id: String,
|
|
75
|
+
created_at: Time,
|
|
76
|
+
name: String,
|
|
77
|
+
products_count: Integer,
|
|
78
|
+
updated_at: Time,
|
|
79
|
+
description: T.nilable(String),
|
|
80
|
+
image: T.nilable(String)
|
|
81
|
+
}
|
|
82
|
+
)
|
|
83
|
+
end
|
|
84
|
+
def to_hash
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
end
|
|
88
|
+
end
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Models
|
|
5
|
+
class ProductCollectionRetrieveParams < Dodopayments::Internal::Type::BaseModel
|
|
6
|
+
extend Dodopayments::Internal::Type::RequestParameters::Converter
|
|
7
|
+
include Dodopayments::Internal::Type::RequestParameters
|
|
8
|
+
|
|
9
|
+
OrHash =
|
|
10
|
+
T.type_alias do
|
|
11
|
+
T.any(
|
|
12
|
+
Dodopayments::ProductCollectionRetrieveParams,
|
|
13
|
+
Dodopayments::Internal::AnyHash
|
|
14
|
+
)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
sig { returns(String) }
|
|
18
|
+
attr_accessor :id
|
|
19
|
+
|
|
20
|
+
sig do
|
|
21
|
+
params(
|
|
22
|
+
id: String,
|
|
23
|
+
request_options: Dodopayments::RequestOptions::OrHash
|
|
24
|
+
).returns(T.attached_class)
|
|
25
|
+
end
|
|
26
|
+
def self.new(id:, request_options: {})
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
sig do
|
|
30
|
+
override.returns(
|
|
31
|
+
{ id: String, request_options: Dodopayments::RequestOptions }
|
|
32
|
+
)
|
|
33
|
+
end
|
|
34
|
+
def to_hash
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|