dodopayments 2.31.0 → 2.32.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 +8 -0
- data/README.md +1 -1
- data/lib/dodopayments/models/refund.rb +1 -1
- data/lib/dodopayments/models/refund_list_item.rb +1 -1
- data/lib/dodopayments/models/update_subscription_plan_req.rb +37 -1
- data/lib/dodopayments/resources/subscriptions.rb +10 -2
- data/lib/dodopayments/version.rb +1 -1
- data/rbi/dodopayments/models/refund.rbi +2 -2
- data/rbi/dodopayments/models/refund_list_item.rbi +2 -2
- data/rbi/dodopayments/models/update_subscription_plan_req.rbi +62 -3
- data/rbi/dodopayments/resources/subscriptions.rbi +52 -0
- data/sig/dodopayments/models/update_subscription_plan_req.rbs +15 -3
- data/sig/dodopayments/resources/subscriptions.rbs +4 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2dd4dba4996639f045859e32a5187ada5f7725cc5c7c0055f800cb2c49935c3f
|
|
4
|
+
data.tar.gz: a2e9ce7d63c520af95f73a8a4b26318f903973402375e2b7e212e29a11233030
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 262e8aacde3b258e041f3d9b1ad3b6f34d16ef71a5e0c18153c2c2f15248ce381f5c04ff64aa3ee298a94790e93167e3758c7866f0f5c5ea35717243cea20901
|
|
7
|
+
data.tar.gz: babe2e389f26d85e678383f0a89457a38acd7d5222e29313a1a1117916fc5f9647bef1eb36dc0839f3f38e51b7fd06dbfe2ce69410ee3e8deb303541c9a47789
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [2.32.0](https://github.com/dodopayments/dodopayments-ruby/compare/v2.31.0...v2.32.0) (2026-10-06)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* **api:** change-plan cancel_older_payment_link and return_url ([ab42639](https://github.com/dodopayments/dodopayments-ruby/commit/ab42639341e3c3a4595df8792c706ac6cf13d9ce))
|
|
9
|
+
* **api:** change-plan cancel_older_payment_link and return_url ([2b46789](https://github.com/dodopayments/dodopayments-ruby/commit/2b46789c533195890369df6a54daf324b9c689f7))
|
|
10
|
+
|
|
3
11
|
## [2.31.0](https://github.com/dodopayments/dodopayments-ruby/compare/v2.30.0...v2.31.0) (2026-10-05)
|
|
4
12
|
|
|
5
13
|
|
data/README.md
CHANGED
|
@@ -73,7 +73,7 @@ module Dodopayments
|
|
|
73
73
|
# @!attribute network_reference
|
|
74
74
|
# The reference number that the card network or the bank gives to the refund. The
|
|
75
75
|
# customer can give this number to their bank to trace the refund. It is null
|
|
76
|
-
# until the
|
|
76
|
+
# until the reference is available.
|
|
77
77
|
#
|
|
78
78
|
# @return [String, nil]
|
|
79
79
|
optional :network_reference, String, nil?: true
|
|
@@ -54,7 +54,7 @@ module Dodopayments
|
|
|
54
54
|
# @!attribute network_reference
|
|
55
55
|
# The reference number that the card network or the bank gives to the refund. The
|
|
56
56
|
# customer can give this number to their bank to trace the refund. It is null
|
|
57
|
-
# until the
|
|
57
|
+
# until the reference is available.
|
|
58
58
|
#
|
|
59
59
|
# @return [String, nil]
|
|
60
60
|
optional :network_reference, String, nil?: true
|
|
@@ -36,6 +36,23 @@ module Dodopayments
|
|
|
36
36
|
# @return [Array<Dodopayments::Models::AttachAddon>, nil]
|
|
37
37
|
optional :addons, -> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::AttachAddon] }, nil?: true
|
|
38
38
|
|
|
39
|
+
# @!attribute cancel_older_payment_link
|
|
40
|
+
# Cancel the payment link of a pending plan change, so that this change can
|
|
41
|
+
# replace it.
|
|
42
|
+
#
|
|
43
|
+
# The link is cancelled only if the customer has not started to pay. A paid or
|
|
44
|
+
# in-progress payment gives a `409`. A failed cancel gives a `503`, and a retry is
|
|
45
|
+
# safe.
|
|
46
|
+
#
|
|
47
|
+
# The request is validated before the cancel. A later failure, for example an
|
|
48
|
+
# amount below the minimum, leaves the subscription on its current plan with no
|
|
49
|
+
# open link. A retry is safe.
|
|
50
|
+
#
|
|
51
|
+
# The preview route shares this request body and ignores this field.
|
|
52
|
+
#
|
|
53
|
+
# @return [Boolean, nil]
|
|
54
|
+
optional :cancel_older_payment_link, Dodopayments::Internal::Type::Boolean
|
|
55
|
+
|
|
39
56
|
# @!attribute cancel_scheduled_change_plan
|
|
40
57
|
# Replace a scheduled plan change with this one.
|
|
41
58
|
#
|
|
@@ -116,7 +133,22 @@ module Dodopayments
|
|
|
116
133
|
enum: -> { Dodopayments::UpdateSubscriptionPlanReq::OnPaymentFailure },
|
|
117
134
|
nil?: true
|
|
118
135
|
|
|
119
|
-
# @!
|
|
136
|
+
# @!attribute return_url
|
|
137
|
+
# The URL that receives the customer after they pay the payment link. Needs
|
|
138
|
+
# `collect_via_payment_link: true`. Without it, the request gets a `422`. A change
|
|
139
|
+
# that collects no money issues no link and does not use the URL. The preview
|
|
140
|
+
# route validates this field but does not use it.
|
|
141
|
+
#
|
|
142
|
+
# The redirect adds `subscription_id`, `payment_id` and `status`. The `status`
|
|
143
|
+
# value is the status of the plan-change payment. It is not the status of the
|
|
144
|
+
# subscription. When that payment fails, the subscription stays active on its
|
|
145
|
+
# current plan. To try again, call this endpoint again to get a new link. The new
|
|
146
|
+
# plan can apply after the redirect, when the payment webhook arrives.
|
|
147
|
+
#
|
|
148
|
+
# @return [String, nil]
|
|
149
|
+
optional :return_url, String, nil?: true
|
|
150
|
+
|
|
151
|
+
# @!method initialize(product_id:, proration_billing_mode:, quantity:, adaptive_currency_fees_inclusive: nil, addons: nil, cancel_older_payment_link: nil, cancel_scheduled_change_plan: nil, collect_via_payment_link: nil, discount_code: nil, discount_codes: nil, effective_at: nil, metadata: nil, on_payment_failure: nil, return_url: nil)
|
|
120
152
|
# Some parameter documentations has been truncated, see
|
|
121
153
|
# {Dodopayments::Models::UpdateSubscriptionPlanReq} for more details.
|
|
122
154
|
#
|
|
@@ -130,6 +162,8 @@ module Dodopayments
|
|
|
130
162
|
#
|
|
131
163
|
# @param addons [Array<Dodopayments::Models::AttachAddon>, nil] Addons for the new plan.
|
|
132
164
|
#
|
|
165
|
+
# @param cancel_older_payment_link [Boolean] Cancel the payment link of a pending plan change, so that this change
|
|
166
|
+
#
|
|
133
167
|
# @param cancel_scheduled_change_plan [Boolean] Replace a scheduled plan change with this one.
|
|
134
168
|
#
|
|
135
169
|
# @param collect_via_payment_link [Boolean] Collect the plan-change amount with a payment link. The customer then
|
|
@@ -143,6 +177,8 @@ module Dodopayments
|
|
|
143
177
|
# @param metadata [Hash{Symbol=>String, Float, Boolean}, nil] Metadata for the payment. If not passed, the metadata of the subscription will b
|
|
144
178
|
#
|
|
145
179
|
# @param on_payment_failure [Symbol, Dodopayments::Models::UpdateSubscriptionPlanReq::OnPaymentFailure, nil] Controls behavior when the plan change payment fails.
|
|
180
|
+
#
|
|
181
|
+
# @param return_url [String, nil] The URL that receives the customer after they pay the payment link.
|
|
146
182
|
|
|
147
183
|
# Proration Billing Mode
|
|
148
184
|
#
|
|
@@ -209,7 +209,7 @@ module Dodopayments
|
|
|
209
209
|
# Some parameter documentations has been truncated, see
|
|
210
210
|
# {Dodopayments::Models::SubscriptionChangePlanParams} for more details.
|
|
211
211
|
#
|
|
212
|
-
# @overload change_plan(subscription_id, product_id:, proration_billing_mode:, quantity:, adaptive_currency_fees_inclusive: nil, addons: nil, cancel_scheduled_change_plan: nil, collect_via_payment_link: nil, discount_code: nil, discount_codes: nil, effective_at: nil, metadata: nil, on_payment_failure: nil, request_options: {})
|
|
212
|
+
# @overload change_plan(subscription_id, product_id:, proration_billing_mode:, quantity:, adaptive_currency_fees_inclusive: nil, addons: nil, cancel_older_payment_link: nil, cancel_scheduled_change_plan: nil, collect_via_payment_link: nil, discount_code: nil, discount_codes: nil, effective_at: nil, metadata: nil, on_payment_failure: nil, return_url: nil, request_options: {})
|
|
213
213
|
#
|
|
214
214
|
# @param subscription_id [String] Subscription Id
|
|
215
215
|
#
|
|
@@ -223,6 +223,8 @@ module Dodopayments
|
|
|
223
223
|
#
|
|
224
224
|
# @param addons [Array<Dodopayments::Models::AttachAddon>, nil] Addons for the new plan.
|
|
225
225
|
#
|
|
226
|
+
# @param cancel_older_payment_link [Boolean] Cancel the payment link of a pending plan change, so that this change
|
|
227
|
+
#
|
|
226
228
|
# @param cancel_scheduled_change_plan [Boolean] Replace a scheduled plan change with this one.
|
|
227
229
|
#
|
|
228
230
|
# @param collect_via_payment_link [Boolean] Collect the plan-change amount with a payment link. The customer then
|
|
@@ -237,6 +239,8 @@ module Dodopayments
|
|
|
237
239
|
#
|
|
238
240
|
# @param on_payment_failure [Symbol, Dodopayments::Models::UpdateSubscriptionPlanReq::OnPaymentFailure, nil] Controls behavior when the plan change payment fails.
|
|
239
241
|
#
|
|
242
|
+
# @param return_url [String, nil] The URL that receives the customer after they pay the payment link.
|
|
243
|
+
#
|
|
240
244
|
# @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
241
245
|
#
|
|
242
246
|
# @return [Dodopayments::Models::SubscriptionChangePlanResponse]
|
|
@@ -291,7 +295,7 @@ module Dodopayments
|
|
|
291
295
|
# Some parameter documentations has been truncated, see
|
|
292
296
|
# {Dodopayments::Models::SubscriptionPreviewChangePlanParams} for more details.
|
|
293
297
|
#
|
|
294
|
-
# @overload preview_change_plan(subscription_id, product_id:, proration_billing_mode:, quantity:, adaptive_currency_fees_inclusive: nil, addons: nil, cancel_scheduled_change_plan: nil, collect_via_payment_link: nil, discount_code: nil, discount_codes: nil, effective_at: nil, metadata: nil, on_payment_failure: nil, request_options: {})
|
|
298
|
+
# @overload preview_change_plan(subscription_id, product_id:, proration_billing_mode:, quantity:, adaptive_currency_fees_inclusive: nil, addons: nil, cancel_older_payment_link: nil, cancel_scheduled_change_plan: nil, collect_via_payment_link: nil, discount_code: nil, discount_codes: nil, effective_at: nil, metadata: nil, on_payment_failure: nil, return_url: nil, request_options: {})
|
|
295
299
|
#
|
|
296
300
|
# @param subscription_id [String] Subscription Id
|
|
297
301
|
#
|
|
@@ -305,6 +309,8 @@ module Dodopayments
|
|
|
305
309
|
#
|
|
306
310
|
# @param addons [Array<Dodopayments::Models::AttachAddon>, nil] Addons for the new plan.
|
|
307
311
|
#
|
|
312
|
+
# @param cancel_older_payment_link [Boolean] Cancel the payment link of a pending plan change, so that this change
|
|
313
|
+
#
|
|
308
314
|
# @param cancel_scheduled_change_plan [Boolean] Replace a scheduled plan change with this one.
|
|
309
315
|
#
|
|
310
316
|
# @param collect_via_payment_link [Boolean] Collect the plan-change amount with a payment link. The customer then
|
|
@@ -319,6 +325,8 @@ module Dodopayments
|
|
|
319
325
|
#
|
|
320
326
|
# @param on_payment_failure [Symbol, Dodopayments::Models::UpdateSubscriptionPlanReq::OnPaymentFailure, nil] Controls behavior when the plan change payment fails.
|
|
321
327
|
#
|
|
328
|
+
# @param return_url [String, nil] The URL that receives the customer after they pay the payment link.
|
|
329
|
+
#
|
|
322
330
|
# @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
323
331
|
#
|
|
324
332
|
# @return [Dodopayments::Models::SubscriptionPreviewChangePlanResponse]
|
data/lib/dodopayments/version.rb
CHANGED
|
@@ -59,7 +59,7 @@ module Dodopayments
|
|
|
59
59
|
|
|
60
60
|
# The reference number that the card network or the bank gives to the refund. The
|
|
61
61
|
# customer can give this number to their bank to trace the refund. It is null
|
|
62
|
-
# until the
|
|
62
|
+
# until the reference is available.
|
|
63
63
|
sig { returns(T.nilable(String)) }
|
|
64
64
|
attr_accessor :network_reference
|
|
65
65
|
|
|
@@ -119,7 +119,7 @@ module Dodopayments
|
|
|
119
119
|
currency: nil,
|
|
120
120
|
# The reference number that the card network or the bank gives to the refund. The
|
|
121
121
|
# customer can give this number to their bank to trace the refund. It is null
|
|
122
|
-
# until the
|
|
122
|
+
# until the reference is available.
|
|
123
123
|
network_reference: nil,
|
|
124
124
|
# The kind of `network_reference`: ARN, STAN or RRN.
|
|
125
125
|
network_reference_type: nil,
|
|
@@ -42,7 +42,7 @@ module Dodopayments
|
|
|
42
42
|
|
|
43
43
|
# The reference number that the card network or the bank gives to the refund. The
|
|
44
44
|
# customer can give this number to their bank to trace the refund. It is null
|
|
45
|
-
# until the
|
|
45
|
+
# until the reference is available.
|
|
46
46
|
sig { returns(T.nilable(String)) }
|
|
47
47
|
attr_accessor :network_reference
|
|
48
48
|
|
|
@@ -93,7 +93,7 @@ module Dodopayments
|
|
|
93
93
|
currency: nil,
|
|
94
94
|
# The reference number that the card network or the bank gives to the refund. The
|
|
95
95
|
# customer can give this number to their bank to trace the refund. It is null
|
|
96
|
-
# until the
|
|
96
|
+
# until the reference is available.
|
|
97
97
|
network_reference: nil,
|
|
98
98
|
# The kind of `network_reference`: ARN, STAN or RRN.
|
|
99
99
|
network_reference_type: nil,
|
|
@@ -37,6 +37,24 @@ module Dodopayments
|
|
|
37
37
|
sig { returns(T.nilable(T::Array[Dodopayments::AttachAddon])) }
|
|
38
38
|
attr_accessor :addons
|
|
39
39
|
|
|
40
|
+
# Cancel the payment link of a pending plan change, so that this change can
|
|
41
|
+
# replace it.
|
|
42
|
+
#
|
|
43
|
+
# The link is cancelled only if the customer has not started to pay. A paid or
|
|
44
|
+
# in-progress payment gives a `409`. A failed cancel gives a `503`, and a retry is
|
|
45
|
+
# safe.
|
|
46
|
+
#
|
|
47
|
+
# The request is validated before the cancel. A later failure, for example an
|
|
48
|
+
# amount below the minimum, leaves the subscription on its current plan with no
|
|
49
|
+
# open link. A retry is safe.
|
|
50
|
+
#
|
|
51
|
+
# The preview route shares this request body and ignores this field.
|
|
52
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
53
|
+
attr_reader :cancel_older_payment_link
|
|
54
|
+
|
|
55
|
+
sig { params(cancel_older_payment_link: T::Boolean).void }
|
|
56
|
+
attr_writer :cancel_older_payment_link
|
|
57
|
+
|
|
40
58
|
# Replace a scheduled plan change with this one.
|
|
41
59
|
#
|
|
42
60
|
# The scheduled change is cancelled by the transaction that applies this change. A
|
|
@@ -127,6 +145,19 @@ module Dodopayments
|
|
|
127
145
|
end
|
|
128
146
|
attr_accessor :on_payment_failure
|
|
129
147
|
|
|
148
|
+
# The URL that receives the customer after they pay the payment link. Needs
|
|
149
|
+
# `collect_via_payment_link: true`. Without it, the request gets a `422`. A change
|
|
150
|
+
# that collects no money issues no link and does not use the URL. The preview
|
|
151
|
+
# route validates this field but does not use it.
|
|
152
|
+
#
|
|
153
|
+
# The redirect adds `subscription_id`, `payment_id` and `status`. The `status`
|
|
154
|
+
# value is the status of the plan-change payment. It is not the status of the
|
|
155
|
+
# subscription. When that payment fails, the subscription stays active on its
|
|
156
|
+
# current plan. To try again, call this endpoint again to get a new link. The new
|
|
157
|
+
# plan can apply after the redirect, when the payment webhook arrives.
|
|
158
|
+
sig { returns(T.nilable(String)) }
|
|
159
|
+
attr_accessor :return_url
|
|
160
|
+
|
|
130
161
|
sig do
|
|
131
162
|
params(
|
|
132
163
|
product_id: String,
|
|
@@ -135,6 +166,7 @@ module Dodopayments
|
|
|
135
166
|
quantity: Integer,
|
|
136
167
|
adaptive_currency_fees_inclusive: T.nilable(T::Boolean),
|
|
137
168
|
addons: T.nilable(T::Array[Dodopayments::AttachAddon::OrHash]),
|
|
169
|
+
cancel_older_payment_link: T::Boolean,
|
|
138
170
|
cancel_scheduled_change_plan: T::Boolean,
|
|
139
171
|
collect_via_payment_link: T::Boolean,
|
|
140
172
|
discount_code: T.nilable(String),
|
|
@@ -146,7 +178,8 @@ module Dodopayments
|
|
|
146
178
|
on_payment_failure:
|
|
147
179
|
T.nilable(
|
|
148
180
|
Dodopayments::UpdateSubscriptionPlanReq::OnPaymentFailure::OrSymbol
|
|
149
|
-
)
|
|
181
|
+
),
|
|
182
|
+
return_url: T.nilable(String)
|
|
150
183
|
).returns(T.attached_class)
|
|
151
184
|
end
|
|
152
185
|
def self.new(
|
|
@@ -162,6 +195,19 @@ module Dodopayments
|
|
|
162
195
|
# Addons for the new plan. Note : Leaving this empty would remove any existing
|
|
163
196
|
# addons
|
|
164
197
|
addons: nil,
|
|
198
|
+
# Cancel the payment link of a pending plan change, so that this change can
|
|
199
|
+
# replace it.
|
|
200
|
+
#
|
|
201
|
+
# The link is cancelled only if the customer has not started to pay. A paid or
|
|
202
|
+
# in-progress payment gives a `409`. A failed cancel gives a `503`, and a retry is
|
|
203
|
+
# safe.
|
|
204
|
+
#
|
|
205
|
+
# The request is validated before the cancel. A later failure, for example an
|
|
206
|
+
# amount below the minimum, leaves the subscription on its current plan with no
|
|
207
|
+
# open link. A retry is safe.
|
|
208
|
+
#
|
|
209
|
+
# The preview route shares this request body and ignores this field.
|
|
210
|
+
cancel_older_payment_link: nil,
|
|
165
211
|
# Replace a scheduled plan change with this one.
|
|
166
212
|
#
|
|
167
213
|
# The scheduled change is cancelled by the transaction that applies this change. A
|
|
@@ -207,7 +253,18 @@ module Dodopayments
|
|
|
207
253
|
# outcome
|
|
208
254
|
#
|
|
209
255
|
# If not specified, uses the business-level default setting.
|
|
210
|
-
on_payment_failure: nil
|
|
256
|
+
on_payment_failure: nil,
|
|
257
|
+
# The URL that receives the customer after they pay the payment link. Needs
|
|
258
|
+
# `collect_via_payment_link: true`. Without it, the request gets a `422`. A change
|
|
259
|
+
# that collects no money issues no link and does not use the URL. The preview
|
|
260
|
+
# route validates this field but does not use it.
|
|
261
|
+
#
|
|
262
|
+
# The redirect adds `subscription_id`, `payment_id` and `status`. The `status`
|
|
263
|
+
# value is the status of the plan-change payment. It is not the status of the
|
|
264
|
+
# subscription. When that payment fails, the subscription stays active on its
|
|
265
|
+
# current plan. To try again, call this endpoint again to get a new link. The new
|
|
266
|
+
# plan can apply after the redirect, when the payment webhook arrives.
|
|
267
|
+
return_url: nil
|
|
211
268
|
)
|
|
212
269
|
end
|
|
213
270
|
|
|
@@ -220,6 +277,7 @@ module Dodopayments
|
|
|
220
277
|
quantity: Integer,
|
|
221
278
|
adaptive_currency_fees_inclusive: T.nilable(T::Boolean),
|
|
222
279
|
addons: T.nilable(T::Array[Dodopayments::AttachAddon]),
|
|
280
|
+
cancel_older_payment_link: T::Boolean,
|
|
223
281
|
cancel_scheduled_change_plan: T::Boolean,
|
|
224
282
|
collect_via_payment_link: T::Boolean,
|
|
225
283
|
discount_code: T.nilable(String),
|
|
@@ -231,7 +289,8 @@ module Dodopayments
|
|
|
231
289
|
on_payment_failure:
|
|
232
290
|
T.nilable(
|
|
233
291
|
Dodopayments::UpdateSubscriptionPlanReq::OnPaymentFailure::OrSymbol
|
|
234
|
-
)
|
|
292
|
+
),
|
|
293
|
+
return_url: T.nilable(String)
|
|
235
294
|
}
|
|
236
295
|
)
|
|
237
296
|
end
|
|
@@ -280,6 +280,7 @@ module Dodopayments
|
|
|
280
280
|
quantity: Integer,
|
|
281
281
|
adaptive_currency_fees_inclusive: T.nilable(T::Boolean),
|
|
282
282
|
addons: T.nilable(T::Array[Dodopayments::AttachAddon::OrHash]),
|
|
283
|
+
cancel_older_payment_link: T::Boolean,
|
|
283
284
|
cancel_scheduled_change_plan: T::Boolean,
|
|
284
285
|
collect_via_payment_link: T::Boolean,
|
|
285
286
|
discount_code: T.nilable(String),
|
|
@@ -292,6 +293,7 @@ module Dodopayments
|
|
|
292
293
|
T.nilable(
|
|
293
294
|
Dodopayments::UpdateSubscriptionPlanReq::OnPaymentFailure::OrSymbol
|
|
294
295
|
),
|
|
296
|
+
return_url: T.nilable(String),
|
|
295
297
|
request_options: Dodopayments::RequestOptions::OrHash
|
|
296
298
|
).returns(Dodopayments::Models::SubscriptionChangePlanResponse)
|
|
297
299
|
end
|
|
@@ -310,6 +312,19 @@ module Dodopayments
|
|
|
310
312
|
# Addons for the new plan. Note : Leaving this empty would remove any existing
|
|
311
313
|
# addons
|
|
312
314
|
addons: nil,
|
|
315
|
+
# Cancel the payment link of a pending plan change, so that this change can
|
|
316
|
+
# replace it.
|
|
317
|
+
#
|
|
318
|
+
# The link is cancelled only if the customer has not started to pay. A paid or
|
|
319
|
+
# in-progress payment gives a `409`. A failed cancel gives a `503`, and a retry is
|
|
320
|
+
# safe.
|
|
321
|
+
#
|
|
322
|
+
# The request is validated before the cancel. A later failure, for example an
|
|
323
|
+
# amount below the minimum, leaves the subscription on its current plan with no
|
|
324
|
+
# open link. A retry is safe.
|
|
325
|
+
#
|
|
326
|
+
# The preview route shares this request body and ignores this field.
|
|
327
|
+
cancel_older_payment_link: nil,
|
|
313
328
|
# Replace a scheduled plan change with this one.
|
|
314
329
|
#
|
|
315
330
|
# The scheduled change is cancelled by the transaction that applies this change. A
|
|
@@ -356,6 +371,17 @@ module Dodopayments
|
|
|
356
371
|
#
|
|
357
372
|
# If not specified, uses the business-level default setting.
|
|
358
373
|
on_payment_failure: nil,
|
|
374
|
+
# The URL that receives the customer after they pay the payment link. Needs
|
|
375
|
+
# `collect_via_payment_link: true`. Without it, the request gets a `422`. A change
|
|
376
|
+
# that collects no money issues no link and does not use the URL. The preview
|
|
377
|
+
# route validates this field but does not use it.
|
|
378
|
+
#
|
|
379
|
+
# The redirect adds `subscription_id`, `payment_id` and `status`. The `status`
|
|
380
|
+
# value is the status of the plan-change payment. It is not the status of the
|
|
381
|
+
# subscription. When that payment fails, the subscription stays active on its
|
|
382
|
+
# current plan. To try again, call this endpoint again to get a new link. The new
|
|
383
|
+
# plan can apply after the redirect, when the payment webhook arrives.
|
|
384
|
+
return_url: nil,
|
|
359
385
|
request_options: {}
|
|
360
386
|
)
|
|
361
387
|
end
|
|
@@ -410,6 +436,7 @@ module Dodopayments
|
|
|
410
436
|
quantity: Integer,
|
|
411
437
|
adaptive_currency_fees_inclusive: T.nilable(T::Boolean),
|
|
412
438
|
addons: T.nilable(T::Array[Dodopayments::AttachAddon::OrHash]),
|
|
439
|
+
cancel_older_payment_link: T::Boolean,
|
|
413
440
|
cancel_scheduled_change_plan: T::Boolean,
|
|
414
441
|
collect_via_payment_link: T::Boolean,
|
|
415
442
|
discount_code: T.nilable(String),
|
|
@@ -422,6 +449,7 @@ module Dodopayments
|
|
|
422
449
|
T.nilable(
|
|
423
450
|
Dodopayments::UpdateSubscriptionPlanReq::OnPaymentFailure::OrSymbol
|
|
424
451
|
),
|
|
452
|
+
return_url: T.nilable(String),
|
|
425
453
|
request_options: Dodopayments::RequestOptions::OrHash
|
|
426
454
|
).returns(Dodopayments::Models::SubscriptionPreviewChangePlanResponse)
|
|
427
455
|
end
|
|
@@ -440,6 +468,19 @@ module Dodopayments
|
|
|
440
468
|
# Addons for the new plan. Note : Leaving this empty would remove any existing
|
|
441
469
|
# addons
|
|
442
470
|
addons: nil,
|
|
471
|
+
# Cancel the payment link of a pending plan change, so that this change can
|
|
472
|
+
# replace it.
|
|
473
|
+
#
|
|
474
|
+
# The link is cancelled only if the customer has not started to pay. A paid or
|
|
475
|
+
# in-progress payment gives a `409`. A failed cancel gives a `503`, and a retry is
|
|
476
|
+
# safe.
|
|
477
|
+
#
|
|
478
|
+
# The request is validated before the cancel. A later failure, for example an
|
|
479
|
+
# amount below the minimum, leaves the subscription on its current plan with no
|
|
480
|
+
# open link. A retry is safe.
|
|
481
|
+
#
|
|
482
|
+
# The preview route shares this request body and ignores this field.
|
|
483
|
+
cancel_older_payment_link: nil,
|
|
443
484
|
# Replace a scheduled plan change with this one.
|
|
444
485
|
#
|
|
445
486
|
# The scheduled change is cancelled by the transaction that applies this change. A
|
|
@@ -486,6 +527,17 @@ module Dodopayments
|
|
|
486
527
|
#
|
|
487
528
|
# If not specified, uses the business-level default setting.
|
|
488
529
|
on_payment_failure: nil,
|
|
530
|
+
# The URL that receives the customer after they pay the payment link. Needs
|
|
531
|
+
# `collect_via_payment_link: true`. Without it, the request gets a `422`. A change
|
|
532
|
+
# that collects no money issues no link and does not use the URL. The preview
|
|
533
|
+
# route validates this field but does not use it.
|
|
534
|
+
#
|
|
535
|
+
# The redirect adds `subscription_id`, `payment_id` and `status`. The `status`
|
|
536
|
+
# value is the status of the plan-change payment. It is not the status of the
|
|
537
|
+
# subscription. When that payment fails, the subscription stays active on its
|
|
538
|
+
# current plan. To try again, call this endpoint again to get a new link. The new
|
|
539
|
+
# plan can apply after the redirect, when the payment webhook arrives.
|
|
540
|
+
return_url: nil,
|
|
489
541
|
request_options: {}
|
|
490
542
|
)
|
|
491
543
|
end
|
|
@@ -7,13 +7,15 @@ module Dodopayments
|
|
|
7
7
|
quantity: Integer,
|
|
8
8
|
adaptive_currency_fees_inclusive: bool?,
|
|
9
9
|
addons: ::Array[Dodopayments::AttachAddon]?,
|
|
10
|
+
cancel_older_payment_link: bool,
|
|
10
11
|
cancel_scheduled_change_plan: bool,
|
|
11
12
|
collect_via_payment_link: bool,
|
|
12
13
|
discount_code: String?,
|
|
13
14
|
discount_codes: ::Array[String]?,
|
|
14
15
|
effective_at: Dodopayments::Models::UpdateSubscriptionPlanReq::effective_at,
|
|
15
16
|
metadata: Dodopayments::Models::metadata?,
|
|
16
|
-
on_payment_failure: Dodopayments::Models::UpdateSubscriptionPlanReq::on_payment_failure
|
|
17
|
+
on_payment_failure: Dodopayments::Models::UpdateSubscriptionPlanReq::on_payment_failure?,
|
|
18
|
+
return_url: String?
|
|
17
19
|
}
|
|
18
20
|
|
|
19
21
|
class UpdateSubscriptionPlanReq < Dodopayments::Internal::Type::BaseModel
|
|
@@ -27,6 +29,10 @@ module Dodopayments
|
|
|
27
29
|
|
|
28
30
|
attr_accessor addons: ::Array[Dodopayments::AttachAddon]?
|
|
29
31
|
|
|
32
|
+
attr_reader cancel_older_payment_link: bool?
|
|
33
|
+
|
|
34
|
+
def cancel_older_payment_link=: (bool) -> bool
|
|
35
|
+
|
|
30
36
|
attr_reader cancel_scheduled_change_plan: bool?
|
|
31
37
|
|
|
32
38
|
def cancel_scheduled_change_plan=: (bool) -> bool
|
|
@@ -49,19 +55,23 @@ module Dodopayments
|
|
|
49
55
|
|
|
50
56
|
attr_accessor on_payment_failure: Dodopayments::Models::UpdateSubscriptionPlanReq::on_payment_failure?
|
|
51
57
|
|
|
58
|
+
attr_accessor return_url: String?
|
|
59
|
+
|
|
52
60
|
def initialize: (
|
|
53
61
|
product_id: String,
|
|
54
62
|
proration_billing_mode: Dodopayments::Models::UpdateSubscriptionPlanReq::proration_billing_mode,
|
|
55
63
|
quantity: Integer,
|
|
56
64
|
?adaptive_currency_fees_inclusive: bool?,
|
|
57
65
|
?addons: ::Array[Dodopayments::AttachAddon]?,
|
|
66
|
+
?cancel_older_payment_link: bool,
|
|
58
67
|
?cancel_scheduled_change_plan: bool,
|
|
59
68
|
?collect_via_payment_link: bool,
|
|
60
69
|
?discount_code: String?,
|
|
61
70
|
?discount_codes: ::Array[String]?,
|
|
62
71
|
?effective_at: Dodopayments::Models::UpdateSubscriptionPlanReq::effective_at,
|
|
63
72
|
?metadata: Dodopayments::Models::metadata?,
|
|
64
|
-
?on_payment_failure: Dodopayments::Models::UpdateSubscriptionPlanReq::on_payment_failure
|
|
73
|
+
?on_payment_failure: Dodopayments::Models::UpdateSubscriptionPlanReq::on_payment_failure?,
|
|
74
|
+
?return_url: String?
|
|
65
75
|
) -> void
|
|
66
76
|
|
|
67
77
|
def to_hash: -> {
|
|
@@ -70,13 +80,15 @@ module Dodopayments
|
|
|
70
80
|
quantity: Integer,
|
|
71
81
|
adaptive_currency_fees_inclusive: bool?,
|
|
72
82
|
addons: ::Array[Dodopayments::AttachAddon]?,
|
|
83
|
+
cancel_older_payment_link: bool,
|
|
73
84
|
cancel_scheduled_change_plan: bool,
|
|
74
85
|
collect_via_payment_link: bool,
|
|
75
86
|
discount_code: String?,
|
|
76
87
|
discount_codes: ::Array[String]?,
|
|
77
88
|
effective_at: Dodopayments::Models::UpdateSubscriptionPlanReq::effective_at,
|
|
78
89
|
metadata: Dodopayments::Models::metadata?,
|
|
79
|
-
on_payment_failure: Dodopayments::Models::UpdateSubscriptionPlanReq::on_payment_failure
|
|
90
|
+
on_payment_failure: Dodopayments::Models::UpdateSubscriptionPlanReq::on_payment_failure?,
|
|
91
|
+
return_url: String?
|
|
80
92
|
}
|
|
81
93
|
|
|
82
94
|
type proration_billing_mode =
|
|
@@ -80,6 +80,7 @@ module Dodopayments
|
|
|
80
80
|
quantity: Integer,
|
|
81
81
|
?adaptive_currency_fees_inclusive: bool?,
|
|
82
82
|
?addons: ::Array[Dodopayments::AttachAddon]?,
|
|
83
|
+
?cancel_older_payment_link: bool,
|
|
83
84
|
?cancel_scheduled_change_plan: bool,
|
|
84
85
|
?collect_via_payment_link: bool,
|
|
85
86
|
?discount_code: String?,
|
|
@@ -87,6 +88,7 @@ module Dodopayments
|
|
|
87
88
|
?effective_at: Dodopayments::Models::UpdateSubscriptionPlanReq::effective_at,
|
|
88
89
|
?metadata: Dodopayments::Models::metadata?,
|
|
89
90
|
?on_payment_failure: Dodopayments::Models::UpdateSubscriptionPlanReq::on_payment_failure?,
|
|
91
|
+
?return_url: String?,
|
|
90
92
|
?request_options: Dodopayments::request_opts
|
|
91
93
|
) -> Dodopayments::Models::SubscriptionChangePlanResponse
|
|
92
94
|
|
|
@@ -108,6 +110,7 @@ module Dodopayments
|
|
|
108
110
|
quantity: Integer,
|
|
109
111
|
?adaptive_currency_fees_inclusive: bool?,
|
|
110
112
|
?addons: ::Array[Dodopayments::AttachAddon]?,
|
|
113
|
+
?cancel_older_payment_link: bool,
|
|
111
114
|
?cancel_scheduled_change_plan: bool,
|
|
112
115
|
?collect_via_payment_link: bool,
|
|
113
116
|
?discount_code: String?,
|
|
@@ -115,6 +118,7 @@ module Dodopayments
|
|
|
115
118
|
?effective_at: Dodopayments::Models::UpdateSubscriptionPlanReq::effective_at,
|
|
116
119
|
?metadata: Dodopayments::Models::metadata?,
|
|
117
120
|
?on_payment_failure: Dodopayments::Models::UpdateSubscriptionPlanReq::on_payment_failure?,
|
|
121
|
+
?return_url: String?,
|
|
118
122
|
?request_options: Dodopayments::request_opts
|
|
119
123
|
) -> Dodopayments::Models::SubscriptionPreviewChangePlanResponse
|
|
120
124
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: dodopayments
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.32.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Dodo Payments
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-10-
|
|
11
|
+
date: 2026-10-06 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: cgi
|