dodopayments 2.11.1 → 2.12.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.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +13 -0
  3. data/README.md +1 -1
  4. data/lib/dodopayments/models/balance_ledger_entry.rb +1 -0
  5. data/lib/dodopayments/models/balance_retrieve_ledger_params.rb +1 -0
  6. data/lib/dodopayments/models/discount.rb +4 -8
  7. data/lib/dodopayments/models/discount_create_params.rb +5 -9
  8. data/lib/dodopayments/models/discount_detail.rb +2 -2
  9. data/lib/dodopayments/models/discount_list_params.rb +2 -2
  10. data/lib/dodopayments/models/discount_update_params.rb +5 -8
  11. data/lib/dodopayments/models/payment.rb +11 -1
  12. data/lib/dodopayments/models/product_collection.rb +131 -1
  13. data/lib/dodopayments/models/product_collection_create_params.rb +123 -1
  14. data/lib/dodopayments/models/product_collection_update_params.rb +123 -1
  15. data/lib/dodopayments/resources/discounts.rb +5 -5
  16. data/lib/dodopayments/resources/product_collections.rb +28 -2
  17. data/lib/dodopayments/version.rb +1 -1
  18. data/rbi/dodopayments/models/balance_ledger_entry.rbi +5 -0
  19. data/rbi/dodopayments/models/balance_retrieve_ledger_params.rbi +5 -0
  20. data/rbi/dodopayments/models/discount.rbi +4 -12
  21. data/rbi/dodopayments/models/discount_create_params.rbi +6 -14
  22. data/rbi/dodopayments/models/discount_detail.rbi +2 -2
  23. data/rbi/dodopayments/models/discount_list_params.rbi +2 -2
  24. data/rbi/dodopayments/models/discount_update_params.rbi +6 -12
  25. data/rbi/dodopayments/models/payment.rbi +12 -0
  26. data/rbi/dodopayments/models/product_collection.rbi +307 -3
  27. data/rbi/dodopayments/models/product_collection_create_params.rbi +310 -0
  28. data/rbi/dodopayments/models/product_collection_update_params.rbi +310 -0
  29. data/rbi/dodopayments/resources/discounts.rbi +7 -14
  30. data/rbi/dodopayments/resources/product_collections.rbi +70 -0
  31. data/sig/dodopayments/models/balance_ledger_entry.rbs +2 -0
  32. data/sig/dodopayments/models/balance_retrieve_ledger_params.rbs +2 -0
  33. data/sig/dodopayments/models/payment.rbs +5 -0
  34. data/sig/dodopayments/models/product_collection.rbs +95 -3
  35. data/sig/dodopayments/models/product_collection_create_params.rbs +93 -1
  36. data/sig/dodopayments/models/product_collection_update_params.rbs +93 -1
  37. data/sig/dodopayments/resources/product_collections.rbs +10 -0
  38. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9e224196964664b93591a898f8390640d0ff9e22613e208a202c2c833b0491cb
4
- data.tar.gz: 98ff62533782d649096459522ebf13353fe1a6522a0082122efd015030819c1d
3
+ metadata.gz: e6eda2c9147c9984c31b3eee899f84de3ef99bc356303d408bea3f681fa7a269
4
+ data.tar.gz: fc6eed411239443116d40fd3af2b39a8ef17d11ed1ca19587b230436254ab4c7
5
5
  SHA512:
