dodopayments 2.24.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 +16 -0
- data/README.md +1 -1
- data/lib/dodopayments/models/brand.rb +9 -1
- data/lib/dodopayments/models/brand_archive_params.rb +35 -0
- data/lib/dodopayments/models/brand_archive_response.rb +57 -0
- data/lib/dodopayments/models/brand_list_params.rb +9 -1
- data/lib/dodopayments/models/checkout_session_flags.rb +13 -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/models.rb +2 -0
- data/lib/dodopayments/resources/brands.rb +35 -2
- data/lib/dodopayments/resources/subscriptions.rb +14 -6
- data/lib/dodopayments/version.rb +1 -1
- data/lib/dodopayments.rb +3 -0
- data/rbi/dodopayments/models/brand.rbi +8 -0
- data/rbi/dodopayments/models/brand_archive_params.rbi +58 -0
- data/rbi/dodopayments/models/brand_archive_response.rbi +80 -0
- data/rbi/dodopayments/models/brand_list_params.rbi +22 -5
- data/rbi/dodopayments/models/checkout_session_flags.rbi +22 -3
- 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/models.rbi +2 -0
- data/rbi/dodopayments/resources/brands.rbi +30 -4
- data/rbi/dodopayments/resources/subscriptions.rbi +63 -3
- data/sig/dodopayments/models/brand.rbs +5 -0
- data/sig/dodopayments/models/brand_archive_params.rbs +28 -0
- data/sig/dodopayments/models/brand_archive_response.rbs +45 -0
- data/sig/dodopayments/models/brand_list_params.rbs +14 -3
- data/sig/dodopayments/models/checkout_session_flags.rbs +10 -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/models.rbs +2 -0
- data/sig/dodopayments/resources/brands.rbs +7 -0
- data/sig/dodopayments/resources/subscriptions.rbs +5 -1
- metadata +11 -2
|
@@ -121,9 +121,9 @@ module Dodopayments
|
|
|
121
121
|
#
|
|
122
122
|
# @param next_billing_date [Time, nil]
|
|
123
123
|
#
|
|
124
|
-
# @param pause [Boolean, nil] `
|
|
124
|
+
# @param pause [Boolean, nil] Removed. Use `status: paused` to pause and `status: active` to resume.
|
|
125
125
|
#
|
|
126
|
-
# @param status [Symbol, Dodopayments::Models::SubscriptionStatus, nil]
|
|
126
|
+
# @param status [Symbol, Dodopayments::Models::SubscriptionStatus, nil] Set to `cancelled` to cancel the subscription. See `cancel_reason`,
|
|
127
127
|
#
|
|
128
128
|
# @param subscription_period_count [Integer, nil] New number of `subscription_period_interval` units the subscription
|
|
129
129
|
#
|
|
@@ -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, 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_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: {})
|
|
213
213
|
#
|
|
214
214
|
# @param subscription_id [String] Subscription Id
|
|
215
215
|
#
|
|
@@ -223,6 +223,10 @@ module Dodopayments
|
|
|
223
223
|
#
|
|
224
224
|
# @param addons [Array<Dodopayments::Models::AttachAddon>, nil] Addons for the new plan.
|
|
225
225
|
#
|
|
226
|
+
# @param cancel_scheduled_change_plan [Boolean] Replace a scheduled plan change with this one.
|
|
227
|
+
#
|
|
228
|
+
# @param collect_via_payment_link [Boolean] Collect the plan-change amount with a payment link. The customer then
|
|
229
|
+
#
|
|
226
230
|
# @param discount_code [String, nil] DEPRECATED: Use discount_codes instead. Cannot be used together with discount_co
|
|
227
231
|
#
|
|
228
232
|
# @param discount_codes [Array<String>, nil] Stacked discount codes to apply to the new plan. Max 20.
|
|
@@ -235,7 +239,7 @@ module Dodopayments
|
|
|
235
239
|
#
|
|
236
240
|
# @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
237
241
|
#
|
|
238
|
-
# @return [
|
|
242
|
+
# @return [Dodopayments::Models::SubscriptionChangePlanResponse]
|
|
239
243
|
#
|
|
240
244
|
# @see Dodopayments::Models::SubscriptionChangePlanParams
|
|
241
245
|
def change_plan(subscription_id, params)
|
|
@@ -244,7 +248,7 @@ module Dodopayments
|
|
|
244
248
|
method: :post,
|
|
245
249
|
path: ["subscriptions/%1$s/change-plan", subscription_id],
|
|
246
250
|
body: parsed,
|
|
247
|
-
model:
|
|
251
|
+
model: Dodopayments::Models::SubscriptionChangePlanResponse,
|
|
248
252
|
options: options
|
|
249
253
|
)
|
|
250
254
|
end
|
|
@@ -287,7 +291,7 @@ module Dodopayments
|
|
|
287
291
|
# Some parameter documentations has been truncated, see
|
|
288
292
|
# {Dodopayments::Models::SubscriptionPreviewChangePlanParams} for more details.
|
|
289
293
|
#
|
|
290
|
-
# @overload preview_change_plan(subscription_id, product_id:, proration_billing_mode:, quantity:, adaptive_currency_fees_inclusive: nil, addons: nil, discount_code: nil, discount_codes: nil, effective_at: nil, metadata: nil, on_payment_failure: nil, request_options: {})
|
|
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: {})
|
|
291
295
|
#
|
|
292
296
|
# @param subscription_id [String] Subscription Id
|
|
293
297
|
#
|
|
@@ -301,6 +305,10 @@ module Dodopayments
|
|
|
301
305
|
#
|
|
302
306
|
# @param addons [Array<Dodopayments::Models::AttachAddon>, nil] Addons for the new plan.
|
|
303
307
|
#
|
|
308
|
+
# @param cancel_scheduled_change_plan [Boolean] Replace a scheduled plan change with this one.
|
|
309
|
+
#
|
|
310
|
+
# @param collect_via_payment_link [Boolean] Collect the plan-change amount with a payment link. The customer then
|
|
311
|
+
#
|
|
304
312
|
# @param discount_code [String, nil] DEPRECATED: Use discount_codes instead. Cannot be used together with discount_co
|
|
305
313
|
#
|
|
306
314
|
# @param discount_codes [Array<String>, nil] Stacked discount codes to apply to the new plan. Max 20.
|
data/lib/dodopayments/version.rb
CHANGED
data/lib/dodopayments.rb
CHANGED
|
@@ -84,6 +84,8 @@ require_relative "dodopayments/models/balance_ledger_entry"
|
|
|
84
84
|
require_relative "dodopayments/models/balance_retrieve_ledger_params"
|
|
85
85
|
require_relative "dodopayments/models/billing_address"
|
|
86
86
|
require_relative "dodopayments/models/brand"
|
|
87
|
+
require_relative "dodopayments/models/brand_archive_params"
|
|
88
|
+
require_relative "dodopayments/models/brand_archive_response"
|
|
87
89
|
require_relative "dodopayments/models/brand_create_params"
|
|
88
90
|
require_relative "dodopayments/models/brand_list_params"
|
|
89
91
|
require_relative "dodopayments/models/brand_list_response"
|
|
@@ -333,6 +335,7 @@ require_relative "dodopayments/models/subscription_active_webhook_event"
|
|
|
333
335
|
require_relative "dodopayments/models/subscription_cancel_change_plan_params"
|
|
334
336
|
require_relative "dodopayments/models/subscription_cancelled_webhook_event"
|
|
335
337
|
require_relative "dodopayments/models/subscription_change_plan_params"
|
|
338
|
+
require_relative "dodopayments/models/subscription_change_plan_response"
|
|
336
339
|
require_relative "dodopayments/models/subscription_charge_params"
|
|
337
340
|
require_relative "dodopayments/models/subscription_charge_response"
|
|
338
341
|
require_relative "dodopayments/models/subscription_create_params"
|
|
@@ -26,6 +26,10 @@ module Dodopayments
|
|
|
26
26
|
sig { returns(Dodopayments::Brand::VerificationStatus::TaggedSymbol) }
|
|
27
27
|
attr_accessor :verification_status
|
|
28
28
|
|
|
29
|
+
# Time the brand was archived. Null for an active brand.
|
|
30
|
+
sig { returns(T.nilable(Time)) }
|
|
31
|
+
attr_accessor :archived_at
|
|
32
|
+
|
|
29
33
|
sig { returns(T.nilable(String)) }
|
|
30
34
|
attr_accessor :description
|
|
31
35
|
|
|
@@ -54,6 +58,7 @@ module Dodopayments
|
|
|
54
58
|
verification_enabled: T::Boolean,
|
|
55
59
|
verification_status:
|
|
56
60
|
Dodopayments::Brand::VerificationStatus::OrSymbol,
|
|
61
|
+
archived_at: T.nilable(Time),
|
|
57
62
|
description: T.nilable(String),
|
|
58
63
|
image: T.nilable(String),
|
|
59
64
|
name: T.nilable(String),
|
|
@@ -69,6 +74,8 @@ module Dodopayments
|
|
|
69
74
|
statement_descriptor:,
|
|
70
75
|
verification_enabled:,
|
|
71
76
|
verification_status:,
|
|
77
|
+
# Time the brand was archived. Null for an active brand.
|
|
78
|
+
archived_at: nil,
|
|
72
79
|
description: nil,
|
|
73
80
|
image: nil,
|
|
74
81
|
name: nil,
|
|
@@ -89,6 +96,7 @@ module Dodopayments
|
|
|
89
96
|
verification_enabled: T::Boolean,
|
|
90
97
|
verification_status:
|
|
91
98
|
Dodopayments::Brand::VerificationStatus::TaggedSymbol,
|
|
99
|
+
archived_at: T.nilable(Time),
|
|
92
100
|
description: T.nilable(String),
|
|
93
101
|
image: T.nilable(String),
|
|
94
102
|
name: T.nilable(String),
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Models
|
|
5
|
+
class BrandArchiveParams < 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::BrandArchiveParams,
|
|
13
|
+
Dodopayments::Internal::AnyHash
|
|
14
|
+
)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
sig { returns(String) }
|
|
18
|
+
attr_accessor :id
|
|
19
|
+
|
|
20
|
+
# Brand that takes over the products and the live subscriptions of the brand you
|
|
21
|
+
# archive. It must be a brand of the same business, and it must not be archived.
|
|
22
|
+
# The primary brand (its brand id is the business id) is a valid target. Omit this
|
|
23
|
+
# field only when the brand holds no products and no live subscriptions.
|
|
24
|
+
sig { returns(T.nilable(String)) }
|
|
25
|
+
attr_accessor :move_products_to
|
|
26
|
+
|
|
27
|
+
sig do
|
|
28
|
+
params(
|
|
29
|
+
id: String,
|
|
30
|
+
move_products_to: T.nilable(String),
|
|
31
|
+
request_options: Dodopayments::RequestOptions::OrHash
|
|
32
|
+
).returns(T.attached_class)
|
|
33
|
+
end
|
|
34
|
+
def self.new(
|
|
35
|
+
id:,
|
|
36
|
+
# Brand that takes over the products and the live subscriptions of the brand you
|
|
37
|
+
# archive. It must be a brand of the same business, and it must not be archived.
|
|
38
|
+
# The primary brand (its brand id is the business id) is a valid target. Omit this
|
|
39
|
+
# field only when the brand holds no products and no live subscriptions.
|
|
40
|
+
move_products_to: nil,
|
|
41
|
+
request_options: {}
|
|
42
|
+
)
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
sig do
|
|
46
|
+
override.returns(
|
|
47
|
+
{
|
|
48
|
+
id: String,
|
|
49
|
+
move_products_to: T.nilable(String),
|
|
50
|
+
request_options: Dodopayments::RequestOptions
|
|
51
|
+
}
|
|
52
|
+
)
|
|
53
|
+
end
|
|
54
|
+
def to_hash
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Models
|
|
5
|
+
class BrandArchiveResponse < Dodopayments::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(
|
|
9
|
+
Dodopayments::Models::BrandArchiveResponse,
|
|
10
|
+
Dodopayments::Internal::AnyHash
|
|
11
|
+
)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# Time the brand was archived.
|
|
15
|
+
sig { returns(Time) }
|
|
16
|
+
attr_accessor :archived_at
|
|
17
|
+
|
|
18
|
+
# The archived brand.
|
|
19
|
+
sig { returns(String) }
|
|
20
|
+
attr_accessor :brand_id
|
|
21
|
+
|
|
22
|
+
# Count of product collections moved to the target brand.
|
|
23
|
+
sig { returns(Integer) }
|
|
24
|
+
attr_accessor :collections_moved
|
|
25
|
+
|
|
26
|
+
# Count of products moved to the target brand.
|
|
27
|
+
sig { returns(Integer) }
|
|
28
|
+
attr_accessor :products_moved
|
|
29
|
+
|
|
30
|
+
# Count of live subscriptions moved to the target brand.
|
|
31
|
+
sig { returns(Integer) }
|
|
32
|
+
attr_accessor :subscriptions_moved
|
|
33
|
+
|
|
34
|
+
# Brand that received the moved records. Null when no target was given.
|
|
35
|
+
sig { returns(T.nilable(String)) }
|
|
36
|
+
attr_accessor :moved_to_brand_id
|
|
37
|
+
|
|
38
|
+
sig do
|
|
39
|
+
params(
|
|
40
|
+
archived_at: Time,
|
|
41
|
+
brand_id: String,
|
|
42
|
+
collections_moved: Integer,
|
|
43
|
+
products_moved: Integer,
|
|
44
|
+
subscriptions_moved: Integer,
|
|
45
|
+
moved_to_brand_id: T.nilable(String)
|
|
46
|
+
).returns(T.attached_class)
|
|
47
|
+
end
|
|
48
|
+
def self.new(
|
|
49
|
+
# Time the brand was archived.
|
|
50
|
+
archived_at:,
|
|
51
|
+
# The archived brand.
|
|
52
|
+
brand_id:,
|
|
53
|
+
# Count of product collections moved to the target brand.
|
|
54
|
+
collections_moved:,
|
|
55
|
+
# Count of products moved to the target brand.
|
|
56
|
+
products_moved:,
|
|
57
|
+
# Count of live subscriptions moved to the target brand.
|
|
58
|
+
subscriptions_moved:,
|
|
59
|
+
# Brand that received the moved records. Null when no target was given.
|
|
60
|
+
moved_to_brand_id: nil
|
|
61
|
+
)
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
sig do
|
|
65
|
+
override.returns(
|
|
66
|
+
{
|
|
67
|
+
archived_at: Time,
|
|
68
|
+
brand_id: String,
|
|
69
|
+
collections_moved: Integer,
|
|
70
|
+
products_moved: Integer,
|
|
71
|
+
subscriptions_moved: Integer,
|
|
72
|
+
moved_to_brand_id: T.nilable(String)
|
|
73
|
+
}
|
|
74
|
+
)
|
|
75
|
+
end
|
|
76
|
+
def to_hash
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
end
|
|
80
|
+
end
|
|
@@ -11,16 +11,33 @@ module Dodopayments
|
|
|
11
11
|
T.any(Dodopayments::BrandListParams, Dodopayments::Internal::AnyHash)
|
|
12
12
|
end
|
|
13
13
|
|
|
14
|
+
# Set to true to also list archived brands. Default false.
|
|
15
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
16
|
+
attr_reader :include_archived
|
|
17
|
+
|
|
18
|
+
sig { params(include_archived: T::Boolean).void }
|
|
19
|
+
attr_writer :include_archived
|
|
20
|
+
|
|
14
21
|
sig do
|
|
15
|
-
params(
|
|
16
|
-
T
|
|
17
|
-
|
|
22
|
+
params(
|
|
23
|
+
include_archived: T::Boolean,
|
|
24
|
+
request_options: Dodopayments::RequestOptions::OrHash
|
|
25
|
+
).returns(T.attached_class)
|
|
18
26
|
end
|
|
19
|
-
def self.new(
|
|
27
|
+
def self.new(
|
|
28
|
+
# Set to true to also list archived brands. Default false.
|
|
29
|
+
include_archived: nil,
|
|
30
|
+
request_options: {}
|
|
31
|
+
)
|
|
20
32
|
end
|
|
21
33
|
|
|
22
34
|
sig do
|
|
23
|
-
override.returns(
|
|
35
|
+
override.returns(
|
|
36
|
+
{
|
|
37
|
+
include_archived: T::Boolean,
|
|
38
|
+
request_options: Dodopayments::RequestOptions
|
|
39
|
+
}
|
|
40
|
+
)
|
|
24
41
|
end
|
|
25
42
|
def to_hash
|
|
26
43
|
end
|
|
@@ -147,6 +147,17 @@ module Dodopayments
|
|
|
147
147
|
sig { params(require_phone_number: T::Boolean).void }
|
|
148
148
|
attr_writer :require_phone_number
|
|
149
149
|
|
|
150
|
+
# If true, the session uses the single-page checkout flow: the page initializes
|
|
151
|
+
# the payment at load time and confirms it in place, with no separate payment
|
|
152
|
+
# page.
|
|
153
|
+
#
|
|
154
|
+
# Default is false
|
|
155
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
156
|
+
attr_reader :single_page
|
|
157
|
+
|
|
158
|
+
sig { params(single_page: T::Boolean).void }
|
|
159
|
+
attr_writer :single_page
|
|
160
|
+
|
|
150
161
|
sig do
|
|
151
162
|
params(
|
|
152
163
|
allow_currency_selection: T::Boolean,
|
|
@@ -165,7 +176,8 @@ module Dodopayments
|
|
|
165
176
|
allow_tax_id: T::Boolean,
|
|
166
177
|
always_create_new_customer: T::Boolean,
|
|
167
178
|
redirect_immediately: T::Boolean,
|
|
168
|
-
require_phone_number: T::Boolean
|
|
179
|
+
require_phone_number: T::Boolean,
|
|
180
|
+
single_page: T::Boolean
|
|
169
181
|
).returns(T.attached_class)
|
|
170
182
|
end
|
|
171
183
|
def self.new(
|
|
@@ -219,7 +231,13 @@ module Dodopayments
|
|
|
219
231
|
# `allow_phone_number_collection` to also be true.
|
|
220
232
|
#
|
|
221
233
|
# Default is false
|
|
222
|
-
require_phone_number: nil
|
|
234
|
+
require_phone_number: nil,
|
|
235
|
+
# If true, the session uses the single-page checkout flow: the page initializes
|
|
236
|
+
# the payment at load time and confirms it in place, with no separate payment
|
|
237
|
+
# page.
|
|
238
|
+
#
|
|
239
|
+
# Default is false
|
|
240
|
+
single_page: nil
|
|
223
241
|
)
|
|
224
242
|
end
|
|
225
243
|
|
|
@@ -242,7 +260,8 @@ module Dodopayments
|
|
|
242
260
|
allow_tax_id: T::Boolean,
|
|
243
261
|
always_create_new_customer: T::Boolean,
|
|
244
262
|
redirect_immediately: T::Boolean,
|
|
245
|
-
require_phone_number: T::Boolean
|
|
263
|
+
require_phone_number: T::Boolean,
|
|
264
|
+
single_page: T::Boolean
|
|
246
265
|
}
|
|
247
266
|
)
|
|
248
267
|
end
|
|
@@ -12,7 +12,12 @@ module Dodopayments
|
|
|
12
12
|
)
|
|
13
13
|
end
|
|
14
14
|
|
|
15
|
-
#
|
|
15
|
+
# Identifier of the issued license key.
|
|
16
|
+
sig { returns(String) }
|
|
17
|
+
attr_accessor :id
|
|
18
|
+
|
|
19
|
+
# Number of instances currently active. Activation increments it and deactivation
|
|
20
|
+
# decrements it, so it is a live count and not a total.
|
|
16
21
|
sig { returns(Integer) }
|
|
17
22
|
attr_accessor :activations_used
|
|
18
23
|
|
|
@@ -20,6 +25,11 @@ module Dodopayments
|
|
|
20
25
|
sig { returns(String) }
|
|
21
26
|
attr_accessor :key
|
|
22
27
|
|
|
28
|
+
# Current status of the license key. Activation fails unless it is `active`, so a
|
|
29
|
+
# client can warn before the customer tries.
|
|
30
|
+
sig { returns(Dodopayments::LicenseKeyStatus::TaggedSymbol) }
|
|
31
|
+
attr_accessor :status
|
|
32
|
+
|
|
23
33
|
# Maximum activations allowed by the entitlement, when set.
|
|
24
34
|
sig { returns(T.nilable(Integer)) }
|
|
25
35
|
attr_accessor :activations_limit
|
|
@@ -32,17 +42,25 @@ module Dodopayments
|
|
|
32
42
|
# The grant's top-level `status` is the source of truth for the grant's lifecycle.
|
|
33
43
|
sig do
|
|
34
44
|
params(
|
|
45
|
+
id: String,
|
|
35
46
|
activations_used: Integer,
|
|
36
47
|
key: String,
|
|
48
|
+
status: Dodopayments::LicenseKeyStatus::OrSymbol,
|
|
37
49
|
activations_limit: T.nilable(Integer),
|
|
38
50
|
expires_at: T.nilable(Time)
|
|
39
51
|
).returns(T.attached_class)
|
|
40
52
|
end
|
|
41
53
|
def self.new(
|
|
42
|
-
#
|
|
54
|
+
# Identifier of the issued license key.
|
|
55
|
+
id:,
|
|
56
|
+
# Number of instances currently active. Activation increments it and deactivation
|
|
57
|
+
# decrements it, so it is a live count and not a total.
|
|
43
58
|
activations_used:,
|
|
44
59
|
# Issued license key.
|
|
45
60
|
key:,
|
|
61
|
+
# Current status of the license key. Activation fails unless it is `active`, so a
|
|
62
|
+
# client can warn before the customer tries.
|
|
63
|
+
status:,
|
|
46
64
|
# Maximum activations allowed by the entitlement, when set.
|
|
47
65
|
activations_limit: nil,
|
|
48
66
|
# When the license key expires, when applicable.
|
|
@@ -53,8 +71,10 @@ module Dodopayments
|
|
|
53
71
|
sig do
|
|
54
72
|
override.returns(
|
|
55
73
|
{
|
|
74
|
+
id: String,
|
|
56
75
|
activations_used: Integer,
|
|
57
76
|
key: String,
|
|
77
|
+
status: Dodopayments::LicenseKeyStatus::TaggedSymbol,
|
|
58
78
|
activations_limit: T.nilable(Integer),
|
|
59
79
|
expires_at: T.nilable(Time)
|
|
60
80
|
}
|
|
@@ -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
|
)
|