dodopayments 2.25.0 → 2.26.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/entitlements/license_key_grant.rb +24 -3
- data/lib/dodopayments/models/price.rb +34 -30
- data/lib/dodopayments/models/subscription_change_plan_response.rb +47 -0
- data/lib/dodopayments/models/subscription_update_params.rb +16 -4
- data/lib/dodopayments/models/update_subscription_plan_req.rb +35 -1
- data/lib/dodopayments/resources/subscriptions.rb +14 -6
- data/lib/dodopayments/version.rb +1 -1
- data/lib/dodopayments.rb +1 -0
- data/rbi/dodopayments/models/entitlements/license_key_grant.rbi +22 -2
- data/rbi/dodopayments/models/price.rbi +47 -30
- data/rbi/dodopayments/models/subscription_change_plan_response.rbi +69 -0
- data/rbi/dodopayments/models/subscription_update_params.rbi +28 -4
- data/rbi/dodopayments/models/update_subscription_plan_req.rbi +58 -0
- data/rbi/dodopayments/resources/subscriptions.rbi +63 -3
- data/sig/dodopayments/models/entitlements/license_key_grant.rbs +10 -0
- data/sig/dodopayments/models/price.rbs +21 -15
- data/sig/dodopayments/models/subscription_change_plan_response.rbs +35 -0
- data/sig/dodopayments/models/update_subscription_plan_req.rbs +14 -0
- data/sig/dodopayments/resources/subscriptions.rbs +5 -1
- metadata +5 -2
|
@@ -40,11 +40,6 @@ module Dodopayments
|
|
|
40
40
|
sig { returns(Integer) }
|
|
41
41
|
attr_accessor :price
|
|
42
42
|
|
|
43
|
-
# Indicates if purchasing power parity adjustments are applied to the price.
|
|
44
|
-
# Purchasing power parity feature is not available as of now.
|
|
45
|
-
sig { returns(T::Boolean) }
|
|
46
|
-
attr_accessor :purchasing_power_parity
|
|
47
|
-
|
|
48
43
|
sig { returns(Symbol) }
|
|
49
44
|
attr_accessor :type
|
|
50
45
|
|
|
@@ -56,6 +51,15 @@ module Dodopayments
|
|
|
56
51
|
sig { params(pay_what_you_want: T::Boolean).void }
|
|
57
52
|
attr_writer :pay_what_you_want
|
|
58
53
|
|
|
54
|
+
# Opts this price in to purchasing power parity. The business must also enable
|
|
55
|
+
# purchasing power parity. The discount percentage per country is always
|
|
56
|
+
# business-wide. Defaults to `false`.
|
|
57
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
58
|
+
attr_reader :purchasing_power_parity
|
|
59
|
+
|
|
60
|
+
sig { params(purchasing_power_parity: T::Boolean).void }
|
|
61
|
+
attr_writer :purchasing_power_parity
|
|
62
|
+
|
|
59
63
|
# A suggested price for the user to pay. This value is only considered if
|
|
60
64
|
# [`pay_what_you_want`](Self::pay_what_you_want) is `true`. Otherwise, it is
|
|
61
65
|
# ignored.
|
|
@@ -72,8 +76,8 @@ module Dodopayments
|
|
|
72
76
|
currency: Dodopayments::Currency::OrSymbol,
|
|
73
77
|
discount: Integer,
|
|
74
78
|
price: Integer,
|
|
75
|
-
purchasing_power_parity: T::Boolean,
|
|
76
79
|
pay_what_you_want: T::Boolean,
|
|
80
|
+
purchasing_power_parity: T::Boolean,
|
|
77
81
|
suggested_price: T.nilable(Integer),
|
|
78
82
|
tax_inclusive: T.nilable(T::Boolean),
|
|
79
83
|
type: Symbol
|
|
@@ -90,12 +94,13 @@ module Dodopayments
|
|
|
90
94
|
# If [`pay_what_you_want`](Self::pay_what_you_want) is set to `true`, this field
|
|
91
95
|
# represents the **minimum** amount the customer must pay.
|
|
92
96
|
price:,
|
|
93
|
-
# Indicates if purchasing power parity adjustments are applied to the price.
|
|
94
|
-
# Purchasing power parity feature is not available as of now.
|
|
95
|
-
purchasing_power_parity:,
|
|
96
97
|
# Indicates whether the customer can pay any amount they choose. If set to `true`,
|
|
97
98
|
# the [`price`](Self::price) field is the minimum amount.
|
|
98
99
|
pay_what_you_want: nil,
|
|
100
|
+
# Opts this price in to purchasing power parity. The business must also enable
|
|
101
|
+
# purchasing power parity. The discount percentage per country is always
|
|
102
|
+
# business-wide. Defaults to `false`.
|
|
103
|
+
purchasing_power_parity: nil,
|
|
99
104
|
# A suggested price for the user to pay. This value is only considered if
|
|
100
105
|
# [`pay_what_you_want`](Self::pay_what_you_want) is `true`. Otherwise, it is
|
|
101
106
|
# ignored.
|
|
@@ -112,9 +117,9 @@ module Dodopayments
|
|
|
112
117
|
currency: Dodopayments::Currency::OrSymbol,
|
|
113
118
|
discount: Integer,
|
|
114
119
|
price: Integer,
|
|
115
|
-
purchasing_power_parity: T::Boolean,
|
|
116
120
|
type: Symbol,
|
|
117
121
|
pay_what_you_want: T::Boolean,
|
|
122
|
+
purchasing_power_parity: T::Boolean,
|
|
118
123
|
suggested_price: T.nilable(Integer),
|
|
119
124
|
tax_inclusive: T.nilable(T::Boolean)
|
|
120
125
|
}
|
|
@@ -155,11 +160,6 @@ module Dodopayments
|
|
|
155
160
|
sig { returns(Integer) }
|
|
156
161
|
attr_accessor :price
|
|
157
162
|
|
|
158
|
-
# Indicates if purchasing power parity adjustments are applied to the price.
|
|
159
|
-
# Purchasing power parity feature is not available as of now
|
|
160
|
-
sig { returns(T::Boolean) }
|
|
161
|
-
attr_accessor :purchasing_power_parity
|
|
162
|
-
|
|
163
163
|
# Number of units for the subscription period. For example, a value of `12` with a
|
|
164
164
|
# `subscription_period_interval` of `month` represents a one-year subscription.
|
|
165
165
|
sig { returns(Integer) }
|
|
@@ -172,6 +172,15 @@ module Dodopayments
|
|
|
172
172
|
sig { returns(Symbol) }
|
|
173
173
|
attr_accessor :type
|
|
174
174
|
|
|
175
|
+
# Opts this price in to purchasing power parity. The business must also enable
|
|
176
|
+
# purchasing power parity. The discount percentage per country is always
|
|
177
|
+
# business-wide. Defaults to `false`.
|
|
178
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
179
|
+
attr_reader :purchasing_power_parity
|
|
180
|
+
|
|
181
|
+
sig { params(purchasing_power_parity: T::Boolean).void }
|
|
182
|
+
attr_writer :purchasing_power_parity
|
|
183
|
+
|
|
175
184
|
# Indicates if the price is tax inclusive
|
|
176
185
|
sig { returns(T.nilable(T::Boolean)) }
|
|
177
186
|
attr_accessor :tax_inclusive
|
|
@@ -201,9 +210,9 @@ module Dodopayments
|
|
|
201
210
|
payment_frequency_count: Integer,
|
|
202
211
|
payment_frequency_interval: Dodopayments::TimeInterval::OrSymbol,
|
|
203
212
|
price: Integer,
|
|
204
|
-
purchasing_power_parity: T::Boolean,
|
|
205
213
|
subscription_period_count: Integer,
|
|
206
214
|
subscription_period_interval: Dodopayments::TimeInterval::OrSymbol,
|
|
215
|
+
purchasing_power_parity: T::Boolean,
|
|
207
216
|
tax_inclusive: T.nilable(T::Boolean),
|
|
208
217
|
trial_amount: T.nilable(Integer),
|
|
209
218
|
trial_apply_discounts: T.nilable(T::Boolean),
|
|
@@ -224,14 +233,15 @@ module Dodopayments
|
|
|
224
233
|
# The payment amount. Represented in the lowest denomination of the currency
|
|
225
234
|
# (e.g., cents for USD). For example, to charge $1.00, pass `100`.
|
|
226
235
|
price:,
|
|
227
|
-
# Indicates if purchasing power parity adjustments are applied to the price.
|
|
228
|
-
# Purchasing power parity feature is not available as of now
|
|
229
|
-
purchasing_power_parity:,
|
|
230
236
|
# Number of units for the subscription period. For example, a value of `12` with a
|
|
231
237
|
# `subscription_period_interval` of `month` represents a one-year subscription.
|
|
232
238
|
subscription_period_count:,
|
|
233
239
|
# The time interval for the subscription period (e.g., day, month, year).
|
|
234
240
|
subscription_period_interval:,
|
|
241
|
+
# Opts this price in to purchasing power parity. The business must also enable
|
|
242
|
+
# purchasing power parity. The discount percentage per country is always
|
|
243
|
+
# business-wide. Defaults to `false`.
|
|
244
|
+
purchasing_power_parity: nil,
|
|
235
245
|
# Indicates if the price is tax inclusive
|
|
236
246
|
tax_inclusive: nil,
|
|
237
247
|
# Amount charged today for a paid trial, in the price currency's minor units.
|
|
@@ -254,11 +264,11 @@ module Dodopayments
|
|
|
254
264
|
payment_frequency_count: Integer,
|
|
255
265
|
payment_frequency_interval: Dodopayments::TimeInterval::OrSymbol,
|
|
256
266
|
price: Integer,
|
|
257
|
-
purchasing_power_parity: T::Boolean,
|
|
258
267
|
subscription_period_count: Integer,
|
|
259
268
|
subscription_period_interval:
|
|
260
269
|
Dodopayments::TimeInterval::OrSymbol,
|
|
261
270
|
type: Symbol,
|
|
271
|
+
purchasing_power_parity: T::Boolean,
|
|
262
272
|
tax_inclusive: T.nilable(T::Boolean),
|
|
263
273
|
trial_amount: T.nilable(Integer),
|
|
264
274
|
trial_apply_discounts: T.nilable(T::Boolean),
|
|
@@ -301,11 +311,6 @@ module Dodopayments
|
|
|
301
311
|
sig { returns(Dodopayments::TimeInterval::OrSymbol) }
|
|
302
312
|
attr_accessor :payment_frequency_interval
|
|
303
313
|
|
|
304
|
-
# Indicates if purchasing power parity adjustments are applied to the price.
|
|
305
|
-
# Purchasing power parity feature is not available as of now
|
|
306
|
-
sig { returns(T::Boolean) }
|
|
307
|
-
attr_accessor :purchasing_power_parity
|
|
308
|
-
|
|
309
314
|
# Number of units for the subscription period. For example, a value of `12` with a
|
|
310
315
|
# `subscription_period_interval` of `month` represents a one-year subscription.
|
|
311
316
|
sig { returns(Integer) }
|
|
@@ -321,6 +326,16 @@ module Dodopayments
|
|
|
321
326
|
sig { returns(T.nilable(T::Array[Dodopayments::AddMeterToPrice])) }
|
|
322
327
|
attr_accessor :meters
|
|
323
328
|
|
|
329
|
+
# Opts this price in to purchasing power parity. The business must also enable
|
|
330
|
+
# purchasing power parity. The discount percentage per country is always
|
|
331
|
+
# business-wide. Applies to the fixed fee only, never to metered usage. Defaults
|
|
332
|
+
# to `false`.
|
|
333
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
334
|
+
attr_reader :purchasing_power_parity
|
|
335
|
+
|
|
336
|
+
sig { params(purchasing_power_parity: T::Boolean).void }
|
|
337
|
+
attr_writer :purchasing_power_parity
|
|
338
|
+
|
|
324
339
|
# Indicates if the price is tax inclusive
|
|
325
340
|
sig { returns(T.nilable(T::Boolean)) }
|
|
326
341
|
attr_accessor :tax_inclusive
|
|
@@ -333,10 +348,10 @@ module Dodopayments
|
|
|
333
348
|
fixed_price: Integer,
|
|
334
349
|
payment_frequency_count: Integer,
|
|
335
350
|
payment_frequency_interval: Dodopayments::TimeInterval::OrSymbol,
|
|
336
|
-
purchasing_power_parity: T::Boolean,
|
|
337
351
|
subscription_period_count: Integer,
|
|
338
352
|
subscription_period_interval: Dodopayments::TimeInterval::OrSymbol,
|
|
339
353
|
meters: T.nilable(T::Array[Dodopayments::AddMeterToPrice::OrHash]),
|
|
354
|
+
purchasing_power_parity: T::Boolean,
|
|
340
355
|
tax_inclusive: T.nilable(T::Boolean),
|
|
341
356
|
type: Symbol
|
|
342
357
|
).returns(T.attached_class)
|
|
@@ -354,15 +369,17 @@ module Dodopayments
|
|
|
354
369
|
payment_frequency_count:,
|
|
355
370
|
# The time interval for the payment frequency (e.g., day, month, year).
|
|
356
371
|
payment_frequency_interval:,
|
|
357
|
-
# Indicates if purchasing power parity adjustments are applied to the price.
|
|
358
|
-
# Purchasing power parity feature is not available as of now
|
|
359
|
-
purchasing_power_parity:,
|
|
360
372
|
# Number of units for the subscription period. For example, a value of `12` with a
|
|
361
373
|
# `subscription_period_interval` of `month` represents a one-year subscription.
|
|
362
374
|
subscription_period_count:,
|
|
363
375
|
# The time interval for the subscription period (e.g., day, month, year).
|
|
364
376
|
subscription_period_interval:,
|
|
365
377
|
meters: nil,
|
|
378
|
+
# Opts this price in to purchasing power parity. The business must also enable
|
|
379
|
+
# purchasing power parity. The discount percentage per country is always
|
|
380
|
+
# business-wide. Applies to the fixed fee only, never to metered usage. Defaults
|
|
381
|
+
# to `false`.
|
|
382
|
+
purchasing_power_parity: nil,
|
|
366
383
|
# Indicates if the price is tax inclusive
|
|
367
384
|
tax_inclusive: nil,
|
|
368
385
|
type: :usage_based_price
|
|
@@ -377,12 +394,12 @@ module Dodopayments
|
|
|
377
394
|
fixed_price: Integer,
|
|
378
395
|
payment_frequency_count: Integer,
|
|
379
396
|
payment_frequency_interval: Dodopayments::TimeInterval::OrSymbol,
|
|
380
|
-
purchasing_power_parity: T::Boolean,
|
|
381
397
|
subscription_period_count: Integer,
|
|
382
398
|
subscription_period_interval:
|
|
383
399
|
Dodopayments::TimeInterval::OrSymbol,
|
|
384
400
|
type: Symbol,
|
|
385
401
|
meters: T.nilable(T::Array[Dodopayments::AddMeterToPrice]),
|
|
402
|
+
purchasing_power_parity: T::Boolean,
|
|
386
403
|
tax_inclusive: T.nilable(T::Boolean)
|
|
387
404
|
}
|
|
388
405
|
)
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Models
|
|
5
|
+
class SubscriptionChangePlanResponse < Dodopayments::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(
|
|
9
|
+
Dodopayments::Models::SubscriptionChangePlanResponse,
|
|
10
|
+
Dodopayments::Internal::AnyHash
|
|
11
|
+
)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# Client secret for an embedded checkout.
|
|
15
|
+
sig { returns(T.nilable(String)) }
|
|
16
|
+
attr_accessor :client_secret
|
|
17
|
+
|
|
18
|
+
# When the link stops working.
|
|
19
|
+
sig { returns(T.nilable(Time)) }
|
|
20
|
+
attr_accessor :expires_on
|
|
21
|
+
|
|
22
|
+
# Id of the payment that settles the plan change.
|
|
23
|
+
sig { returns(T.nilable(String)) }
|
|
24
|
+
attr_accessor :payment_id
|
|
25
|
+
|
|
26
|
+
# Checkout page URL. Give this to the customer.
|
|
27
|
+
sig { returns(T.nilable(String)) }
|
|
28
|
+
attr_accessor :payment_link
|
|
29
|
+
|
|
30
|
+
# Handles for a hosted checkout page that settles a plan change.
|
|
31
|
+
#
|
|
32
|
+
# The four fields repeat `UpdatePaymentMethodResponse` and a subset of
|
|
33
|
+
# `CreateSubscriptionResponse`. A shared type would rename the generated SDK types
|
|
34
|
+
# for all three routes, so each route keeps its own.
|
|
35
|
+
sig do
|
|
36
|
+
params(
|
|
37
|
+
client_secret: T.nilable(String),
|
|
38
|
+
expires_on: T.nilable(Time),
|
|
39
|
+
payment_id: T.nilable(String),
|
|
40
|
+
payment_link: T.nilable(String)
|
|
41
|
+
).returns(T.attached_class)
|
|
42
|
+
end
|
|
43
|
+
def self.new(
|
|
44
|
+
# Client secret for an embedded checkout.
|
|
45
|
+
client_secret: nil,
|
|
46
|
+
# When the link stops working.
|
|
47
|
+
expires_on: nil,
|
|
48
|
+
# Id of the payment that settles the plan change.
|
|
49
|
+
payment_id: nil,
|
|
50
|
+
# Checkout page URL. Give this to the customer.
|
|
51
|
+
payment_link: nil
|
|
52
|
+
)
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
sig do
|
|
56
|
+
override.returns(
|
|
57
|
+
{
|
|
58
|
+
client_secret: T.nilable(String),
|
|
59
|
+
expires_on: T.nilable(Time),
|
|
60
|
+
payment_id: T.nilable(String),
|
|
61
|
+
payment_link: T.nilable(String)
|
|
62
|
+
}
|
|
63
|
+
)
|
|
64
|
+
end
|
|
65
|
+
def to_hash
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
end
|
|
@@ -98,11 +98,23 @@ module Dodopayments
|
|
|
98
98
|
sig { returns(T.nilable(Time)) }
|
|
99
99
|
attr_accessor :next_billing_date
|
|
100
100
|
|
|
101
|
-
# `
|
|
102
|
-
#
|
|
101
|
+
# Removed. Use `status: paused` to pause and `status: active` to resume. This
|
|
102
|
+
# field always fails with 422, so a caller still on it gets a loud error instead
|
|
103
|
+
# of a silent no-op.
|
|
103
104
|
sig { returns(T.nilable(T::Boolean)) }
|
|
104
105
|
attr_accessor :pause
|
|
105
106
|
|
|
107
|
+
# Set to `cancelled` to cancel the subscription. See `cancel_reason`,
|
|
108
|
+
# `cancellation_feedback`, `cancellation_comment`, and
|
|
109
|
+
# `cancel_at_next_billing_date` for cancellation options.
|
|
110
|
+
#
|
|
111
|
+
# Set to `paused` to pause an active subscription. Set to `active` to resume a
|
|
112
|
+
# `paused` subscription. `active` also resumes an `on_hold` subscription that has
|
|
113
|
+
# an unpaid pause invoice. This voids that invoice.
|
|
114
|
+
#
|
|
115
|
+
# Send `paused` or `active` alone. A request that combines either with any other
|
|
116
|
+
# field fails with 422. `cancelled` is not exclusive this way — see
|
|
117
|
+
# `cancel_reason` and friends below.
|
|
106
118
|
sig { returns(T.nilable(Dodopayments::SubscriptionStatus::OrSymbol)) }
|
|
107
119
|
attr_accessor :status
|
|
108
120
|
|
|
@@ -182,9 +194,21 @@ module Dodopayments
|
|
|
182
194
|
# Arbitrary key-value metadata. Values can be string, integer, number, or boolean.
|
|
183
195
|
metadata: nil,
|
|
184
196
|
next_billing_date: nil,
|
|
185
|
-
# `
|
|
186
|
-
#
|
|
197
|
+
# Removed. Use `status: paused` to pause and `status: active` to resume. This
|
|
198
|
+
# field always fails with 422, so a caller still on it gets a loud error instead
|
|
199
|
+
# of a silent no-op.
|
|
187
200
|
pause: nil,
|
|
201
|
+
# Set to `cancelled` to cancel the subscription. See `cancel_reason`,
|
|
202
|
+
# `cancellation_feedback`, `cancellation_comment`, and
|
|
203
|
+
# `cancel_at_next_billing_date` for cancellation options.
|
|
204
|
+
#
|
|
205
|
+
# Set to `paused` to pause an active subscription. Set to `active` to resume a
|
|
206
|
+
# `paused` subscription. `active` also resumes an `on_hold` subscription that has
|
|
207
|
+
# an unpaid pause invoice. This voids that invoice.
|
|
208
|
+
#
|
|
209
|
+
# Send `paused` or `active` alone. A request that combines either with any other
|
|
210
|
+
# field fails with 422. `cancelled` is not exclusive this way — see
|
|
211
|
+
# `cancel_reason` and friends below.
|
|
188
212
|
status: nil,
|
|
189
213
|
# New number of `subscription_period_interval` units the subscription entitlement
|
|
190
214
|
# should span. Used together with `subscription_period_interval` to extend the
|
|
@@ -37,6 +37,38 @@ module Dodopayments
|
|
|
37
37
|
sig { returns(T.nilable(T::Array[Dodopayments::AttachAddon])) }
|
|
38
38
|
attr_accessor :addons
|
|
39
39
|
|
|
40
|
+
# Replace a scheduled plan change with this one.
|
|
41
|
+
#
|
|
42
|
+
# The scheduled change is cancelled by the transaction that applies this change. A
|
|
43
|
+
# change that never applies leaves the schedule in place.
|
|
44
|
+
#
|
|
45
|
+
# `effective_at: next_billing_date` is allowed. The new schedule then replaces the
|
|
46
|
+
# old one in the request transaction.
|
|
47
|
+
#
|
|
48
|
+
# A pending plan change still gets a `409`. This field does not affect it.
|
|
49
|
+
#
|
|
50
|
+
# The preview route shares this request body, so a preview that sets this field
|
|
51
|
+
# also passes the scheduled-change `409`.
|
|
52
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
53
|
+
attr_reader :cancel_scheduled_change_plan
|
|
54
|
+
|
|
55
|
+
sig { params(cancel_scheduled_change_plan: T::Boolean).void }
|
|
56
|
+
attr_writer :cancel_scheduled_change_plan
|
|
57
|
+
|
|
58
|
+
# Collect the plan-change amount with a payment link. The customer then pays on a
|
|
59
|
+
# checkout page.
|
|
60
|
+
#
|
|
61
|
+
# The business needs the `allow_plan_change_via_payment_link` capability. The
|
|
62
|
+
# request needs `effective_at: immediately`. The request also needs
|
|
63
|
+
# `on_payment_failure: prevent_change`.
|
|
64
|
+
#
|
|
65
|
+
# The preview route shares this request body and ignores this field.
|
|
66
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
67
|
+
attr_reader :collect_via_payment_link
|
|
68
|
+
|
|
69
|
+
sig { params(collect_via_payment_link: T::Boolean).void }
|
|
70
|
+
attr_writer :collect_via_payment_link
|
|
71
|
+
|
|
40
72
|
# DEPRECATED: Use discount_codes instead. Cannot be used together with
|
|
41
73
|
# discount_codes.
|
|
42
74
|
sig { returns(T.nilable(String)) }
|
|
@@ -103,6 +135,8 @@ module Dodopayments
|
|
|
103
135
|
quantity: Integer,
|
|
104
136
|
adaptive_currency_fees_inclusive: T.nilable(T::Boolean),
|
|
105
137
|
addons: T.nilable(T::Array[Dodopayments::AttachAddon::OrHash]),
|
|
138
|
+
cancel_scheduled_change_plan: T::Boolean,
|
|
139
|
+
collect_via_payment_link: T::Boolean,
|
|
106
140
|
discount_code: T.nilable(String),
|
|
107
141
|
discount_codes: T.nilable(T::Array[String]),
|
|
108
142
|
effective_at:
|
|
@@ -128,6 +162,28 @@ module Dodopayments
|
|
|
128
162
|
# Addons for the new plan. Note : Leaving this empty would remove any existing
|
|
129
163
|
# addons
|
|
130
164
|
addons: nil,
|
|
165
|
+
# Replace a scheduled plan change with this one.
|
|
166
|
+
#
|
|
167
|
+
# The scheduled change is cancelled by the transaction that applies this change. A
|
|
168
|
+
# change that never applies leaves the schedule in place.
|
|
169
|
+
#
|
|
170
|
+
# `effective_at: next_billing_date` is allowed. The new schedule then replaces the
|
|
171
|
+
# old one in the request transaction.
|
|
172
|
+
#
|
|
173
|
+
# A pending plan change still gets a `409`. This field does not affect it.
|
|
174
|
+
#
|
|
175
|
+
# The preview route shares this request body, so a preview that sets this field
|
|
176
|
+
# also passes the scheduled-change `409`.
|
|
177
|
+
cancel_scheduled_change_plan: nil,
|
|
178
|
+
# Collect the plan-change amount with a payment link. The customer then pays on a
|
|
179
|
+
# checkout page.
|
|
180
|
+
#
|
|
181
|
+
# The business needs the `allow_plan_change_via_payment_link` capability. The
|
|
182
|
+
# request needs `effective_at: immediately`. The request also needs
|
|
183
|
+
# `on_payment_failure: prevent_change`.
|
|
184
|
+
#
|
|
185
|
+
# The preview route shares this request body and ignores this field.
|
|
186
|
+
collect_via_payment_link: nil,
|
|
131
187
|
# DEPRECATED: Use discount_codes instead. Cannot be used together with
|
|
132
188
|
# discount_codes.
|
|
133
189
|
discount_code: nil,
|
|
@@ -164,6 +220,8 @@ module Dodopayments
|
|
|
164
220
|
quantity: Integer,
|
|
165
221
|
adaptive_currency_fees_inclusive: T.nilable(T::Boolean),
|
|
166
222
|
addons: T.nilable(T::Array[Dodopayments::AttachAddon]),
|
|
223
|
+
cancel_scheduled_change_plan: T::Boolean,
|
|
224
|
+
collect_via_payment_link: T::Boolean,
|
|
167
225
|
discount_code: T.nilable(String),
|
|
168
226
|
discount_codes: T.nilable(T::Array[String]),
|
|
169
227
|
effective_at:
|
|
@@ -187,9 +187,21 @@ module Dodopayments
|
|
|
187
187
|
# Arbitrary key-value metadata. Values can be string, integer, number, or boolean.
|
|
188
188
|
metadata: nil,
|
|
189
189
|
next_billing_date: nil,
|
|
190
|
-
# `
|
|
191
|
-
#
|
|
190
|
+
# Removed. Use `status: paused` to pause and `status: active` to resume. This
|
|
191
|
+
# field always fails with 422, so a caller still on it gets a loud error instead
|
|
192
|
+
# of a silent no-op.
|
|
192
193
|
pause: nil,
|
|
194
|
+
# Set to `cancelled` to cancel the subscription. See `cancel_reason`,
|
|
195
|
+
# `cancellation_feedback`, `cancellation_comment`, and
|
|
196
|
+
# `cancel_at_next_billing_date` for cancellation options.
|
|
197
|
+
#
|
|
198
|
+
# Set to `paused` to pause an active subscription. Set to `active` to resume a
|
|
199
|
+
# `paused` subscription. `active` also resumes an `on_hold` subscription that has
|
|
200
|
+
# an unpaid pause invoice. This voids that invoice.
|
|
201
|
+
#
|
|
202
|
+
# Send `paused` or `active` alone. A request that combines either with any other
|
|
203
|
+
# field fails with 422. `cancelled` is not exclusive this way — see
|
|
204
|
+
# `cancel_reason` and friends below.
|
|
193
205
|
status: nil,
|
|
194
206
|
# New number of `subscription_period_interval` units the subscription entitlement
|
|
195
207
|
# should span. Used together with `subscription_period_interval` to extend the
|
|
@@ -268,6 +280,8 @@ module Dodopayments
|
|
|
268
280
|
quantity: Integer,
|
|
269
281
|
adaptive_currency_fees_inclusive: T.nilable(T::Boolean),
|
|
270
282
|
addons: T.nilable(T::Array[Dodopayments::AttachAddon::OrHash]),
|
|
283
|
+
cancel_scheduled_change_plan: T::Boolean,
|
|
284
|
+
collect_via_payment_link: T::Boolean,
|
|
271
285
|
discount_code: T.nilable(String),
|
|
272
286
|
discount_codes: T.nilable(T::Array[String]),
|
|
273
287
|
effective_at:
|
|
@@ -279,7 +293,7 @@ module Dodopayments
|
|
|
279
293
|
Dodopayments::UpdateSubscriptionPlanReq::OnPaymentFailure::OrSymbol
|
|
280
294
|
),
|
|
281
295
|
request_options: Dodopayments::RequestOptions::OrHash
|
|
282
|
-
).
|
|
296
|
+
).returns(Dodopayments::Models::SubscriptionChangePlanResponse)
|
|
283
297
|
end
|
|
284
298
|
def change_plan(
|
|
285
299
|
# Subscription Id
|
|
@@ -296,6 +310,28 @@ module Dodopayments
|
|
|
296
310
|
# Addons for the new plan. Note : Leaving this empty would remove any existing
|
|
297
311
|
# addons
|
|
298
312
|
addons: nil,
|
|
313
|
+
# Replace a scheduled plan change with this one.
|
|
314
|
+
#
|
|
315
|
+
# The scheduled change is cancelled by the transaction that applies this change. A
|
|
316
|
+
# change that never applies leaves the schedule in place.
|
|
317
|
+
#
|
|
318
|
+
# `effective_at: next_billing_date` is allowed. The new schedule then replaces the
|
|
319
|
+
# old one in the request transaction.
|
|
320
|
+
#
|
|
321
|
+
# A pending plan change still gets a `409`. This field does not affect it.
|
|
322
|
+
#
|
|
323
|
+
# The preview route shares this request body, so a preview that sets this field
|
|
324
|
+
# also passes the scheduled-change `409`.
|
|
325
|
+
cancel_scheduled_change_plan: nil,
|
|
326
|
+
# Collect the plan-change amount with a payment link. The customer then pays on a
|
|
327
|
+
# checkout page.
|
|
328
|
+
#
|
|
329
|
+
# The business needs the `allow_plan_change_via_payment_link` capability. The
|
|
330
|
+
# request needs `effective_at: immediately`. The request also needs
|
|
331
|
+
# `on_payment_failure: prevent_change`.
|
|
332
|
+
#
|
|
333
|
+
# The preview route shares this request body and ignores this field.
|
|
334
|
+
collect_via_payment_link: nil,
|
|
299
335
|
# DEPRECATED: Use discount_codes instead. Cannot be used together with
|
|
300
336
|
# discount_codes.
|
|
301
337
|
discount_code: nil,
|
|
@@ -374,6 +410,8 @@ module Dodopayments
|
|
|
374
410
|
quantity: Integer,
|
|
375
411
|
adaptive_currency_fees_inclusive: T.nilable(T::Boolean),
|
|
376
412
|
addons: T.nilable(T::Array[Dodopayments::AttachAddon::OrHash]),
|
|
413
|
+
cancel_scheduled_change_plan: T::Boolean,
|
|
414
|
+
collect_via_payment_link: T::Boolean,
|
|
377
415
|
discount_code: T.nilable(String),
|
|
378
416
|
discount_codes: T.nilable(T::Array[String]),
|
|
379
417
|
effective_at:
|
|
@@ -402,6 +440,28 @@ module Dodopayments
|
|
|
402
440
|
# Addons for the new plan. Note : Leaving this empty would remove any existing
|
|
403
441
|
# addons
|
|
404
442
|
addons: nil,
|
|
443
|
+
# Replace a scheduled plan change with this one.
|
|
444
|
+
#
|
|
445
|
+
# The scheduled change is cancelled by the transaction that applies this change. A
|
|
446
|
+
# change that never applies leaves the schedule in place.
|
|
447
|
+
#
|
|
448
|
+
# `effective_at: next_billing_date` is allowed. The new schedule then replaces the
|
|
449
|
+
# old one in the request transaction.
|
|
450
|
+
#
|
|
451
|
+
# A pending plan change still gets a `409`. This field does not affect it.
|
|
452
|
+
#
|
|
453
|
+
# The preview route shares this request body, so a preview that sets this field
|
|
454
|
+
# also passes the scheduled-change `409`.
|
|
455
|
+
cancel_scheduled_change_plan: nil,
|
|
456
|
+
# Collect the plan-change amount with a payment link. The customer then pays on a
|
|
457
|
+
# checkout page.
|
|
458
|
+
#
|
|
459
|
+
# The business needs the `allow_plan_change_via_payment_link` capability. The
|
|
460
|
+
# request needs `effective_at: immediately`. The request also needs
|
|
461
|
+
# `on_payment_failure: prevent_change`.
|
|
462
|
+
#
|
|
463
|
+
# The preview route shares this request body and ignores this field.
|
|
464
|
+
collect_via_payment_link: nil,
|
|
405
465
|
# DEPRECATED: Use discount_codes instead. Cannot be used together with
|
|
406
466
|
# discount_codes.
|
|
407
467
|
discount_code: nil,
|
|
@@ -3,31 +3,41 @@ module Dodopayments
|
|
|
3
3
|
module Entitlements
|
|
4
4
|
type license_key_grant =
|
|
5
5
|
{
|
|
6
|
+
id: String,
|
|
6
7
|
activations_used: Integer,
|
|
7
8
|
key: String,
|
|
9
|
+
status: Dodopayments::Models::license_key_status,
|
|
8
10
|
activations_limit: Integer?,
|
|
9
11
|
expires_at: Time?
|
|
10
12
|
}
|
|
11
13
|
|
|
12
14
|
class LicenseKeyGrant < Dodopayments::Internal::Type::BaseModel
|
|
15
|
+
attr_accessor id: String
|
|
16
|
+
|
|
13
17
|
attr_accessor activations_used: Integer
|
|
14
18
|
|
|
15
19
|
attr_accessor key: String
|
|
16
20
|
|
|
21
|
+
attr_accessor status: Dodopayments::Models::license_key_status
|
|
22
|
+
|
|
17
23
|
attr_accessor activations_limit: Integer?
|
|
18
24
|
|
|
19
25
|
attr_accessor expires_at: Time?
|
|
20
26
|
|
|
21
27
|
def initialize: (
|
|
28
|
+
id: String,
|
|
22
29
|
activations_used: Integer,
|
|
23
30
|
key: String,
|
|
31
|
+
status: Dodopayments::Models::license_key_status,
|
|
24
32
|
?activations_limit: Integer?,
|
|
25
33
|
?expires_at: Time?
|
|
26
34
|
) -> void
|
|
27
35
|
|
|
28
36
|
def to_hash: -> {
|
|
37
|
+
id: String,
|
|
29
38
|
activations_used: Integer,
|
|
30
39
|
key: String,
|
|
40
|
+
status: Dodopayments::Models::license_key_status,
|
|
31
41
|
activations_limit: Integer?,
|
|
32
42
|
expires_at: Time?
|
|
33
43
|
}
|