dodopayments 1.61.6 → 1.66.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/internal/type/union.rb +7 -9
- data/lib/dodopayments/models/billing_address.rb +18 -18
- data/lib/dodopayments/models/checkout_session_request.rb +10 -1
- data/lib/dodopayments/models/subscription_preview_change_plan_params.rb +63 -0
- data/lib/dodopayments/models/subscription_preview_change_plan_response.rb +388 -0
- data/lib/dodopayments/models/subscription_updated_webhook_event.rb +76 -0
- data/lib/dodopayments/models/unsafe_unwrap_webhook_event.rb +3 -1
- data/lib/dodopayments/models/unwrap_webhook_event.rb +3 -1
- data/lib/dodopayments/models/webhook_event_type.rb +1 -0
- data/lib/dodopayments/models.rb +4 -0
- data/lib/dodopayments/resources/checkout_sessions.rb +3 -1
- data/lib/dodopayments/resources/subscriptions.rb +31 -0
- 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/billing_address.rbi +20 -20
- data/rbi/dodopayments/models/checkout_session_request.rbi +13 -0
- data/rbi/dodopayments/models/subscription_preview_change_plan_params.rbi +118 -0
- data/rbi/dodopayments/models/subscription_preview_change_plan_response.rbi +633 -0
- data/rbi/dodopayments/models/subscription_updated_webhook_event.rbi +185 -0
- data/rbi/dodopayments/models/unsafe_unwrap_webhook_event.rbi +2 -1
- data/rbi/dodopayments/models/unwrap_webhook_event.rbi +2 -1
- data/rbi/dodopayments/models/webhook_event_type.rbi +5 -0
- data/rbi/dodopayments/models.rbi +6 -0
- data/rbi/dodopayments/resources/checkout_sessions.rbi +4 -0
- data/rbi/dodopayments/resources/subscriptions.rbi +27 -0
- data/rbi/dodopayments/resources/webhooks.rbi +4 -2
- data/sig/dodopayments/models/billing_address.rbs +17 -17
- data/sig/dodopayments/models/checkout_session_request.rbs +7 -0
- data/sig/dodopayments/models/subscription_preview_change_plan_params.rbs +54 -0
- data/sig/dodopayments/models/subscription_preview_change_plan_response.rbs +356 -0
- data/sig/dodopayments/models/subscription_updated_webhook_event.rbs +76 -0
- data/sig/dodopayments/models/unsafe_unwrap_webhook_event.rbs +1 -0
- data/sig/dodopayments/models/unwrap_webhook_event.rbs +1 -0
- data/sig/dodopayments/models/webhook_event_type.rbs +2 -0
- data/sig/dodopayments/models.rbs +4 -0
- data/sig/dodopayments/resources/checkout_sessions.rbs +1 -0
- data/sig/dodopayments/resources/subscriptions.rbs +9 -0
- data/sig/dodopayments/resources/webhooks.rbs +4 -2
- metadata +11 -2
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Models
|
|
5
|
+
class SubscriptionUpdatedWebhookEvent < Dodopayments::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(
|
|
9
|
+
Dodopayments::SubscriptionUpdatedWebhookEvent,
|
|
10
|
+
Dodopayments::Internal::AnyHash
|
|
11
|
+
)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# The business identifier
|
|
15
|
+
sig { returns(String) }
|
|
16
|
+
attr_accessor :business_id
|
|
17
|
+
|
|
18
|
+
# Event-specific data
|
|
19
|
+
sig { returns(Dodopayments::SubscriptionUpdatedWebhookEvent::Data) }
|
|
20
|
+
attr_reader :data
|
|
21
|
+
|
|
22
|
+
sig do
|
|
23
|
+
params(
|
|
24
|
+
data: Dodopayments::SubscriptionUpdatedWebhookEvent::Data::OrHash
|
|
25
|
+
).void
|
|
26
|
+
end
|
|
27
|
+
attr_writer :data
|
|
28
|
+
|
|
29
|
+
# The timestamp of when the event occurred
|
|
30
|
+
sig { returns(Time) }
|
|
31
|
+
attr_accessor :timestamp
|
|
32
|
+
|
|
33
|
+
# The event type
|
|
34
|
+
sig do
|
|
35
|
+
returns(
|
|
36
|
+
Dodopayments::SubscriptionUpdatedWebhookEvent::Type::TaggedSymbol
|
|
37
|
+
)
|
|
38
|
+
end
|
|
39
|
+
attr_accessor :type
|
|
40
|
+
|
|
41
|
+
sig do
|
|
42
|
+
params(
|
|
43
|
+
business_id: String,
|
|
44
|
+
data: Dodopayments::SubscriptionUpdatedWebhookEvent::Data::OrHash,
|
|
45
|
+
timestamp: Time,
|
|
46
|
+
type: Dodopayments::SubscriptionUpdatedWebhookEvent::Type::OrSymbol
|
|
47
|
+
).returns(T.attached_class)
|
|
48
|
+
end
|
|
49
|
+
def self.new(
|
|
50
|
+
# The business identifier
|
|
51
|
+
business_id:,
|
|
52
|
+
# Event-specific data
|
|
53
|
+
data:,
|
|
54
|
+
# The timestamp of when the event occurred
|
|
55
|
+
timestamp:,
|
|
56
|
+
# The event type
|
|
57
|
+
type:
|
|
58
|
+
)
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
sig do
|
|
62
|
+
override.returns(
|
|
63
|
+
{
|
|
64
|
+
business_id: String,
|
|
65
|
+
data: Dodopayments::SubscriptionUpdatedWebhookEvent::Data,
|
|
66
|
+
timestamp: Time,
|
|
67
|
+
type:
|
|
68
|
+
Dodopayments::SubscriptionUpdatedWebhookEvent::Type::TaggedSymbol
|
|
69
|
+
}
|
|
70
|
+
)
|
|
71
|
+
end
|
|
72
|
+
def to_hash
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
class Data < Dodopayments::Models::Subscription
|
|
76
|
+
OrHash =
|
|
77
|
+
T.type_alias do
|
|
78
|
+
T.any(
|
|
79
|
+
Dodopayments::SubscriptionUpdatedWebhookEvent::Data,
|
|
80
|
+
Dodopayments::Internal::AnyHash
|
|
81
|
+
)
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
# The type of payload in the data field
|
|
85
|
+
sig do
|
|
86
|
+
returns(
|
|
87
|
+
T.nilable(
|
|
88
|
+
Dodopayments::SubscriptionUpdatedWebhookEvent::Data::PayloadType::TaggedSymbol
|
|
89
|
+
)
|
|
90
|
+
)
|
|
91
|
+
end
|
|
92
|
+
attr_reader :payload_type
|
|
93
|
+
|
|
94
|
+
sig do
|
|
95
|
+
params(
|
|
96
|
+
payload_type:
|
|
97
|
+
Dodopayments::SubscriptionUpdatedWebhookEvent::Data::PayloadType::OrSymbol
|
|
98
|
+
).void
|
|
99
|
+
end
|
|
100
|
+
attr_writer :payload_type
|
|
101
|
+
|
|
102
|
+
# Event-specific data
|
|
103
|
+
sig do
|
|
104
|
+
params(
|
|
105
|
+
payload_type:
|
|
106
|
+
Dodopayments::SubscriptionUpdatedWebhookEvent::Data::PayloadType::OrSymbol
|
|
107
|
+
).returns(T.attached_class)
|
|
108
|
+
end
|
|
109
|
+
def self.new(
|
|
110
|
+
# The type of payload in the data field
|
|
111
|
+
payload_type: nil
|
|
112
|
+
)
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
sig do
|
|
116
|
+
override.returns(
|
|
117
|
+
{
|
|
118
|
+
payload_type:
|
|
119
|
+
Dodopayments::SubscriptionUpdatedWebhookEvent::Data::PayloadType::TaggedSymbol
|
|
120
|
+
}
|
|
121
|
+
)
|
|
122
|
+
end
|
|
123
|
+
def to_hash
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
# The type of payload in the data field
|
|
127
|
+
module PayloadType
|
|
128
|
+
extend Dodopayments::Internal::Type::Enum
|
|
129
|
+
|
|
130
|
+
TaggedSymbol =
|
|
131
|
+
T.type_alias do
|
|
132
|
+
T.all(
|
|
133
|
+
Symbol,
|
|
134
|
+
Dodopayments::SubscriptionUpdatedWebhookEvent::Data::PayloadType
|
|
135
|
+
)
|
|
136
|
+
end
|
|
137
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
138
|
+
|
|
139
|
+
SUBSCRIPTION =
|
|
140
|
+
T.let(
|
|
141
|
+
:Subscription,
|
|
142
|
+
Dodopayments::SubscriptionUpdatedWebhookEvent::Data::PayloadType::TaggedSymbol
|
|
143
|
+
)
|
|
144
|
+
|
|
145
|
+
sig do
|
|
146
|
+
override.returns(
|
|
147
|
+
T::Array[
|
|
148
|
+
Dodopayments::SubscriptionUpdatedWebhookEvent::Data::PayloadType::TaggedSymbol
|
|
149
|
+
]
|
|
150
|
+
)
|
|
151
|
+
end
|
|
152
|
+
def self.values
|
|
153
|
+
end
|
|
154
|
+
end
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
# The event type
|
|
158
|
+
module Type
|
|
159
|
+
extend Dodopayments::Internal::Type::Enum
|
|
160
|
+
|
|
161
|
+
TaggedSymbol =
|
|
162
|
+
T.type_alias do
|
|
163
|
+
T.all(Symbol, Dodopayments::SubscriptionUpdatedWebhookEvent::Type)
|
|
164
|
+
end
|
|
165
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
166
|
+
|
|
167
|
+
SUBSCRIPTION_UPDATED =
|
|
168
|
+
T.let(
|
|
169
|
+
:"subscription.updated",
|
|
170
|
+
Dodopayments::SubscriptionUpdatedWebhookEvent::Type::TaggedSymbol
|
|
171
|
+
)
|
|
172
|
+
|
|
173
|
+
sig do
|
|
174
|
+
override.returns(
|
|
175
|
+
T::Array[
|
|
176
|
+
Dodopayments::SubscriptionUpdatedWebhookEvent::Type::TaggedSymbol
|
|
177
|
+
]
|
|
178
|
+
)
|
|
179
|
+
end
|
|
180
|
+
def self.values
|
|
181
|
+
end
|
|
182
|
+
end
|
|
183
|
+
end
|
|
184
|
+
end
|
|
185
|
+
end
|
|
@@ -28,7 +28,8 @@ module Dodopayments
|
|
|
28
28
|
Dodopayments::SubscriptionFailedWebhookEvent,
|
|
29
29
|
Dodopayments::SubscriptionOnHoldWebhookEvent,
|
|
30
30
|
Dodopayments::SubscriptionPlanChangedWebhookEvent,
|
|
31
|
-
Dodopayments::SubscriptionRenewedWebhookEvent
|
|
31
|
+
Dodopayments::SubscriptionRenewedWebhookEvent,
|
|
32
|
+
Dodopayments::SubscriptionUpdatedWebhookEvent
|
|
32
33
|
)
|
|
33
34
|
end
|
|
34
35
|
|
|
@@ -28,7 +28,8 @@ module Dodopayments
|
|
|
28
28
|
Dodopayments::SubscriptionFailedWebhookEvent,
|
|
29
29
|
Dodopayments::SubscriptionOnHoldWebhookEvent,
|
|
30
30
|
Dodopayments::SubscriptionPlanChangedWebhookEvent,
|
|
31
|
-
Dodopayments::SubscriptionRenewedWebhookEvent
|
|
31
|
+
Dodopayments::SubscriptionRenewedWebhookEvent,
|
|
32
|
+
Dodopayments::SubscriptionUpdatedWebhookEvent
|
|
32
33
|
)
|
|
33
34
|
end
|
|
34
35
|
|
|
@@ -86,6 +86,11 @@ module Dodopayments
|
|
|
86
86
|
:"subscription.plan_changed",
|
|
87
87
|
Dodopayments::WebhookEventType::TaggedSymbol
|
|
88
88
|
)
|
|
89
|
+
SUBSCRIPTION_UPDATED =
|
|
90
|
+
T.let(
|
|
91
|
+
:"subscription.updated",
|
|
92
|
+
Dodopayments::WebhookEventType::TaggedSymbol
|
|
93
|
+
)
|
|
89
94
|
LICENSE_KEY_CREATED =
|
|
90
95
|
T.let(
|
|
91
96
|
:"license_key.created",
|
data/rbi/dodopayments/models.rbi
CHANGED
|
@@ -272,6 +272,9 @@ module Dodopayments
|
|
|
272
272
|
SubscriptionPlanChangedWebhookEvent =
|
|
273
273
|
Dodopayments::Models::SubscriptionPlanChangedWebhookEvent
|
|
274
274
|
|
|
275
|
+
SubscriptionPreviewChangePlanParams =
|
|
276
|
+
Dodopayments::Models::SubscriptionPreviewChangePlanParams
|
|
277
|
+
|
|
275
278
|
SubscriptionRenewedWebhookEvent =
|
|
276
279
|
Dodopayments::Models::SubscriptionRenewedWebhookEvent
|
|
277
280
|
|
|
@@ -282,6 +285,9 @@ module Dodopayments
|
|
|
282
285
|
|
|
283
286
|
SubscriptionStatus = Dodopayments::Models::SubscriptionStatus
|
|
284
287
|
|
|
288
|
+
SubscriptionUpdatedWebhookEvent =
|
|
289
|
+
Dodopayments::Models::SubscriptionUpdatedWebhookEvent
|
|
290
|
+
|
|
285
291
|
SubscriptionUpdateParams = Dodopayments::Models::SubscriptionUpdateParams
|
|
286
292
|
|
|
287
293
|
SubscriptionUpdatePaymentMethodParams =
|
|
@@ -29,6 +29,7 @@ module Dodopayments
|
|
|
29
29
|
Dodopayments::CheckoutSessionRequest::FeatureFlags::OrHash,
|
|
30
30
|
force_3ds: T.nilable(T::Boolean),
|
|
31
31
|
metadata: T.nilable(T::Hash[Symbol, String]),
|
|
32
|
+
minimal_address: T::Boolean,
|
|
32
33
|
return_url: T.nilable(String),
|
|
33
34
|
show_saved_payment_methods: T::Boolean,
|
|
34
35
|
subscription_data:
|
|
@@ -65,6 +66,9 @@ module Dodopayments
|
|
|
65
66
|
# Additional metadata associated with the payment. Defaults to empty if not
|
|
66
67
|
# provided.
|
|
67
68
|
metadata: nil,
|
|
69
|
+
# If true, only zipcode is required when confirm is true; other address fields
|
|
70
|
+
# remain optional
|
|
71
|
+
minimal_address: nil,
|
|
68
72
|
# The url to redirect after payment failure or success.
|
|
69
73
|
return_url: nil,
|
|
70
74
|
# Display saved payment methods of a returning customer False by default
|
|
@@ -221,6 +221,33 @@ module Dodopayments
|
|
|
221
221
|
)
|
|
222
222
|
end
|
|
223
223
|
|
|
224
|
+
sig do
|
|
225
|
+
params(
|
|
226
|
+
subscription_id: String,
|
|
227
|
+
product_id: String,
|
|
228
|
+
proration_billing_mode:
|
|
229
|
+
Dodopayments::SubscriptionPreviewChangePlanParams::ProrationBillingMode::OrSymbol,
|
|
230
|
+
quantity: Integer,
|
|
231
|
+
addons: T.nilable(T::Array[Dodopayments::AttachAddon::OrHash]),
|
|
232
|
+
request_options: Dodopayments::RequestOptions::OrHash
|
|
233
|
+
).returns(Dodopayments::Models::SubscriptionPreviewChangePlanResponse)
|
|
234
|
+
end
|
|
235
|
+
def preview_change_plan(
|
|
236
|
+
# Subscription Id
|
|
237
|
+
subscription_id,
|
|
238
|
+
# Unique identifier of the product to subscribe to
|
|
239
|
+
product_id:,
|
|
240
|
+
# Proration Billing Mode
|
|
241
|
+
proration_billing_mode:,
|
|
242
|
+
# Number of units to subscribe for. Must be at least 1.
|
|
243
|
+
quantity:,
|
|
244
|
+
# Addons for the new plan. Note : Leaving this empty would remove any existing
|
|
245
|
+
# addons
|
|
246
|
+
addons: nil,
|
|
247
|
+
request_options: {}
|
|
248
|
+
)
|
|
249
|
+
end
|
|
250
|
+
|
|
224
251
|
# Get detailed usage history for a subscription that includes usage-based billing
|
|
225
252
|
# (metered components). This endpoint provides insights into customer usage
|
|
226
253
|
# patterns and billing calculations over time.
|
|
@@ -151,7 +151,8 @@ module Dodopayments
|
|
|
151
151
|
Dodopayments::SubscriptionFailedWebhookEvent,
|
|
152
152
|
Dodopayments::SubscriptionOnHoldWebhookEvent,
|
|
153
153
|
Dodopayments::SubscriptionPlanChangedWebhookEvent,
|
|
154
|
-
Dodopayments::SubscriptionRenewedWebhookEvent
|
|
154
|
+
Dodopayments::SubscriptionRenewedWebhookEvent,
|
|
155
|
+
Dodopayments::SubscriptionUpdatedWebhookEvent
|
|
155
156
|
)
|
|
156
157
|
)
|
|
157
158
|
end
|
|
@@ -184,7 +185,8 @@ module Dodopayments
|
|
|
184
185
|
Dodopayments::SubscriptionFailedWebhookEvent,
|
|
185
186
|
Dodopayments::SubscriptionOnHoldWebhookEvent,
|
|
186
187
|
Dodopayments::SubscriptionPlanChangedWebhookEvent,
|
|
187
|
-
Dodopayments::SubscriptionRenewedWebhookEvent
|
|
188
|
+
Dodopayments::SubscriptionRenewedWebhookEvent,
|
|
189
|
+
Dodopayments::SubscriptionUpdatedWebhookEvent
|
|
188
190
|
)
|
|
189
191
|
)
|
|
190
192
|
end
|
|
@@ -2,38 +2,38 @@ module Dodopayments
|
|
|
2
2
|
module Models
|
|
3
3
|
type billing_address =
|
|
4
4
|
{
|
|
5
|
-
city: String,
|
|
6
5
|
country: Dodopayments::Models::country_code,
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
city: String?,
|
|
7
|
+
state: String?,
|
|
8
|
+
street: String?,
|
|
9
|
+
zipcode: String?
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
class BillingAddress < Dodopayments::Internal::Type::BaseModel
|
|
13
|
-
attr_accessor city: String
|
|
14
|
-
|
|
15
13
|
attr_accessor country: Dodopayments::Models::country_code
|
|
16
14
|
|
|
17
|
-
attr_accessor
|
|
15
|
+
attr_accessor city: String?
|
|
16
|
+
|
|
17
|
+
attr_accessor state: String?
|
|
18
18
|
|
|
19
|
-
attr_accessor street: String
|
|
19
|
+
attr_accessor street: String?
|
|
20
20
|
|
|
21
|
-
attr_accessor zipcode: String
|
|
21
|
+
attr_accessor zipcode: String?
|
|
22
22
|
|
|
23
23
|
def initialize: (
|
|
24
|
-
city: String,
|
|
25
24
|
country: Dodopayments::Models::country_code,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
?city: String?,
|
|
26
|
+
?state: String?,
|
|
27
|
+
?street: String?,
|
|
28
|
+
?zipcode: String?
|
|
29
29
|
) -> void
|
|
30
30
|
|
|
31
31
|
def to_hash: -> {
|
|
32
|
-
city: String,
|
|
33
32
|
country: Dodopayments::Models::country_code,
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
city: String?,
|
|
34
|
+
state: String?,
|
|
35
|
+
street: String?,
|
|
36
|
+
zipcode: String?
|
|
37
37
|
}
|
|
38
38
|
end
|
|
39
39
|
end
|
|
@@ -13,6 +13,7 @@ module Dodopayments
|
|
|
13
13
|
feature_flags: Dodopayments::CheckoutSessionRequest::FeatureFlags,
|
|
14
14
|
:force_3ds => bool?,
|
|
15
15
|
metadata: ::Hash[Symbol, String]?,
|
|
16
|
+
minimal_address: bool,
|
|
16
17
|
return_url: String?,
|
|
17
18
|
show_saved_payment_methods: bool,
|
|
18
19
|
subscription_data: Dodopayments::CheckoutSessionRequest::SubscriptionData?
|
|
@@ -51,6 +52,10 @@ module Dodopayments
|
|
|
51
52
|
|
|
52
53
|
attr_accessor metadata: ::Hash[Symbol, String]?
|
|
53
54
|
|
|
55
|
+
attr_reader minimal_address: bool?
|
|
56
|
+
|
|
57
|
+
def minimal_address=: (bool) -> bool
|
|
58
|
+
|
|
54
59
|
attr_accessor return_url: String?
|
|
55
60
|
|
|
56
61
|
attr_reader show_saved_payment_methods: bool?
|
|
@@ -71,6 +76,7 @@ module Dodopayments
|
|
|
71
76
|
?feature_flags: Dodopayments::CheckoutSessionRequest::FeatureFlags,
|
|
72
77
|
?force_3ds: bool?,
|
|
73
78
|
?metadata: ::Hash[Symbol, String]?,
|
|
79
|
+
?minimal_address: bool,
|
|
74
80
|
?return_url: String?,
|
|
75
81
|
?show_saved_payment_methods: bool,
|
|
76
82
|
?subscription_data: Dodopayments::CheckoutSessionRequest::SubscriptionData?
|
|
@@ -88,6 +94,7 @@ module Dodopayments
|
|
|
88
94
|
feature_flags: Dodopayments::CheckoutSessionRequest::FeatureFlags,
|
|
89
95
|
:force_3ds => bool?,
|
|
90
96
|
metadata: ::Hash[Symbol, String]?,
|
|
97
|
+
minimal_address: bool,
|
|
91
98
|
return_url: String?,
|
|
92
99
|
show_saved_payment_methods: bool,
|
|
93
100
|
subscription_data: Dodopayments::CheckoutSessionRequest::SubscriptionData?
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
module Dodopayments
|
|
2
|
+
module Models
|
|
3
|
+
type subscription_preview_change_plan_params =
|
|
4
|
+
{
|
|
5
|
+
product_id: String,
|
|
6
|
+
proration_billing_mode: Dodopayments::Models::SubscriptionPreviewChangePlanParams::proration_billing_mode,
|
|
7
|
+
quantity: Integer,
|
|
8
|
+
addons: ::Array[Dodopayments::AttachAddon]?
|
|
9
|
+
}
|
|
10
|
+
& Dodopayments::Internal::Type::request_parameters
|
|
11
|
+
|
|
12
|
+
class SubscriptionPreviewChangePlanParams < Dodopayments::Internal::Type::BaseModel
|
|
13
|
+
extend Dodopayments::Internal::Type::RequestParameters::Converter
|
|
14
|
+
include Dodopayments::Internal::Type::RequestParameters
|
|
15
|
+
|
|
16
|
+
attr_accessor product_id: String
|
|
17
|
+
|
|
18
|
+
attr_accessor proration_billing_mode: Dodopayments::Models::SubscriptionPreviewChangePlanParams::proration_billing_mode
|
|
19
|
+
|
|
20
|
+
attr_accessor quantity: Integer
|
|
21
|
+
|
|
22
|
+
attr_accessor addons: ::Array[Dodopayments::AttachAddon]?
|
|
23
|
+
|
|
24
|
+
def initialize: (
|
|
25
|
+
product_id: String,
|
|
26
|
+
proration_billing_mode: Dodopayments::Models::SubscriptionPreviewChangePlanParams::proration_billing_mode,
|
|
27
|
+
quantity: Integer,
|
|
28
|
+
?addons: ::Array[Dodopayments::AttachAddon]?,
|
|
29
|
+
?request_options: Dodopayments::request_opts
|
|
30
|
+
) -> void
|
|
31
|
+
|
|
32
|
+
def to_hash: -> {
|
|
33
|
+
product_id: String,
|
|
34
|
+
proration_billing_mode: Dodopayments::Models::SubscriptionPreviewChangePlanParams::proration_billing_mode,
|
|
35
|
+
quantity: Integer,
|
|
36
|
+
addons: ::Array[Dodopayments::AttachAddon]?,
|
|
37
|
+
request_options: Dodopayments::RequestOptions
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
type proration_billing_mode =
|
|
41
|
+
:prorated_immediately | :full_immediately | :difference_immediately
|
|
42
|
+
|
|
43
|
+
module ProrationBillingMode
|
|
44
|
+
extend Dodopayments::Internal::Type::Enum
|
|
45
|
+
|
|
46
|
+
PRORATED_IMMEDIATELY: :prorated_immediately
|
|
47
|
+
FULL_IMMEDIATELY: :full_immediately
|
|
48
|
+
DIFFERENCE_IMMEDIATELY: :difference_immediately
|
|
49
|
+
|
|
50
|
+
def self?.values: -> ::Array[Dodopayments::Models::SubscriptionPreviewChangePlanParams::proration_billing_mode]
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|