6
- metadata.gz: 9da32f8d48166d335394141ce6757245ea4004c3d2b7e2c8b44c5d9a9a229121743ca754a8eb43c8fcf4500549e3212489b866bf734f7dcd1d5da6b29faf6860
7
- data.tar.gz: 05d28816be85935f90c12cf603090d8cd8ad23b23fda7ef3f3e788985889aafa37f9eb8d3812735855371a3acf538a67eb7ce1fbfdc18eda6c46adbc64881664
6
+ metadata.gz: 7e4e08a348185fd7a87109ce05e6928c16d9b7ff5ce573e8619667407282d4300eff1b689323003262f912183e5c699a127a51f14a7760d80ee9207c7cd51490
7
+ data.tar.gz: 3ccd198a7c54fdac2c6df08f4365eaef867991f8f53dd106d659d72b4603dfd68def3d8c168af17ca8990e9c53d6c9055e221476614ed041f1d1a2480afbdbab
data/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.12.0](https://github.com/dodopayments/dodopayments-ruby/compare/v2.11.1...v2.12.0) (2026-06-01)
4
+
5
+
6
+ ### Features
7
+
8
+ * **api:** regenerate SDK from latest OpenAPI spec (1.101.0) ([89eb2dd](https://github.com/dodopayments/dodopayments-ruby/commit/89eb2dd3ba7d768a18e7c6fd5d01208e1797111d))
9
+
10
+
11
+ ### Chores
12
+
13
+ * re-seal custom code for 1.101.0 spec (python/go/typescript/kotlin/ruby/php) ([0d504b6](https://github.com/dodopayments/dodopayments-ruby/commit/0d504b65f0563ad1af89ce13f7e6e825b2528efd))
14
+ * release 2.12.0 ([c17c8a5](https://github.com/dodopayments/dodopayments-ruby/commit/c17c8a5ca1f104234733babc117e3d272724be25))
15
+
3
16
  ## [2.11.1](https://github.com/dodopayments/dodopayments-ruby/compare/v2.11.0...v2.11.1) (2026-06-01)
4
17
 
5
18
 
data/README.md CHANGED
@@ -26,7 +26,7 @@ To use this gem, install via Bundler by adding the following to your application
26
26
  <!-- x-release-please-start-version -->
27
27
 
28
28
  ```ruby
29
- gem "dodopayments", "~> 2.11.1"
29
+ gem "dodopayments", "~> 2.12.0"
30
30
  ```
31
31
 
32
32
  <!-- x-release-please-end -->
@@ -102,6 +102,7 @@ module Dodopayments
102
102
  CURRENCY_CONVERSION = :currency_conversion
103
103
  ABANDONED_CART_RECOVERY_FEE = :abandoned_cart_recovery_fee
104
104
  DUNNING_FEES = :dunning_fees
105
+ PAYMENT_RETRY_FEE = :payment_retry_fee
105
106
 
106
107
  # @!method self.values
107
108
  # @return [Array<Symbol>]
@@ -255,6 +255,7 @@ module Dodopayments
255
255
  CURRENCY_CONVERSION = :currency_conversion
256
256
  ABANDONED_CART_RECOVERY_FEE = :abandoned_cart_recovery_fee
257
257
  DUNNING_FEES = :dunning_fees
258
+ PAYMENT_RETRY_FEE = :payment_retry_fee
258
259
 
259
260
  # @!method self.values
260
261
  # @return [Array<Symbol>]
@@ -5,11 +5,7 @@ module Dodopayments
5
5
  # @see Dodopayments::Resources::Discounts#create
6
6
  class Discount < Dodopayments::Internal::Type::BaseModel
7
7
  # @!attribute amount
8
- # The discount amount.
9
- #
10
- # - If `discount_type` is `percentage`, this is in **basis points** (e.g., 540 =>
11
- # 5.4%).
12
- # - Otherwise, this is **USD cents** (e.g., 100 => `$1.00`).
8
+ # The discount amount in **basis points** (e.g., 540 => 5.4%).
13
9
  #
14
10
  # @return [Integer]
15
11
  required :amount, Integer
@@ -63,7 +59,7 @@ module Dodopayments
63
59
  required :times_used, Integer
64
60
 
65
61
  # @!attribute type
66
- # The type of discount, e.g. `percentage`, `flat`, or `flat_per_unit`.
62
+ # The type of discount. Currently only `percentage` is supported.
67
63
  #
68
64
  # @return [Symbol, Dodopayments::Models::DiscountType]
69
65
  required :type, enum: -> { Dodopayments::DiscountType }
@@ -98,7 +94,7 @@ module Dodopayments
98
94
  # Some parameter documentations has been truncated, see
99
95
  # {Dodopayments::Models::Discount} for more details.
100
96
  #
101
- # @param amount [Integer] The discount amount.
97
+ # @param amount [Integer] The discount amount in **basis points** (e.g., 540 => 5.4%).
102
98
  #
103
99
  # @param business_id [String] The business this discount belongs to.
104
100
  #
@@ -116,7 +112,7 @@ module Dodopayments
116
112
  #
117
113
  # @param times_used [Integer] How many times this discount has been used.
118
114
  #
119
- # @param type [Symbol, Dodopayments::Models::DiscountType] The type of discount, e.g. `percentage`, `flat`, or `flat_per_unit`.
115
+ # @param type [Symbol, Dodopayments::Models::DiscountType] The type of discount. Currently only `percentage` is supported.
120
116
  #
121
117
  # @param expires_at [Time, nil] Optional date/time after which discount is expired.
122
118
  #
@@ -8,12 +8,8 @@ module Dodopayments
8
8
  include Dodopayments::Internal::Type::RequestParameters
9
9
 
10
10
  # @!attribute amount
11
- # The discount amount.
12
- #
13
- # - If `discount_type` is **not** `percentage`, `amount` is in **USD cents**. For
14
- # example, `100` means `$1.00`. Only USD is allowed.
15
- # - If `discount_type` **is** `percentage`, `amount` is in **basis points**. For
16
- # example, `540` means `5.4%`.
11
+ # The discount amount in **basis points** (e.g. `540` means `5.4%`, `10000` means
12
+ # `100%`).
17
13
  #
18
14
  # Must be at least 1.
19
15
  #
@@ -21,7 +17,7 @@ module Dodopayments
21
17
  required :amount, Integer
22
18
 
23
19
  # @!attribute type
24
- # The discount type (e.g. `percentage`, `flat`, or `flat_per_unit`).
20
+ # The discount type. Currently only `percentage` is supported.
25
21
  #
26
22
  # @return [Symbol, Dodopayments::Models::DiscountType]
27
23
  required :type, enum: -> { Dodopayments::DiscountType }
@@ -83,9 +79,9 @@ module Dodopayments
83
79
  # Some parameter documentations has been truncated, see
84
80
  # {Dodopayments::Models::DiscountCreateParams} for more details.
85
81
  #
86
- # @param amount [Integer] The discount amount.
82
+ # @param amount [Integer] The discount amount in **basis points** (e.g. `540` means `5.4%`, `10000` means
87
83
  #
88
- # @param type [Symbol, Dodopayments::Models::DiscountType] The discount type (e.g. `percentage`, `flat`, or `flat_per_unit`).
84
+ # @param type [Symbol, Dodopayments::Models::DiscountType] The discount type. Currently only `percentage` is supported.
89
85
  #
90
86
  # @param code [String, nil] Optionally supply a code (will be uppercased).
91
87
  #
@@ -4,7 +4,7 @@ module Dodopayments
4
4
  module Models
5
5
  class DiscountDetail < Dodopayments::Internal::Type::BaseModel
6
6
  # @!attribute amount
7
- # The discount amount (basis points for percentage, USD cents for flat)
7
+ # The discount amount in **basis points** (e.g., 540 => 5.4%).
8
8
  #
9
9
  # @return [Integer]
10
10
  required :amount, Integer
@@ -107,7 +107,7 @@ module Dodopayments
107
107
  # Response struct for a discount with its position in a stack and optional
108
108
  # cycle-tracking information (for subscriptions).
109
109
  #
110
- # @param amount [Integer] The discount amount (basis points for percentage, USD cents for flat)
110
+ # @param amount [Integer] The discount amount in **basis points** (e.g., 540 => 5.4%).
111
111
  #
112
112
  # @param business_id [String] The business this discount belongs to
113
113
  #
@@ -20,7 +20,7 @@ module Dodopayments
20
20
  optional :code, String
21
21
 
22
22
  # @!attribute discount_type
23
- # Filter by discount type (percentage)
23
+ # Filter by discount type
24
24
  #
25
25
  # @return [Symbol, Dodopayments::Models::DiscountType, nil]
26
26
  optional :discount_type, enum: -> { Dodopayments::DiscountType }
@@ -48,7 +48,7 @@ module Dodopayments
48
48
  #
49
49
  # @param code [String] Filter by discount code (partial match, case-insensitive)
50
50
  #
51
- # @param discount_type [Symbol, Dodopayments::Models::DiscountType] Filter by discount type (percentage)
51
+ # @param discount_type [Symbol, Dodopayments::Models::DiscountType] Filter by discount type
52
52
  #
53
53
  # @param page_number [Integer] Page number (default = 0).
54
54
  #
@@ -13,11 +13,8 @@ module Dodopayments
13
13
  required :discount_id, String
14
14
 
15
15
  # @!attribute amount
16
- # If present, update the discount amount:
17
- #
18
- # - If `discount_type` is `percentage`, this represents **basis points** (e.g.,
19
- # `540` = `5.4%`).
20
- # - Otherwise, this represents **USD cents** (e.g., `100` = `$1.00`).
16
+ # If present, update the discount amount in **basis points** (e.g., `540` =
17
+ # `5.4%`, `10000` = `100%`).
21
18
  #
22
19
  # Must be at least 1 if provided.
23
20
  #
@@ -69,7 +66,7 @@ module Dodopayments
69
66
  optional :subscription_cycles, Integer, nil?: true
70
67
 
71
68
  # @!attribute type
72
- # If present, update the discount type.
69
+ # If present, update the discount type. Currently only `percentage` is supported.
73
70
  #
74
71
  # @return [Symbol, Dodopayments::Models::DiscountType, nil]
75
72
  optional :type, enum: -> { Dodopayments::DiscountType }, nil?: true
@@ -85,7 +82,7 @@ module Dodopayments
85
82
  #
86
83
  # @param discount_id [String]
87
84
  #
88
- # @param amount [Integer, nil] If present, update the discount amount:
85
+ # @param amount [Integer, nil] If present, update the discount amount in **basis points** (e.g., `540` = `5.4%`
89
86
  #
90
87
  # @param code [String, nil] If present, update the discount code (uppercase).
91
88
  #
@@ -101,7 +98,7 @@ module Dodopayments
101
98
  #
102
99
  # @param subscription_cycles [Integer, nil] Number of subscription billing cycles this discount is valid for.
103
100
  #
104
- # @param type [Symbol, Dodopayments::Models::DiscountType, nil] If present, update the discount type.
101
+ # @param type [Symbol, Dodopayments::Models::DiscountType, nil] If present, update the discount type. Currently only `percentage` is supported.
105
102
  #
106
103
  # @param usage_limit [Integer, nil]
107
104
  #
@@ -70,6 +70,14 @@ module Dodopayments
70
70
  # @return [Array<Dodopayments::Models::RefundListItem>]
71
71
  required :refunds, -> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::RefundListItem] }
72
72
 
73
+ # @!attribute retry_attempt
74
+ # Retry attempt number for subscription renewal payments. `0` for the original
75
+ # payment, `1`+ for each scheduled off-session retry after a failed renewal.
76
+ # Always `0` for non-subscription payments.
77
+ #
78
+ # @return [Integer]
79
+ required :retry_attempt, Integer
80
+
73
81
  # @!attribute settlement_amount
74
82
  # The amount that will be credited to your Dodo balance after currency conversion
75
83
  # and processing. Especially relevant for adaptive pricing where the customer's
@@ -243,7 +251,7 @@ module Dodopayments
243
251
  # @return [Time, nil]
244
252
  optional :updated_at, Time, nil?: true
245
253
 
246
- # @!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, custom_field_responses: nil, discount_id: nil, discounts: 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, refund_status: nil, settlement_tax: nil, status: nil, subscription_id: nil, tax: nil, updated_at: nil)
254
+ # @!method initialize(billing:, brand_id:, business_id:, created_at:, currency:, customer:, digital_products_delivered:, disputes:, metadata:, payment_id:, refunds:, retry_attempt:, 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, custom_field_responses: nil, discount_id: nil, discounts: 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, refund_status: nil, settlement_tax: nil, status: nil, subscription_id: nil, tax: nil, updated_at: nil)
247
255
  # Some parameter documentations has been truncated, see
248
256
  # {Dodopayments::Models::Payment} for more details.
249
257
  #
@@ -269,6 +277,8 @@ module Dodopayments
269
277
  #
270
278
  # @param refunds [Array<Dodopayments::Models::RefundListItem>] List of refunds issued for this payment
271
279
  #
280
+ # @param retry_attempt [Integer] Retry attempt number for subscription renewal payments.
281
+ #
272
282
  # @param settlement_amount [Integer] The amount that will be credited to your Dodo balance after currency conversion
273
283
  #
274
284
  # @param settlement_currency [Symbol, Dodopayments::Models::Currency] The currency in which the settlement_amount will be credited to your Dodo balanc
@@ -47,13 +47,59 @@ module Dodopayments
47
47
  # @return [String, nil]
48
48
  optional :description, String, nil?: true
49
49
 
50
+ # @!attribute effective_at_on_downgrade
51
+ # Default effective_at setting for subscription plan downgrades (null = inherit
52
+ # from business)
53
+ #
54
+ # @return [Symbol, Dodopayments::Models::ProductCollection::EffectiveAtOnDowngrade, nil]
55
+ optional :effective_at_on_downgrade,
56
+ enum: -> { Dodopayments::ProductCollection::EffectiveAtOnDowngrade },
57
+ nil?: true
58
+
59
+ # @!attribute effective_at_on_upgrade
60
+ # Default effective_at setting for subscription plan upgrades (null = inherit from
61
+ # business)
62
+ #
63
+ # @return [Symbol, Dodopayments::Models::ProductCollection::EffectiveAtOnUpgrade, nil]
64
+ optional :effective_at_on_upgrade,
65
+ enum: -> { Dodopayments::ProductCollection::EffectiveAtOnUpgrade },
66
+ nil?: true
67
+
50
68
  # @!attribute image
51
69
  # URL of the collection image
52
70
  #
53
71
  # @return [String, nil]
54
72
  optional :image, String, nil?: true
55
73
 
56
- # @!method initialize(id:, brand_id:, created_at:, groups:, name:, updated_at:, description: nil, image: nil)
74
+ # @!attribute on_payment_failure
75
+ # Default behavior for subscription plan changes on payment failure (null =
76
+ # inherit from business)
77
+ #
78
+ # @return [Symbol, Dodopayments::Models::ProductCollection::OnPaymentFailure, nil]
79
+ optional :on_payment_failure, enum: -> { Dodopayments::ProductCollection::OnPaymentFailure }, nil?: true
80
+
81
+ # @!attribute proration_billing_mode_on_downgrade
82
+ # Default proration billing mode for subscription plan downgrades (null = inherit
83
+ # from business)
84
+ #
85
+ # @return [Symbol, Dodopayments::Models::ProductCollection::ProrationBillingModeOnDowngrade, nil]
86
+ optional :proration_billing_mode_on_downgrade,
87
+ enum: -> { Dodopayments::ProductCollection::ProrationBillingModeOnDowngrade },
88
+ nil?: true
89
+
90
+ # @!attribute proration_billing_mode_on_upgrade
91
+ # Default proration billing mode for subscription plan upgrades (null = inherit
92
+ # from business)
93
+ #
94
+ # @return [Symbol, Dodopayments::Models::ProductCollection::ProrationBillingModeOnUpgrade, nil]
95
+ optional :proration_billing_mode_on_upgrade,
96
+ enum: -> { Dodopayments::ProductCollection::ProrationBillingModeOnUpgrade },
97
+ nil?: true
98
+
99
+ # @!method initialize(id:, brand_id:, created_at:, groups:, name:, updated_at:, description: nil, effective_at_on_downgrade: nil, effective_at_on_upgrade: nil, image: nil, on_payment_failure: nil, proration_billing_mode_on_downgrade: nil, proration_billing_mode_on_upgrade: nil)
100
+ # Some parameter documentations has been truncated, see
101
+ # {Dodopayments::Models::ProductCollection} for more details.
102
+ #
57
103
  # @param id [String] Unique identifier for the product collection
58
104
  #
59
105
  # @param brand_id [String] Brand ID for the collection
@@ -68,7 +114,91 @@ module Dodopayments
68
114
  #
69
115
  # @param description [String, nil] Description of the collection
70
116
  #
117
+ # @param effective_at_on_downgrade [Symbol, Dodopayments::Models::ProductCollection::EffectiveAtOnDowngrade, nil] Default effective_at setting for subscription plan downgrades (null = inherit fr
118
+ #
119
+ # @param effective_at_on_upgrade [Symbol, Dodopayments::Models::ProductCollection::EffectiveAtOnUpgrade, nil] Default effective_at setting for subscription plan upgrades (null = inherit from
120
+ #
71
121
  # @param image [String, nil] URL of the collection image
122
+ #
123
+ # @param on_payment_failure [Symbol, Dodopayments::Models::ProductCollection::OnPaymentFailure, nil] Default behavior for subscription plan changes on payment failure (null = inheri
124
+ #
125
+ # @param proration_billing_mode_on_downgrade [Symbol, Dodopayments::Models::ProductCollection::ProrationBillingModeOnDowngrade, nil] Default proration billing mode for subscription plan downgrades (null = inherit
126
+ #
127
+ # @param proration_billing_mode_on_upgrade [Symbol, Dodopayments::Models::ProductCollection::ProrationBillingModeOnUpgrade, nil] Default proration billing mode for subscription plan upgrades (null = inherit fr
128
+
129
+ # Default effective_at setting for subscription plan downgrades (null = inherit
130
+ # from business)
131
+ #
132
+ # @see Dodopayments::Models::ProductCollection#effective_at_on_downgrade
133
+ module EffectiveAtOnDowngrade
134
+ extend Dodopayments::Internal::Type::Enum
135
+
136
+ IMMEDIATELY = :immediately
137
+ NEXT_BILLING_DATE = :next_billing_date
138
+
139
+ # @!method self.values
140
+ # @return [Array<Symbol>]
141
+ end
142
+
143
+ # Default effective_at setting for subscription plan upgrades (null = inherit from
144
+ # business)
145
+ #
146
+ # @see Dodopayments::Models::ProductCollection#effective_at_on_upgrade
147
+ module EffectiveAtOnUpgrade
148
+ extend Dodopayments::Internal::Type::Enum
149
+
150
+ IMMEDIATELY = :immediately
151
+ NEXT_BILLING_DATE = :next_billing_date
152
+
153
+ # @!method self.values
154
+ # @return [Array<Symbol>]
155
+ end
156
+
157
+ # Default behavior for subscription plan changes on payment failure (null =
158
+ # inherit from business)
159
+ #
160
+ # @see Dodopayments::Models::ProductCollection#on_payment_failure
161
+ module OnPaymentFailure
162
+ extend Dodopayments::Internal::Type::Enum
163
+
164
+ PREVENT_CHANGE = :prevent_change
165
+ APPLY_CHANGE = :apply_change
166
+
167
+ # @!method self.values
168
+ # @return [Array<Symbol>]
169
+ end
170
+
171
+ # Default proration billing mode for subscription plan downgrades (null = inherit
172
+ # from business)
173
+ #
174
+ # @see Dodopayments::Models::ProductCollection#proration_billing_mode_on_downgrade
175
+ module ProrationBillingModeOnDowngrade
176
+ extend Dodopayments::Internal::Type::Enum
177
+
178
+ PRORATED_IMMEDIATELY = :prorated_immediately
179
+ FULL_IMMEDIATELY = :full_immediately
180
+ DIFFERENCE_IMMEDIATELY = :difference_immediately
181
+ DO_NOT_BILL = :do_not_bill
182
+
183
+ # @!method self.values
184
+ # @return [Array<Symbol>]
185
+ end
186
+
187
+ # Default proration billing mode for subscription plan upgrades (null = inherit
188
+ # from business)
189
+ #
190
+ # @see Dodopayments::Models::ProductCollection#proration_billing_mode_on_upgrade
191
+ module ProrationBillingModeOnUpgrade
192
+ extend Dodopayments::Internal::Type::Enum
193
+
194
+ PRORATED_IMMEDIATELY = :prorated_immediately
195
+ FULL_IMMEDIATELY = :full_immediately
196
+ DIFFERENCE_IMMEDIATELY = :difference_immediately
197
+ DO_NOT_BILL = :do_not_bill
198
+
199
+ # @!method self.values
200
+ # @return [Array<Symbol>]
201
+ end
72
202
  end
73
203
  end
74
204
  end
@@ -32,7 +32,55 @@ module Dodopayments
32
32
  # @return [String, nil]
33
33
  optional :description, String, nil?: true
34
34
 
35
- # @!method initialize(groups:, name:, brand_id: nil, description: nil, request_options: {})
35
+ # @!attribute effective_at_on_downgrade
36
+ # Default effective_at setting for subscription plan downgrades (NULL = inherit
37
+ # from business)
38
+ #
39
+ # @return [Symbol, Dodopayments::Models::ProductCollectionCreateParams::EffectiveAtOnDowngrade, nil]
40
+ optional :effective_at_on_downgrade,
41
+ enum: -> { Dodopayments::ProductCollectionCreateParams::EffectiveAtOnDowngrade },
42
+ nil?: true
43
+
44
+ # @!attribute effective_at_on_upgrade
45
+ # Default effective_at setting for subscription plan upgrades (NULL = inherit from
46
+ # business)
47
+ #
48
+ # @return [Symbol, Dodopayments::Models::ProductCollectionCreateParams::EffectiveAtOnUpgrade, nil]
49
+ optional :effective_at_on_upgrade,
50
+ enum: -> { Dodopayments::ProductCollectionCreateParams::EffectiveAtOnUpgrade },
51
+ nil?: true
52
+
53
+ # @!attribute on_payment_failure
54
+ # Default behavior for subscription plan changes on payment failure (NULL =
55
+ # inherit from business)
56
+ #
57
+ # @return [Symbol, Dodopayments::Models::ProductCollectionCreateParams::OnPaymentFailure, nil]
58
+ optional :on_payment_failure,
59
+ enum: -> { Dodopayments::ProductCollectionCreateParams::OnPaymentFailure },
60
+ nil?: true
61
+
62
+ # @!attribute proration_billing_mode_on_downgrade
63
+ # Default proration billing mode for subscription plan downgrades (NULL = inherit
64
+ # from business)
65
+ #
66
+ # @return [Symbol, Dodopayments::Models::ProductCollectionCreateParams::ProrationBillingModeOnDowngrade, nil]
67
+ optional :proration_billing_mode_on_downgrade,
68
+ enum: -> { Dodopayments::ProductCollectionCreateParams::ProrationBillingModeOnDowngrade },
69
+ nil?: true
70
+
71
+ # @!attribute proration_billing_mode_on_upgrade
72
+ # Default proration billing mode for subscription plan upgrades (NULL = inherit
73
+ # from business)
74
+ #
75
+ # @return [Symbol, Dodopayments::Models::ProductCollectionCreateParams::ProrationBillingModeOnUpgrade, nil]
76
+ optional :proration_billing_mode_on_upgrade,
77
+ enum: -> { Dodopayments::ProductCollectionCreateParams::ProrationBillingModeOnUpgrade },
78
+ nil?: true
79
+
80
+ # @!method initialize(groups:, name:, brand_id: nil, description: nil, effective_at_on_downgrade: nil, effective_at_on_upgrade: nil, on_payment_failure: nil, proration_billing_mode_on_downgrade: nil, proration_billing_mode_on_upgrade: nil, request_options: {})
81
+ # Some parameter documentations has been truncated, see
82
+ # {Dodopayments::Models::ProductCollectionCreateParams} for more details.
83
+ #
36
84
  # @param groups [Array<Dodopayments::Models::ProductCollections::ProductCollectionGroupDetails>] Groups of products in this collection
37
85
  #
38
86
  # @param name [String] Name of the product collection
@@ -41,7 +89,81 @@ module Dodopayments
41
89
  #
42
90
  # @param description [String, nil] Optional description of the product collection
43
91
  #
92
+ # @param effective_at_on_downgrade [Symbol, Dodopayments::Models::ProductCollectionCreateParams::EffectiveAtOnDowngrade, nil] Default effective_at setting for subscription plan downgrades (NULL = inherit fr
93
+ #
94
+ # @param effective_at_on_upgrade [Symbol, Dodopayments::Models::ProductCollectionCreateParams::EffectiveAtOnUpgrade, nil] Default effective_at setting for subscription plan upgrades (NULL = inherit from
95
+ #
96
+ # @param on_payment_failure [Symbol, Dodopayments::Models::ProductCollectionCreateParams::OnPaymentFailure, nil] Default behavior for subscription plan changes on payment failure (NULL = inheri
97
+ #
98
+ # @param proration_billing_mode_on_downgrade [Symbol, Dodopayments::Models::ProductCollectionCreateParams::ProrationBillingModeOnDowngrade, nil] Default proration billing mode for subscription plan downgrades (NULL = inherit
99
+ #
100
+ # @param proration_billing_mode_on_upgrade [Symbol, Dodopayments::Models::ProductCollectionCreateParams::ProrationBillingModeOnUpgrade, nil] Default proration billing mode for subscription plan upgrades (NULL = inherit fr
101
+ #
44
102
  # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
103
+
104
+ # Default effective_at setting for subscription plan downgrades (NULL = inherit
105
+ # from business)
106
+ module EffectiveAtOnDowngrade
107
+ extend Dodopayments::Internal::Type::Enum
108
+
109
+ IMMEDIATELY = :immediately
110
+ NEXT_BILLING_DATE = :next_billing_date
111
+
112
+ # @!method self.values
113
+ # @return [Array<Symbol>]
114
+ end
115
+
116
+ # Default effective_at setting for subscription plan upgrades (NULL = inherit from
117
+ # business)
118
+ module EffectiveAtOnUpgrade
119
+ extend Dodopayments::Internal::Type::Enum
120
+
121
+ IMMEDIATELY = :immediately
122
+ NEXT_BILLING_DATE = :next_billing_date
123
+
124
+ # @!method self.values
125
+ # @return [Array<Symbol>]
126
+ end
127
+
128
+ # Default behavior for subscription plan changes on payment failure (NULL =
129
+ # inherit from business)
130
+ module OnPaymentFailure
131
+ extend Dodopayments::Internal::Type::Enum
132
+
133
+ PREVENT_CHANGE = :prevent_change
134
+ APPLY_CHANGE = :apply_change
135
+
136
+ # @!method self.values
137
+ # @return [Array<Symbol>]
138
+ end
139
+
140
+ # Default proration billing mode for subscription plan downgrades (NULL = inherit
141
+ # from business)
142
+ module ProrationBillingModeOnDowngrade
143
+ extend Dodopayments::Internal::Type::Enum
144
+
145
+ PRORATED_IMMEDIATELY = :prorated_immediately
146
+ FULL_IMMEDIATELY = :full_immediately
147
+ DIFFERENCE_IMMEDIATELY = :difference_immediately
148
+ DO_NOT_BILL = :do_not_bill
149
+
150
+ # @!method self.values
151
+ # @return [Array<Symbol>]
152
+ end
153
+
154
+ # Default proration billing mode for subscription plan upgrades (NULL = inherit
155
+ # from business)
156
+ module ProrationBillingModeOnUpgrade
157
+ extend Dodopayments::Internal::Type::Enum
158
+
159
+ PRORATED_IMMEDIATELY = :prorated_immediately
160
+ FULL_IMMEDIATELY = :full_immediately
161
+ DIFFERENCE_IMMEDIATELY = :difference_immediately
162
+ DO_NOT_BILL = :do_not_bill
163
+
164
+ # @!method self.values
165
+ # @return [Array<Symbol>]
166
+ end
45
167
  end
46
168
  end
47
169
  end