dodopayments 2.23.0 → 2.25.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/subscription.rb +10 -1
- data/lib/dodopayments/models/subscription_list_params.rb +1 -0
- data/lib/dodopayments/models/subscription_list_response.rb +10 -1
- data/lib/dodopayments/models/subscription_paused_webhook_event.rb +40 -0
- data/lib/dodopayments/models/subscription_status.rb +1 -0
- data/lib/dodopayments/models/subscription_unpaused_webhook_event.rb +40 -0
- data/lib/dodopayments/models/subscription_update_params.rb +10 -1
- data/lib/dodopayments/models/unsafe_unwrap_webhook_event.rb +5 -1
- data/lib/dodopayments/models/unwrap_webhook_event.rb +5 -1
- data/lib/dodopayments/models/webhook_event_type.rb +1 -0
- data/lib/dodopayments/models.rb +6 -0
- data/lib/dodopayments/resources/brands.rb +35 -2
- data/lib/dodopayments/resources/subscriptions.rb +3 -1
- data/lib/dodopayments/resources/webhooks.rb +2 -2
- data/lib/dodopayments/version.rb +1 -1
- data/lib/dodopayments.rb +4 -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/subscription.rbi +10 -0
- data/rbi/dodopayments/models/subscription_list_params.rbi +5 -0
- data/rbi/dodopayments/models/subscription_list_response.rbi +10 -0
- data/rbi/dodopayments/models/subscription_paused_webhook_event.rbi +67 -0
- data/rbi/dodopayments/models/subscription_status.rbi +1 -0
- data/rbi/dodopayments/models/subscription_unpaused_webhook_event.rbi +67 -0
- data/rbi/dodopayments/models/subscription_update_params.rbi +10 -0
- data/rbi/dodopayments/models/unsafe_unwrap_webhook_event.rbi +2 -0
- data/rbi/dodopayments/models/unwrap_webhook_event.rbi +2 -0
- data/rbi/dodopayments/models/webhook_event_type.rbi +5 -0
- data/rbi/dodopayments/models.rbi +8 -0
- data/rbi/dodopayments/resources/brands.rbi +30 -4
- data/rbi/dodopayments/resources/subscriptions.rbi +4 -0
- data/rbi/dodopayments/resources/webhooks.rbi +4 -0
- 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/subscription.rbs +5 -0
- data/sig/dodopayments/models/subscription_list_params.rbs +8 -1
- data/sig/dodopayments/models/subscription_list_response.rbs +5 -0
- data/sig/dodopayments/models/subscription_paused_webhook_event.rbs +35 -0
- data/sig/dodopayments/models/subscription_status.rbs +2 -1
- data/sig/dodopayments/models/subscription_unpaused_webhook_event.rbs +35 -0
- data/sig/dodopayments/models/subscription_update_params.rbs +5 -0
- data/sig/dodopayments/models/unsafe_unwrap_webhook_event.rbs +2 -0
- data/sig/dodopayments/models/unwrap_webhook_event.rbs +2 -0
- data/sig/dodopayments/models/webhook_event_type.rbs +2 -0
- data/sig/dodopayments/models.rbs +6 -0
- data/sig/dodopayments/resources/brands.rbs +7 -0
- data/sig/dodopayments/resources/subscriptions.rbs +1 -0
- data/sig/dodopayments/resources/webhooks.rbs +4 -0
- metadata +14 -2
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"
|
|
@@ -343,6 +345,7 @@ require_relative "dodopayments/models/subscription_failed_webhook_event"
|
|
|
343
345
|
require_relative "dodopayments/models/subscription_list_params"
|
|
344
346
|
require_relative "dodopayments/models/subscription_list_response"
|
|
345
347
|
require_relative "dodopayments/models/subscription_on_hold_webhook_event"
|
|
348
|
+
require_relative "dodopayments/models/subscription_paused_webhook_event"
|
|
346
349
|
require_relative "dodopayments/models/subscription_plan_changed_webhook_event"
|
|
347
350
|
require_relative "dodopayments/models/subscription_preview_change_plan_params"
|
|
348
351
|
require_relative "dodopayments/models/subscription_preview_change_plan_response"
|
|
@@ -353,6 +356,7 @@ require_relative "dodopayments/models/subscription_retrieve_params"
|
|
|
353
356
|
require_relative "dodopayments/models/subscription_retrieve_usage_history_params"
|
|
354
357
|
require_relative "dodopayments/models/subscription_retrieve_usage_history_response"
|
|
355
358
|
require_relative "dodopayments/models/subscription_status"
|
|
359
|
+
require_relative "dodopayments/models/subscription_unpaused_webhook_event"
|
|
356
360
|
require_relative "dodopayments/models/subscription_updated_webhook_event"
|
|
357
361
|
require_relative "dodopayments/models/subscription_update_params"
|
|
358
362
|
require_relative "dodopayments/models/subscription_update_payment_method_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
|
|
@@ -159,6 +159,11 @@ module Dodopayments
|
|
|
159
159
|
sig { returns(T.nilable(Time)) }
|
|
160
160
|
attr_accessor :expires_at
|
|
161
161
|
|
|
162
|
+
# Timestamp when the subscription was paused, if it currently is (or is `OnHold`
|
|
163
|
+
# due to an unresolved pause settlement). `null` otherwise.
|
|
164
|
+
sig { returns(T.nilable(Time)) }
|
|
165
|
+
attr_accessor :paused_at
|
|
166
|
+
|
|
162
167
|
# Saved payment method id used for recurring charges
|
|
163
168
|
sig { returns(T.nilable(String)) }
|
|
164
169
|
attr_accessor :payment_method_id
|
|
@@ -225,6 +230,7 @@ module Dodopayments
|
|
|
225
230
|
discount_id: T.nilable(String),
|
|
226
231
|
discounts: T.nilable(T::Array[Dodopayments::DiscountDetail::OrHash]),
|
|
227
232
|
expires_at: T.nilable(Time),
|
|
233
|
+
paused_at: T.nilable(Time),
|
|
228
234
|
payment_method_id: T.nilable(String),
|
|
229
235
|
scheduled_change:
|
|
230
236
|
T.nilable(Dodopayments::ScheduledPlanChange::OrHash),
|
|
@@ -304,6 +310,9 @@ module Dodopayments
|
|
|
304
310
|
discounts: nil,
|
|
305
311
|
# Timestamp when the subscription will expire
|
|
306
312
|
expires_at: nil,
|
|
313
|
+
# Timestamp when the subscription was paused, if it currently is (or is `OnHold`
|
|
314
|
+
# due to an unresolved pause settlement). `null` otherwise.
|
|
315
|
+
paused_at: nil,
|
|
307
316
|
# Saved payment method id used for recurring charges
|
|
308
317
|
payment_method_id: nil,
|
|
309
318
|
# Scheduled plan change details, if any
|
|
@@ -360,6 +369,7 @@ module Dodopayments
|
|
|
360
369
|
discount_id: T.nilable(String),
|
|
361
370
|
discounts: T.nilable(T::Array[Dodopayments::DiscountDetail]),
|
|
362
371
|
expires_at: T.nilable(Time),
|
|
372
|
+
paused_at: T.nilable(Time),
|
|
363
373
|
payment_method_id: T.nilable(String),
|
|
364
374
|
scheduled_change: T.nilable(Dodopayments::ScheduledPlanChange),
|
|
365
375
|
tax_id: T.nilable(String),
|
|
@@ -166,6 +166,11 @@ module Dodopayments
|
|
|
166
166
|
:on_hold,
|
|
167
167
|
Dodopayments::SubscriptionListParams::Status::TaggedSymbol
|
|
168
168
|
)
|
|
169
|
+
PAUSED =
|
|
170
|
+
T.let(
|
|
171
|
+
:paused,
|
|
172
|
+
Dodopayments::SubscriptionListParams::Status::TaggedSymbol
|
|
173
|
+
)
|
|
169
174
|
CANCELLED =
|
|
170
175
|
T.let(
|
|
171
176
|
:cancelled,
|
|
@@ -126,6 +126,11 @@ module Dodopayments
|
|
|
126
126
|
sig { returns(T.nilable(String)) }
|
|
127
127
|
attr_accessor :discount_id
|
|
128
128
|
|
|
129
|
+
# Timestamp when the subscription was paused, if it currently is (or is `OnHold`
|
|
130
|
+
# due to an unresolved pause settlement). `null` otherwise.
|
|
131
|
+
sig { returns(T.nilable(Time)) }
|
|
132
|
+
attr_accessor :paused_at
|
|
133
|
+
|
|
129
134
|
# Saved payment method id used for recurring charges
|
|
130
135
|
sig { returns(T.nilable(String)) }
|
|
131
136
|
attr_accessor :payment_method_id
|
|
@@ -186,6 +191,7 @@ module Dodopayments
|
|
|
186
191
|
customer_business_name: T.nilable(String),
|
|
187
192
|
discount_cycles_remaining: T.nilable(Integer),
|
|
188
193
|
discount_id: T.nilable(String),
|
|
194
|
+
paused_at: T.nilable(Time),
|
|
189
195
|
payment_method_id: T.nilable(String),
|
|
190
196
|
product_name: T.nilable(String),
|
|
191
197
|
scheduled_change:
|
|
@@ -248,6 +254,9 @@ module Dodopayments
|
|
|
248
254
|
discount_cycles_remaining: nil,
|
|
249
255
|
# DEPRECATED: Use discounts instead.
|
|
250
256
|
discount_id: nil,
|
|
257
|
+
# Timestamp when the subscription was paused, if it currently is (or is `OnHold`
|
|
258
|
+
# due to an unresolved pause settlement). `null` otherwise.
|
|
259
|
+
paused_at: nil,
|
|
251
260
|
# Saved payment method id used for recurring charges
|
|
252
261
|
payment_method_id: nil,
|
|
253
262
|
# Name of the product associated with this subscription
|
|
@@ -296,6 +305,7 @@ module Dodopayments
|
|
|
296
305
|
customer_business_name: T.nilable(String),
|
|
297
306
|
discount_cycles_remaining: T.nilable(Integer),
|
|
298
307
|
discount_id: T.nilable(String),
|
|
308
|
+
paused_at: T.nilable(Time),
|
|
299
309
|
payment_method_id: T.nilable(String),
|
|
300
310
|
product_name: T.nilable(String),
|
|
301
311
|
scheduled_change: T.nilable(Dodopayments::ScheduledPlanChange),
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Models
|
|
5
|
+
class SubscriptionPausedWebhookEvent < Dodopayments::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(
|
|
9
|
+
Dodopayments::SubscriptionPausedWebhookEvent,
|
|
10
|
+
Dodopayments::Internal::AnyHash
|
|
11
|
+
)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# The business identifier
|
|
15
|
+
sig { returns(String) }
|
|
16
|
+
attr_accessor :business_id
|
|
17
|
+
|
|
18
|
+
# Response struct representing subscription details
|
|
19
|
+
sig { returns(Dodopayments::Subscription) }
|
|
20
|
+
attr_reader :data
|
|
21
|
+
|
|
22
|
+
sig { params(data: Dodopayments::Subscription::OrHash).void }
|
|
23
|
+
attr_writer :data
|
|
24
|
+
|
|
25
|
+
# The timestamp of when the event occurred
|
|
26
|
+
sig { returns(Time) }
|
|
27
|
+
attr_accessor :timestamp
|
|
28
|
+
|
|
29
|
+
# The event type
|
|
30
|
+
sig { returns(Symbol) }
|
|
31
|
+
attr_accessor :type
|
|
32
|
+
|
|
33
|
+
sig do
|
|
34
|
+
params(
|
|
35
|
+
business_id: String,
|
|
36
|
+
data: Dodopayments::Subscription::OrHash,
|
|
37
|
+
timestamp: Time,
|
|
38
|
+
type: Symbol
|
|
39
|
+
).returns(T.attached_class)
|
|
40
|
+
end
|
|
41
|
+
def self.new(
|
|
42
|
+
# The business identifier
|
|
43
|
+
business_id:,
|
|
44
|
+
# Response struct representing subscription details
|
|
45
|
+
data:,
|
|
46
|
+
# The timestamp of when the event occurred
|
|
47
|
+
timestamp:,
|
|
48
|
+
# The event type
|
|
49
|
+
type: :"subscription.paused"
|
|
50
|
+
)
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
sig do
|
|
54
|
+
override.returns(
|
|
55
|
+
{
|
|
56
|
+
business_id: String,
|
|
57
|
+
data: Dodopayments::Subscription,
|
|
58
|
+
timestamp: Time,
|
|
59
|
+
type: Symbol
|
|
60
|
+
}
|
|
61
|
+
)
|
|
62
|
+
end
|
|
63
|
+
def to_hash
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
end
|
|
@@ -12,6 +12,7 @@ module Dodopayments
|
|
|
12
12
|
PENDING = T.let(:pending, Dodopayments::SubscriptionStatus::TaggedSymbol)
|
|
13
13
|
ACTIVE = T.let(:active, Dodopayments::SubscriptionStatus::TaggedSymbol)
|
|
14
14
|
ON_HOLD = T.let(:on_hold, Dodopayments::SubscriptionStatus::TaggedSymbol)
|
|
15
|
+
PAUSED = T.let(:paused, Dodopayments::SubscriptionStatus::TaggedSymbol)
|
|
15
16
|
CANCELLED =
|
|
16
17
|
T.let(:cancelled, Dodopayments::SubscriptionStatus::TaggedSymbol)
|
|
17
18
|
FAILED = T.let(:failed, Dodopayments::SubscriptionStatus::TaggedSymbol)
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Models
|
|
5
|
+
class SubscriptionUnpausedWebhookEvent < Dodopayments::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(
|
|
9
|
+
Dodopayments::SubscriptionUnpausedWebhookEvent,
|
|
10
|
+
Dodopayments::Internal::AnyHash
|
|
11
|
+
)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# The business identifier
|
|
15
|
+
sig { returns(String) }
|
|
16
|
+
attr_accessor :business_id
|
|
17
|
+
|
|
18
|
+
# Response struct representing subscription details
|
|
19
|
+
sig { returns(Dodopayments::Subscription) }
|
|
20
|
+
attr_reader :data
|
|
21
|
+
|
|
22
|
+
sig { params(data: Dodopayments::Subscription::OrHash).void }
|
|
23
|
+
attr_writer :data
|
|
24
|
+
|
|
25
|
+
# The timestamp of when the event occurred
|
|
26
|
+
sig { returns(Time) }
|
|
27
|
+
attr_accessor :timestamp
|
|
28
|
+
|
|
29
|
+
# The event type
|
|
30
|
+
sig { returns(Symbol) }
|
|
31
|
+
attr_accessor :type
|
|
32
|
+
|
|
33
|
+
sig do
|
|
34
|
+
params(
|
|
35
|
+
business_id: String,
|
|
36
|
+
data: Dodopayments::Subscription::OrHash,
|
|
37
|
+
timestamp: Time,
|
|
38
|
+
type: Symbol
|
|
39
|
+
).returns(T.attached_class)
|
|
40
|
+
end
|
|
41
|
+
def self.new(
|
|
42
|
+
# The business identifier
|
|
43
|
+
business_id:,
|
|
44
|
+
# Response struct representing subscription details
|
|
45
|
+
data:,
|
|
46
|
+
# The timestamp of when the event occurred
|
|
47
|
+
timestamp:,
|
|
48
|
+
# The event type
|
|
49
|
+
type: :"subscription.unpaused"
|
|
50
|
+
)
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
sig do
|
|
54
|
+
override.returns(
|
|
55
|
+
{
|
|
56
|
+
business_id: String,
|
|
57
|
+
data: Dodopayments::Subscription,
|
|
58
|
+
timestamp: Time,
|
|
59
|
+
type: Symbol
|
|
60
|
+
}
|
|
61
|
+
)
|
|
62
|
+
end
|
|
63
|
+
def to_hash
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
end
|
|
@@ -98,6 +98,11 @@ module Dodopayments
|
|
|
98
98
|
sig { returns(T.nilable(Time)) }
|
|
99
99
|
attr_accessor :next_billing_date
|
|
100
100
|
|
|
101
|
+
# `Some(true)` pauses an active subscription; `Some(false)` unpauses a `Paused`
|
|
102
|
+
# (or abandoned `OnHold`) subscription. Exclusive of every other field.
|
|
103
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
104
|
+
attr_accessor :pause
|
|
105
|
+
|
|
101
106
|
sig { returns(T.nilable(Dodopayments::SubscriptionStatus::OrSymbol)) }
|
|
102
107
|
attr_accessor :status
|
|
103
108
|
|
|
@@ -144,6 +149,7 @@ module Dodopayments
|
|
|
144
149
|
metadata:
|
|
145
150
|
T.nilable(T::Hash[Symbol, Dodopayments::MetadataItem::Variants]),
|
|
146
151
|
next_billing_date: T.nilable(Time),
|
|
152
|
+
pause: T.nilable(T::Boolean),
|
|
147
153
|
status: T.nilable(Dodopayments::SubscriptionStatus::OrSymbol),
|
|
148
154
|
subscription_period_count: T.nilable(Integer),
|
|
149
155
|
subscription_period_interval:
|
|
@@ -176,6 +182,9 @@ module Dodopayments
|
|
|
176
182
|
# Arbitrary key-value metadata. Values can be string, integer, number, or boolean.
|
|
177
183
|
metadata: nil,
|
|
178
184
|
next_billing_date: nil,
|
|
185
|
+
# `Some(true)` pauses an active subscription; `Some(false)` unpauses a `Paused`
|
|
186
|
+
# (or abandoned `OnHold`) subscription. Exclusive of every other field.
|
|
187
|
+
pause: nil,
|
|
179
188
|
status: nil,
|
|
180
189
|
# New number of `subscription_period_interval` units the subscription entitlement
|
|
181
190
|
# should span. Used together with `subscription_period_interval` to extend the
|
|
@@ -219,6 +228,7 @@ module Dodopayments
|
|
|
219
228
|
metadata:
|
|
220
229
|
T.nilable(T::Hash[Symbol, Dodopayments::MetadataItem::Variants]),
|
|
221
230
|
next_billing_date: T.nilable(Time),
|
|
231
|
+
pause: T.nilable(T::Boolean),
|
|
222
232
|
status: T.nilable(Dodopayments::SubscriptionStatus::OrSymbol),
|
|
223
233
|
subscription_period_count: T.nilable(Integer),
|
|
224
234
|
subscription_period_interval:
|
|
@@ -49,8 +49,10 @@ module Dodopayments
|
|
|
49
49
|
Dodopayments::SubscriptionExpiredWebhookEvent,
|
|
50
50
|
Dodopayments::SubscriptionFailedWebhookEvent,
|
|
51
51
|
Dodopayments::SubscriptionOnHoldWebhookEvent,
|
|
52
|
+
Dodopayments::SubscriptionPausedWebhookEvent,
|
|
52
53
|
Dodopayments::SubscriptionPlanChangedWebhookEvent,
|
|
53
54
|
Dodopayments::SubscriptionRenewedWebhookEvent,
|
|
55
|
+
Dodopayments::SubscriptionUnpausedWebhookEvent,
|
|
54
56
|
Dodopayments::SubscriptionUpdatePaymentMethodWebhookEvent,
|
|
55
57
|
Dodopayments::SubscriptionUpdatedWebhookEvent
|
|
56
58
|
)
|
|
@@ -49,8 +49,10 @@ module Dodopayments
|
|
|
49
49
|
Dodopayments::SubscriptionExpiredWebhookEvent,
|
|
50
50
|
Dodopayments::SubscriptionFailedWebhookEvent,
|
|
51
51
|
Dodopayments::SubscriptionOnHoldWebhookEvent,
|
|
52
|
+
Dodopayments::SubscriptionPausedWebhookEvent,
|
|
52
53
|
Dodopayments::SubscriptionPlanChangedWebhookEvent,
|
|
53
54
|
Dodopayments::SubscriptionRenewedWebhookEvent,
|
|
55
|
+
Dodopayments::SubscriptionUnpausedWebhookEvent,
|
|
54
56
|
Dodopayments::SubscriptionUpdatePaymentMethodWebhookEvent,
|
|
55
57
|
Dodopayments::SubscriptionUpdatedWebhookEvent
|
|
56
58
|
)
|
|
@@ -71,6 +71,11 @@ module Dodopayments
|
|
|
71
71
|
:"subscription.paused",
|
|
72
72
|
Dodopayments::WebhookEventType::TaggedSymbol
|
|
73
73
|
)
|
|
74
|
+
SUBSCRIPTION_UNPAUSED =
|
|
75
|
+
T.let(
|
|
76
|
+
:"subscription.unpaused",
|
|
77
|
+
Dodopayments::WebhookEventType::TaggedSymbol
|
|
78
|
+
)
|
|
74
79
|
SUBSCRIPTION_CANCELLED =
|
|
75
80
|
T.let(
|
|
76
81
|
:"subscription.cancelled",
|
data/rbi/dodopayments/models.rbi
CHANGED
|
@@ -40,6 +40,8 @@ module Dodopayments
|
|
|
40
40
|
|
|
41
41
|
Brand = Dodopayments::Models::Brand
|
|
42
42
|
|
|
43
|
+
BrandArchiveParams = Dodopayments::Models::BrandArchiveParams
|
|
44
|
+
|
|
43
45
|
BrandCreateParams = Dodopayments::Models::BrandCreateParams
|
|
44
46
|
|
|
45
47
|
BrandListParams = Dodopayments::Models::BrandListParams
|
|
@@ -495,6 +497,9 @@ module Dodopayments
|
|
|
495
497
|
SubscriptionOnHoldWebhookEvent =
|
|
496
498
|
Dodopayments::Models::SubscriptionOnHoldWebhookEvent
|
|
497
499
|
|
|
500
|
+
SubscriptionPausedWebhookEvent =
|
|
501
|
+
Dodopayments::Models::SubscriptionPausedWebhookEvent
|
|
502
|
+
|
|
498
503
|
SubscriptionPlanChangedWebhookEvent =
|
|
499
504
|
Dodopayments::Models::SubscriptionPlanChangedWebhookEvent
|
|
500
505
|
|
|
@@ -514,6 +519,9 @@ module Dodopayments
|
|
|
514
519
|
|
|
515
520
|
SubscriptionStatus = Dodopayments::Models::SubscriptionStatus
|
|
516
521
|
|
|
522
|
+
SubscriptionUnpausedWebhookEvent =
|
|
523
|
+
Dodopayments::Models::SubscriptionUnpausedWebhookEvent
|
|
524
|
+
|
|
517
525
|
SubscriptionUpdatedWebhookEvent =
|
|
518
526
|
Dodopayments::Models::SubscriptionUpdatedWebhookEvent
|
|
519
527
|
|
|
@@ -64,11 +64,37 @@ module Dodopayments
|
|
|
64
64
|
end
|
|
65
65
|
|
|
66
66
|
sig do
|
|
67
|
-
params(
|
|
68
|
-
|
|
69
|
-
|
|
67
|
+
params(
|
|
68
|
+
include_archived: T::Boolean,
|
|
69
|
+
request_options: Dodopayments::RequestOptions::OrHash
|
|
70
|
+
).returns(Dodopayments::Models::BrandListResponse)
|
|
71
|
+
end
|
|
72
|
+
def list(
|
|
73
|
+
# Set to true to also list archived brands. Default false.
|
|
74
|
+
include_archived: nil,
|
|
75
|
+
request_options: {}
|
|
76
|
+
)
|
|
70
77
|
end
|
|
71
|
-
|
|
78
|
+
|
|
79
|
+
# Archive a brand. Its products, live subscriptions, and product collections move
|
|
80
|
+
# to the `move_products_to` brand. Archive is permanent.
|
|
81
|
+
sig do
|
|
82
|
+
params(
|
|
83
|
+
id: String,
|
|
84
|
+
move_products_to: T.nilable(String),
|
|
85
|
+
request_options: Dodopayments::RequestOptions::OrHash
|
|
86
|
+
).returns(Dodopayments::Models::BrandArchiveResponse)
|
|
87
|
+
end
|
|
88
|
+
def archive(
|
|
89
|
+
# Brand Id
|
|
90
|
+
id,
|
|
91
|
+
# Brand that takes over the products and the live subscriptions of the brand you
|
|
92
|
+
# archive. It must be a brand of the same business, and it must not be archived.
|
|
93
|
+
# The primary brand (its brand id is the business id) is a valid target. Omit this
|
|
94
|
+
# field only when the brand holds no products and no live subscriptions.
|
|
95
|
+
move_products_to: nil,
|
|
96
|
+
request_options: {}
|
|
97
|
+
)
|
|
72
98
|
end
|
|
73
99
|
|
|
74
100
|
sig do
|