dodopayments 1.47.0 → 1.51.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 +24 -0
- data/README.md +17 -51
- data/lib/dodopayments/client.rb +4 -4
- data/lib/dodopayments/internal/transport/base_client.rb +1 -4
- data/lib/dodopayments/internal/transport/pooled_net_requester.rb +1 -9
- data/lib/dodopayments/internal/type/base_model.rb +6 -11
- data/lib/dodopayments/internal/util.rb +1 -1
- data/lib/dodopayments/models/checkout_session_create_params.rb +14 -0
- data/lib/dodopayments/models/checkout_session_request.rb +347 -0
- data/lib/dodopayments/models/checkout_session_response.rb +25 -0
- data/lib/dodopayments/models/on_demand_subscription.rb +58 -0
- data/lib/dodopayments/models/payment_create_params.rb +1 -4
- data/lib/dodopayments/models/subscription.rb +9 -1
- data/lib/dodopayments/models/subscription_create_params.rb +3 -56
- data/lib/dodopayments/models/subscription_update_params.rb +16 -2
- data/lib/dodopayments/models/webhook_create_params.rb +6 -9
- data/lib/dodopayments/models/{webhook_create_response.rb → webhook_details.rb} +2 -2
- data/lib/dodopayments/models/webhook_retrieve_secret_params.rb +14 -0
- data/lib/dodopayments/models/webhook_retrieve_secret_response.rb +16 -0
- data/lib/dodopayments/models.rb +12 -2
- data/lib/dodopayments/resources/checkout_sessions.rb +61 -0
- data/lib/dodopayments/resources/subscriptions.rb +5 -3
- data/lib/dodopayments/resources/webhooks.rb +29 -10
- data/lib/dodopayments/version.rb +1 -1
- data/lib/dodopayments.rb +9 -7
- data/rbi/dodopayments/client.rbi +3 -3
- data/rbi/dodopayments/errors.rbi +2 -2
- data/rbi/dodopayments/models/checkout_session_create_params.rbi +32 -0
- data/rbi/dodopayments/models/checkout_session_request.rbi +652 -0
- data/rbi/dodopayments/models/checkout_session_response.rbi +40 -0
- data/rbi/dodopayments/models/dispute.rbi +4 -4
- data/rbi/dodopayments/models/get_dispute.rbi +4 -4
- data/rbi/dodopayments/models/license_key.rbi +2 -2
- data/rbi/dodopayments/models/on_demand_subscription.rbi +86 -0
- data/rbi/dodopayments/models/payment.rbi +8 -8
- data/rbi/dodopayments/models/refund.rbi +4 -4
- data/rbi/dodopayments/models/subscription.rbi +21 -11
- data/rbi/dodopayments/models/subscription_create_params.rbi +4 -90
- data/rbi/dodopayments/models/subscription_update_params.rbi +8 -0
- data/rbi/dodopayments/models/webhook_create_params.rbi +6 -6
- data/rbi/dodopayments/models/{webhook_list_response.rbi → webhook_details.rbi} +2 -5
- data/rbi/dodopayments/models/webhook_retrieve_secret_params.rbi +32 -0
- data/rbi/dodopayments/models/webhook_retrieve_secret_response.rbi +26 -0
- data/rbi/dodopayments/models.rbi +14 -2
- data/rbi/dodopayments/resources/checkout_sessions.rbi +80 -0
- data/rbi/dodopayments/resources/subscriptions.rbi +4 -2
- data/rbi/dodopayments/resources/webhooks.rbi +17 -7
- data/sig/dodopayments/client.rbs +2 -2
- data/sig/dodopayments/models/checkout_session_create_params.rbs +15 -0
- data/sig/dodopayments/models/checkout_session_request.rbs +277 -0
- data/sig/dodopayments/models/checkout_session_response.rbs +16 -0
- data/sig/dodopayments/models/on_demand_subscription.rbs +40 -0
- data/sig/dodopayments/models/subscription.rbs +8 -3
- data/sig/dodopayments/models/subscription_create_params.rbs +4 -41
- data/sig/dodopayments/models/subscription_update_params.rbs +5 -0
- data/sig/dodopayments/models/{webhook_list_response.rbs → webhook_details.rbs} +2 -2
- data/sig/dodopayments/models/webhook_retrieve_secret_params.rbs +15 -0
- data/sig/dodopayments/models/webhook_retrieve_secret_response.rbs +13 -0
- data/sig/dodopayments/models.rbs +12 -2
- data/sig/dodopayments/resources/checkout_sessions.rbs +24 -0
- data/sig/dodopayments/resources/subscriptions.rbs +2 -1
- data/sig/dodopayments/resources/webhooks.rbs +9 -4
- metadata +26 -20
- data/lib/dodopayments/models/webhook_list_response.rb +0 -88
- data/lib/dodopayments/models/webhook_retrieve_response.rb +0 -88
- data/lib/dodopayments/models/webhook_update_response.rb +0 -88
- data/lib/dodopayments/models/your_webhook_url_create_params.rb +0 -32
- data/lib/dodopayments/resources/your_webhook_url.rb +0 -56
- data/rbi/dodopayments/models/webhook_create_response.rbi +0 -112
- data/rbi/dodopayments/models/webhook_retrieve_response.rbi +0 -112
- data/rbi/dodopayments/models/webhook_update_response.rbi +0 -112
- data/rbi/dodopayments/models/your_webhook_url_create_params.rbi +0 -56
- data/rbi/dodopayments/resources/your_webhook_url.rbi +0 -51
- data/sig/dodopayments/models/webhook_create_response.rbs +0 -60
- data/sig/dodopayments/models/webhook_retrieve_response.rbs +0 -60
- data/sig/dodopayments/models/webhook_update_response.rbs +0 -60
- data/sig/dodopayments/models/your_webhook_url_create_params.rbs +0 -42
- data/sig/dodopayments/resources/your_webhook_url.rbs +0 -18
data/rbi/dodopayments/models.rbi
CHANGED
@@ -33,6 +33,13 @@ module Dodopayments
|
|
33
33
|
|
34
34
|
BrandUpdateParams = Dodopayments::Models::BrandUpdateParams
|
35
35
|
|
36
|
+
CheckoutSessionCreateParams =
|
37
|
+
Dodopayments::Models::CheckoutSessionCreateParams
|
38
|
+
|
39
|
+
CheckoutSessionRequest = Dodopayments::Models::CheckoutSessionRequest
|
40
|
+
|
41
|
+
CheckoutSessionResponse = Dodopayments::Models::CheckoutSessionResponse
|
42
|
+
|
36
43
|
CountryCode = Dodopayments::Models::CountryCode
|
37
44
|
|
38
45
|
CreateNewCustomer = Dodopayments::Models::CreateNewCustomer
|
@@ -121,6 +128,8 @@ module Dodopayments
|
|
121
128
|
|
122
129
|
NewCustomer = Dodopayments::Models::NewCustomer
|
123
130
|
|
131
|
+
OnDemandSubscription = Dodopayments::Models::OnDemandSubscription
|
132
|
+
|
124
133
|
OneTimeProductCartItem = Dodopayments::Models::OneTimeProductCartItem
|
125
134
|
|
126
135
|
Payment = Dodopayments::Models::Payment
|
@@ -193,6 +202,8 @@ module Dodopayments
|
|
193
202
|
|
194
203
|
WebhookDeleteParams = Dodopayments::Models::WebhookDeleteParams
|
195
204
|
|
205
|
+
WebhookDetails = Dodopayments::Models::WebhookDetails
|
206
|
+
|
196
207
|
WebhookEventType = Dodopayments::Models::WebhookEventType
|
197
208
|
|
198
209
|
WebhookListParams = Dodopayments::Models::WebhookListParams
|
@@ -201,9 +212,10 @@ module Dodopayments
|
|
201
212
|
|
202
213
|
WebhookRetrieveParams = Dodopayments::Models::WebhookRetrieveParams
|
203
214
|
|
215
|
+
WebhookRetrieveSecretParams =
|
216
|
+
Dodopayments::Models::WebhookRetrieveSecretParams
|
217
|
+
|
204
218
|
Webhooks = Dodopayments::Models::Webhooks
|
205
219
|
|
206
220
|
WebhookUpdateParams = Dodopayments::Models::WebhookUpdateParams
|
207
|
-
|
208
|
-
YourWebhookURLCreateParams = Dodopayments::Models::YourWebhookURLCreateParams
|
209
221
|
end
|
@@ -0,0 +1,80 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module Dodopayments
|
4
|
+
module Resources
|
5
|
+
class CheckoutSessions
|
6
|
+
sig do
|
7
|
+
params(
|
8
|
+
product_cart:
|
9
|
+
T::Array[Dodopayments::CheckoutSessionRequest::ProductCart::OrHash],
|
10
|
+
allowed_payment_method_types:
|
11
|
+
T.nilable(T::Array[Dodopayments::PaymentMethodTypes::OrSymbol]),
|
12
|
+
billing_address:
|
13
|
+
T.nilable(
|
14
|
+
Dodopayments::CheckoutSessionRequest::BillingAddress::OrHash
|
15
|
+
),
|
16
|
+
billing_currency: T.nilable(Dodopayments::Currency::OrSymbol),
|
17
|
+
confirm: T::Boolean,
|
18
|
+
customer:
|
19
|
+
T.nilable(
|
20
|
+
T.any(
|
21
|
+
Dodopayments::AttachExistingCustomer::OrHash,
|
22
|
+
Dodopayments::NewCustomer::OrHash
|
23
|
+
)
|
24
|
+
),
|
25
|
+
customization:
|
26
|
+
Dodopayments::CheckoutSessionRequest::Customization::OrHash,
|
27
|
+
discount_code: T.nilable(String),
|
28
|
+
feature_flags:
|
29
|
+
Dodopayments::CheckoutSessionRequest::FeatureFlags::OrHash,
|
30
|
+
metadata: T.nilable(T::Hash[Symbol, String]),
|
31
|
+
return_url: T.nilable(String),
|
32
|
+
show_saved_payment_methods: T::Boolean,
|
33
|
+
subscription_data:
|
34
|
+
T.nilable(
|
35
|
+
Dodopayments::CheckoutSessionRequest::SubscriptionData::OrHash
|
36
|
+
),
|
37
|
+
request_options: Dodopayments::RequestOptions::OrHash
|
38
|
+
).returns(Dodopayments::CheckoutSessionResponse)
|
39
|
+
end
|
40
|
+
def create(
|
41
|
+
product_cart:,
|
42
|
+
# Customers will never see payment methods that are not in this list. However,
|
43
|
+
# adding a method here does not guarantee customers will see it. Availability
|
44
|
+
# still depends on other factors (e.g., customer location, merchant settings).
|
45
|
+
#
|
46
|
+
# Disclaimar: Always provide 'credit' and 'debit' as a fallback. If all payment
|
47
|
+
# methods are unavailable, checkout session will fail.
|
48
|
+
allowed_payment_method_types: nil,
|
49
|
+
# Billing address information for the session
|
50
|
+
billing_address: nil,
|
51
|
+
# This field is ingored if adaptive pricing is disabled
|
52
|
+
billing_currency: nil,
|
53
|
+
# If confirm is true, all the details will be finalized. If required data is
|
54
|
+
# missing, an API error is thrown.
|
55
|
+
confirm: nil,
|
56
|
+
# Customer details for the session
|
57
|
+
customer: nil,
|
58
|
+
# Customization for the checkout session page
|
59
|
+
customization: nil,
|
60
|
+
discount_code: nil,
|
61
|
+
feature_flags: nil,
|
62
|
+
# Additional metadata associated with the payment. Defaults to empty if not
|
63
|
+
# provided.
|
64
|
+
metadata: nil,
|
65
|
+
# The url to redirect after payment failure or success.
|
66
|
+
return_url: nil,
|
67
|
+
# Display saved payment methods of a returning customer False by default
|
68
|
+
show_saved_payment_methods: nil,
|
69
|
+
subscription_data: nil,
|
70
|
+
request_options: {}
|
71
|
+
)
|
72
|
+
end
|
73
|
+
|
74
|
+
# @api private
|
75
|
+
sig { params(client: Dodopayments::Client).returns(T.attached_class) }
|
76
|
+
def self.new(client:)
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
@@ -19,8 +19,7 @@ module Dodopayments
|
|
19
19
|
billing_currency: T.nilable(Dodopayments::Currency::OrSymbol),
|
20
20
|
discount_code: T.nilable(String),
|
21
21
|
metadata: T::Hash[Symbol, String],
|
22
|
-
on_demand:
|
23
|
-
T.nilable(Dodopayments::SubscriptionCreateParams::OnDemand::OrHash),
|
22
|
+
on_demand: T.nilable(Dodopayments::OnDemandSubscription::OrHash),
|
24
23
|
payment_link: T.nilable(T::Boolean),
|
25
24
|
return_url: T.nilable(String),
|
26
25
|
show_saved_payment_methods: T::Boolean,
|
@@ -94,6 +93,7 @@ module Dodopayments
|
|
94
93
|
Dodopayments::SubscriptionUpdateParams::DisableOnDemand::OrHash
|
95
94
|
),
|
96
95
|
metadata: T.nilable(T::Hash[Symbol, String]),
|
96
|
+
next_billing_date: T.nilable(Time),
|
97
97
|
status: T.nilable(Dodopayments::SubscriptionStatus::OrSymbol),
|
98
98
|
tax_id: T.nilable(String),
|
99
99
|
request_options: Dodopayments::RequestOptions::OrHash
|
@@ -103,9 +103,11 @@ module Dodopayments
|
|
103
103
|
# Subscription Id
|
104
104
|
subscription_id,
|
105
105
|
billing: nil,
|
106
|
+
# When set, the subscription will remain active until the end of billing period
|
106
107
|
cancel_at_next_billing_date: nil,
|
107
108
|
disable_on_demand: nil,
|
108
109
|
metadata: nil,
|
110
|
+
next_billing_date: nil,
|
109
111
|
status: nil,
|
110
112
|
tax_id: nil,
|
111
113
|
request_options: {}
|
@@ -18,19 +18,19 @@ module Dodopayments
|
|
18
18
|
metadata: T.nilable(T::Hash[Symbol, String]),
|
19
19
|
rate_limit: T.nilable(Integer),
|
20
20
|
request_options: Dodopayments::RequestOptions::OrHash
|
21
|
-
).returns(Dodopayments::
|
21
|
+
).returns(Dodopayments::WebhookDetails)
|
22
22
|
end
|
23
23
|
def create(
|
24
24
|
# Url of the webhook
|
25
25
|
url:,
|
26
|
-
# Filter events to the webhook.
|
27
|
-
#
|
28
|
-
# Webhook event will only be sent for events in the list.
|
29
26
|
description: nil,
|
30
27
|
# Create the webhook in a disabled state.
|
31
28
|
#
|
32
29
|
# Default is false
|
33
30
|
disabled: nil,
|
31
|
+
# Filter events to the webhook.
|
32
|
+
#
|
33
|
+
# Webhook event will only be sent for events in the list.
|
34
34
|
filter_types: nil,
|
35
35
|
# Custom headers to be passed
|
36
36
|
headers: nil,
|
@@ -48,7 +48,7 @@ module Dodopayments
|
|
48
48
|
params(
|
49
49
|
webhook_id: String,
|
50
50
|
request_options: Dodopayments::RequestOptions::OrHash
|
51
|
-
).returns(Dodopayments::
|
51
|
+
).returns(Dodopayments::WebhookDetails)
|
52
52
|
end
|
53
53
|
def retrieve(webhook_id, request_options: {})
|
54
54
|
end
|
@@ -65,7 +65,7 @@ module Dodopayments
|
|
65
65
|
rate_limit: T.nilable(Integer),
|
66
66
|
url: T.nilable(String),
|
67
67
|
request_options: Dodopayments::RequestOptions::OrHash
|
68
|
-
).returns(Dodopayments::
|
68
|
+
).returns(Dodopayments::WebhookDetails)
|
69
69
|
end
|
70
70
|
def update(
|
71
71
|
webhook_id,
|
@@ -95,7 +95,7 @@ module Dodopayments
|
|
95
95
|
request_options: Dodopayments::RequestOptions::OrHash
|
96
96
|
).returns(
|
97
97
|
Dodopayments::Internal::CursorPagePagination[
|
98
|
-
Dodopayments::
|
98
|
+
Dodopayments::WebhookDetails
|
99
99
|
]
|
100
100
|
)
|
101
101
|
end
|
@@ -118,6 +118,16 @@ module Dodopayments
|
|
118
118
|
def delete(webhook_id, request_options: {})
|
119
119
|
end
|
120
120
|
|
121
|
+
# Get webhook secret by id
|
122
|
+
sig do
|
123
|
+
params(
|
124
|
+
webhook_id: String,
|
125
|
+
request_options: Dodopayments::RequestOptions::OrHash
|
126
|
+
).returns(Dodopayments::Models::WebhookRetrieveSecretResponse)
|
127
|
+
end
|
128
|
+
def retrieve_secret(webhook_id, request_options: {})
|
129
|
+
end
|
130
|
+
|
121
131
|
# @api private
|
122
132
|
sig { params(client: Dodopayments::Client).returns(T.attached_class) }
|
123
133
|
def self.new(client:)
|
data/sig/dodopayments/client.rbs
CHANGED
@@ -15,6 +15,8 @@ module Dodopayments
|
|
15
15
|
|
16
16
|
attr_reader bearer_token: String
|
17
17
|
|
18
|
+
attr_reader checkout_sessions: Dodopayments::Resources::CheckoutSessions
|
19
|
+
|
18
20
|
attr_reader payments: Dodopayments::Resources::Payments
|
19
21
|
|
20
22
|
attr_reader subscriptions: Dodopayments::Resources::Subscriptions
|
@@ -49,8 +51,6 @@ module Dodopayments
|
|
49
51
|
|
50
52
|
attr_reader webhooks: Dodopayments::Resources::Webhooks
|
51
53
|
|
52
|
-
attr_reader your_webhook_url: Dodopayments::Resources::YourWebhookURL
|
53
|
-
|
54
54
|
private def auth_headers: -> ::Hash[String, String]
|
55
55
|
|
56
56
|
def initialize: (
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Dodopayments
|
2
|
+
module Models
|
3
|
+
type checkout_session_create_params =
|
4
|
+
{ } & Dodopayments::Internal::Type::request_parameters
|
5
|
+
|
6
|
+
class CheckoutSessionCreateParams < Dodopayments::Models::CheckoutSessionRequest
|
7
|
+
extend Dodopayments::Internal::Type::RequestParameters::Converter
|
8
|
+
include Dodopayments::Internal::Type::RequestParameters
|
9
|
+
|
10
|
+
def initialize: (?request_options: Dodopayments::request_opts) -> void
|
11
|
+
|
12
|
+
def to_hash: -> { request_options: Dodopayments::RequestOptions }
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,277 @@
|
|
1
|
+
module Dodopayments
|
2
|
+
module Models
|
3
|
+
type checkout_session_request =
|
4
|
+
{
|
5
|
+
product_cart: ::Array[Dodopayments::CheckoutSessionRequest::ProductCart],
|
6
|
+
allowed_payment_method_types: ::Array[Dodopayments::Models::payment_method_types]?,
|
7
|
+
billing_address: Dodopayments::CheckoutSessionRequest::BillingAddress?,
|
8
|
+
billing_currency: Dodopayments::Models::currency?,
|
9
|
+
confirm: bool,
|
10
|
+
customer: Dodopayments::Models::customer_request?,
|
11
|
+
customization: Dodopayments::CheckoutSessionRequest::Customization,
|
12
|
+
discount_code: String?,
|
13
|
+
feature_flags: Dodopayments::CheckoutSessionRequest::FeatureFlags,
|
14
|
+
metadata: ::Hash[Symbol, String]?,
|
15
|
+
return_url: String?,
|
16
|
+
show_saved_payment_methods: bool,
|
17
|
+
subscription_data: Dodopayments::CheckoutSessionRequest::SubscriptionData?
|
18
|
+
}
|
19
|
+
|
20
|
+
class CheckoutSessionRequest < Dodopayments::Internal::Type::BaseModel
|
21
|
+
attr_accessor product_cart: ::Array[Dodopayments::CheckoutSessionRequest::ProductCart]
|
22
|
+
|
23
|
+
attr_accessor allowed_payment_method_types: ::Array[Dodopayments::Models::payment_method_types]?
|
24
|
+
|
25
|
+
attr_accessor billing_address: Dodopayments::CheckoutSessionRequest::BillingAddress?
|
26
|
+
|
27
|
+
attr_accessor billing_currency: Dodopayments::Models::currency?
|
28
|
+
|
29
|
+
attr_reader confirm: bool?
|
30
|
+
|
31
|
+
def confirm=: (bool) -> bool
|
32
|
+
|
33
|
+
attr_accessor customer: Dodopayments::Models::customer_request?
|
34
|
+
|
35
|
+
attr_reader customization: Dodopayments::CheckoutSessionRequest::Customization?
|
36
|
+
|
37
|
+
def customization=: (
|
38
|
+
Dodopayments::CheckoutSessionRequest::Customization
|
39
|
+
) -> Dodopayments::CheckoutSessionRequest::Customization
|
40
|
+
|
41
|
+
attr_accessor discount_code: String?
|
42
|
+
|
43
|
+
attr_reader feature_flags: Dodopayments::CheckoutSessionRequest::FeatureFlags?
|
44
|
+
|
45
|
+
def feature_flags=: (
|
46
|
+
Dodopayments::CheckoutSessionRequest::FeatureFlags
|
47
|
+
) -> Dodopayments::CheckoutSessionRequest::FeatureFlags
|
48
|
+
|
49
|
+
attr_accessor metadata: ::Hash[Symbol, String]?
|
50
|
+
|
51
|
+
attr_accessor return_url: String?
|
52
|
+
|
53
|
+
attr_reader show_saved_payment_methods: bool?
|
54
|
+
|
55
|
+
def show_saved_payment_methods=: (bool) -> bool
|
56
|
+
|
57
|
+
attr_accessor subscription_data: Dodopayments::CheckoutSessionRequest::SubscriptionData?
|
58
|
+
|
59
|
+
def initialize: (
|
60
|
+
product_cart: ::Array[Dodopayments::CheckoutSessionRequest::ProductCart],
|
61
|
+
?allowed_payment_method_types: ::Array[Dodopayments::Models::payment_method_types]?,
|
62
|
+
?billing_address: Dodopayments::CheckoutSessionRequest::BillingAddress?,
|
63
|
+
?billing_currency: Dodopayments::Models::currency?,
|
64
|
+
?confirm: bool,
|
65
|
+
?customer: Dodopayments::Models::customer_request?,
|
66
|
+
?customization: Dodopayments::CheckoutSessionRequest::Customization,
|
67
|
+
?discount_code: String?,
|
68
|
+
?feature_flags: Dodopayments::CheckoutSessionRequest::FeatureFlags,
|
69
|
+
?metadata: ::Hash[Symbol, String]?,
|
70
|
+
?return_url: String?,
|
71
|
+
?show_saved_payment_methods: bool,
|
72
|
+
?subscription_data: Dodopayments::CheckoutSessionRequest::SubscriptionData?
|
73
|
+
) -> void
|
74
|
+
|
75
|
+
def to_hash: -> {
|
76
|
+
product_cart: ::Array[Dodopayments::CheckoutSessionRequest::ProductCart],
|
77
|
+
allowed_payment_method_types: ::Array[Dodopayments::Models::payment_method_types]?,
|
78
|
+
billing_address: Dodopayments::CheckoutSessionRequest::BillingAddress?,
|
79
|
+
billing_currency: Dodopayments::Models::currency?,
|
80
|
+
confirm: bool,
|
81
|
+
customer: Dodopayments::Models::customer_request?,
|
82
|
+
customization: Dodopayments::CheckoutSessionRequest::Customization,
|
83
|
+
discount_code: String?,
|
84
|
+
feature_flags: Dodopayments::CheckoutSessionRequest::FeatureFlags,
|
85
|
+
metadata: ::Hash[Symbol, String]?,
|
86
|
+
return_url: String?,
|
87
|
+
show_saved_payment_methods: bool,
|
88
|
+
subscription_data: Dodopayments::CheckoutSessionRequest::SubscriptionData?
|
89
|
+
}
|
90
|
+
|
91
|
+
type product_cart =
|
92
|
+
{
|
93
|
+
product_id: String,
|
94
|
+
quantity: Integer,
|
95
|
+
addons: ::Array[Dodopayments::AttachAddon]?,
|
96
|
+
amount: Integer?
|
97
|
+
}
|
98
|
+
|
99
|
+
class ProductCart < Dodopayments::Internal::Type::BaseModel
|
100
|
+
attr_accessor product_id: String
|
101
|
+
|
102
|
+
attr_accessor quantity: Integer
|
103
|
+
|
104
|
+
attr_accessor addons: ::Array[Dodopayments::AttachAddon]?
|
105
|
+
|
106
|
+
attr_accessor amount: Integer?
|
107
|
+
|
108
|
+
def initialize: (
|
109
|
+
product_id: String,
|
110
|
+
quantity: Integer,
|
111
|
+
?addons: ::Array[Dodopayments::AttachAddon]?,
|
112
|
+
?amount: Integer?
|
113
|
+
) -> void
|
114
|
+
|
115
|
+
def to_hash: -> {
|
116
|
+
product_id: String,
|
117
|
+
quantity: Integer,
|
118
|
+
addons: ::Array[Dodopayments::AttachAddon]?,
|
119
|
+
amount: Integer?
|
120
|
+
}
|
121
|
+
end
|
122
|
+
|
123
|
+
type billing_address =
|
124
|
+
{
|
125
|
+
country: Dodopayments::Models::country_code,
|
126
|
+
city: String?,
|
127
|
+
state: String?,
|
128
|
+
street: String?,
|
129
|
+
zipcode: String?
|
130
|
+
}
|
131
|
+
|
132
|
+
class BillingAddress < Dodopayments::Internal::Type::BaseModel
|
133
|
+
attr_accessor country: Dodopayments::Models::country_code
|
134
|
+
|
135
|
+
attr_accessor city: String?
|
136
|
+
|
137
|
+
attr_accessor state: String?
|
138
|
+
|
139
|
+
attr_accessor street: String?
|
140
|
+
|
141
|
+
attr_accessor zipcode: String?
|
142
|
+
|
143
|
+
def initialize: (
|
144
|
+
country: Dodopayments::Models::country_code,
|
145
|
+
?city: String?,
|
146
|
+
?state: String?,
|
147
|
+
?street: String?,
|
148
|
+
?zipcode: String?
|
149
|
+
) -> void
|
150
|
+
|
151
|
+
def to_hash: -> {
|
152
|
+
country: Dodopayments::Models::country_code,
|
153
|
+
city: String?,
|
154
|
+
state: String?,
|
155
|
+
street: String?,
|
156
|
+
zipcode: String?
|
157
|
+
}
|
158
|
+
end
|
159
|
+
|
160
|
+
type customization =
|
161
|
+
{
|
162
|
+
show_on_demand_tag: bool,
|
163
|
+
show_order_details: bool,
|
164
|
+
theme: Dodopayments::Models::CheckoutSessionRequest::Customization::theme
|
165
|
+
}
|
166
|
+
|
167
|
+
class Customization < Dodopayments::Internal::Type::BaseModel
|
168
|
+
attr_reader show_on_demand_tag: bool?
|
169
|
+
|
170
|
+
def show_on_demand_tag=: (bool) -> bool
|
171
|
+
|
172
|
+
attr_reader show_order_details: bool?
|
173
|
+
|
174
|
+
def show_order_details=: (bool) -> bool
|
175
|
+
|
176
|
+
attr_reader theme: Dodopayments::Models::CheckoutSessionRequest::Customization::theme?
|
177
|
+
|
178
|
+
def theme=: (
|
179
|
+
Dodopayments::Models::CheckoutSessionRequest::Customization::theme
|
180
|
+
) -> Dodopayments::Models::CheckoutSessionRequest::Customization::theme
|
181
|
+
|
182
|
+
def initialize: (
|
183
|
+
?show_on_demand_tag: bool,
|
184
|
+
?show_order_details: bool,
|
185
|
+
?theme: Dodopayments::Models::CheckoutSessionRequest::Customization::theme
|
186
|
+
) -> void
|
187
|
+
|
188
|
+
def to_hash: -> {
|
189
|
+
show_on_demand_tag: bool,
|
190
|
+
show_order_details: bool,
|
191
|
+
theme: Dodopayments::Models::CheckoutSessionRequest::Customization::theme
|
192
|
+
}
|
193
|
+
|
194
|
+
type theme = :dark | :light | :system
|
195
|
+
|
196
|
+
module Theme
|
197
|
+
extend Dodopayments::Internal::Type::Enum
|
198
|
+
|
199
|
+
DARK: :dark
|
200
|
+
LIGHT: :light
|
201
|
+
SYSTEM: :system
|
202
|
+
|
203
|
+
def self?.values: -> ::Array[Dodopayments::Models::CheckoutSessionRequest::Customization::theme]
|
204
|
+
end
|
205
|
+
end
|
206
|
+
|
207
|
+
type feature_flags =
|
208
|
+
{
|
209
|
+
allow_currency_selection: bool,
|
210
|
+
allow_discount_code: bool,
|
211
|
+
allow_phone_number_collection: bool,
|
212
|
+
allow_tax_id: bool,
|
213
|
+
always_create_new_customer: bool
|
214
|
+
}
|
215
|
+
|
216
|
+
class FeatureFlags < Dodopayments::Internal::Type::BaseModel
|
217
|
+
attr_reader allow_currency_selection: bool?
|
218
|
+
|
219
|
+
def allow_currency_selection=: (bool) -> bool
|
220
|
+
|
221
|
+
attr_reader allow_discount_code: bool?
|
222
|
+
|
223
|
+
def allow_discount_code=: (bool) -> bool
|
224
|
+
|
225
|
+
attr_reader allow_phone_number_collection: bool?
|
226
|
+
|
227
|
+
def allow_phone_number_collection=: (bool) -> bool
|
228
|
+
|
229
|
+
attr_reader allow_tax_id: bool?
|
230
|
+
|
231
|
+
def allow_tax_id=: (bool) -> bool
|
232
|
+
|
233
|
+
attr_reader always_create_new_customer: bool?
|
234
|
+
|
235
|
+
def always_create_new_customer=: (bool) -> bool
|
236
|
+
|
237
|
+
def initialize: (
|
238
|
+
?allow_currency_selection: bool,
|
239
|
+
?allow_discount_code: bool,
|
240
|
+
?allow_phone_number_collection: bool,
|
241
|
+
?allow_tax_id: bool,
|
242
|
+
?always_create_new_customer: bool
|
243
|
+
) -> void
|
244
|
+
|
245
|
+
def to_hash: -> {
|
246
|
+
allow_currency_selection: bool,
|
247
|
+
allow_discount_code: bool,
|
248
|
+
allow_phone_number_collection: bool,
|
249
|
+
allow_tax_id: bool,
|
250
|
+
always_create_new_customer: bool
|
251
|
+
}
|
252
|
+
end
|
253
|
+
|
254
|
+
type subscription_data =
|
255
|
+
{
|
256
|
+
on_demand: Dodopayments::OnDemandSubscription?,
|
257
|
+
trial_period_days: Integer?
|
258
|
+
}
|
259
|
+
|
260
|
+
class SubscriptionData < Dodopayments::Internal::Type::BaseModel
|
261
|
+
attr_accessor on_demand: Dodopayments::OnDemandSubscription?
|
262
|
+
|
263
|
+
attr_accessor trial_period_days: Integer?
|
264
|
+
|
265
|
+
def initialize: (
|
266
|
+
?on_demand: Dodopayments::OnDemandSubscription?,
|
267
|
+
?trial_period_days: Integer?
|
268
|
+
) -> void
|
269
|
+
|
270
|
+
def to_hash: -> {
|
271
|
+
on_demand: Dodopayments::OnDemandSubscription?,
|
272
|
+
trial_period_days: Integer?
|
273
|
+
}
|
274
|
+
end
|
275
|
+
end
|
276
|
+
end
|
277
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Dodopayments
|
2
|
+
module Models
|
3
|
+
type checkout_session_response =
|
4
|
+
{ checkout_url: String, session_id: String }
|
5
|
+
|
6
|
+
class CheckoutSessionResponse < Dodopayments::Internal::Type::BaseModel
|
7
|
+
attr_accessor checkout_url: String
|
8
|
+
|
9
|
+
attr_accessor session_id: String
|
10
|
+
|
11
|
+
def initialize: (checkout_url: String, session_id: String) -> void
|
12
|
+
|
13
|
+
def to_hash: -> { checkout_url: String, session_id: String }
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
module Dodopayments
|
2
|
+
module Models
|
3
|
+
type on_demand_subscription =
|
4
|
+
{
|
5
|
+
mandate_only: bool,
|
6
|
+
adaptive_currency_fees_inclusive: bool?,
|
7
|
+
product_currency: Dodopayments::Models::currency?,
|
8
|
+
product_description: String?,
|
9
|
+
product_price: Integer?
|
10
|
+
}
|
11
|
+
|
12
|
+
class OnDemandSubscription < Dodopayments::Internal::Type::BaseModel
|
13
|
+
attr_accessor mandate_only: bool
|
14
|
+
|
15
|
+
attr_accessor adaptive_currency_fees_inclusive: bool?
|
16
|
+
|
17
|
+
attr_accessor product_currency: Dodopayments::Models::currency?
|
18
|
+
|
19
|
+
attr_accessor product_description: String?
|
20
|
+
|
21
|
+
attr_accessor product_price: Integer?
|
22
|
+
|
23
|
+
def initialize: (
|
24
|
+
mandate_only: bool,
|
25
|
+
?adaptive_currency_fees_inclusive: bool?,
|
26
|
+
?product_currency: Dodopayments::Models::currency?,
|
27
|
+
?product_description: String?,
|
28
|
+
?product_price: Integer?
|
29
|
+
) -> void
|
30
|
+
|
31
|
+
def to_hash: -> {
|
32
|
+
mandate_only: bool,
|
33
|
+
adaptive_currency_fees_inclusive: bool?,
|
34
|
+
product_currency: Dodopayments::Models::currency?,
|
35
|
+
product_description: String?,
|
36
|
+
product_price: Integer?
|
37
|
+
}
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -25,7 +25,8 @@ module Dodopayments
|
|
25
25
|
trial_period_days: Integer,
|
26
26
|
cancelled_at: Time?,
|
27
27
|
discount_cycles_remaining: Integer?,
|
28
|
-
discount_id: String
|
28
|
+
discount_id: String?,
|
29
|
+
expires_at: Time?
|
29
30
|
}
|
30
31
|
|
31
32
|
class Subscription < Dodopayments::Internal::Type::BaseModel
|
@@ -77,6 +78,8 @@ module Dodopayments
|
|
77
78
|
|
78
79
|
attr_accessor discount_id: String?
|
79
80
|
|
81
|
+
attr_accessor expires_at: Time?
|
82
|
+
|
80
83
|
def initialize: (
|
81
84
|
addons: ::Array[Dodopayments::AddonCartResponseItem],
|
82
85
|
billing: Dodopayments::BillingAddress,
|
@@ -101,7 +104,8 @@ module Dodopayments
|
|
101
104
|
trial_period_days: Integer,
|
102
105
|
?cancelled_at: Time?,
|
103
106
|
?discount_cycles_remaining: Integer?,
|
104
|
-
?discount_id: String
|
107
|
+
?discount_id: String?,
|
108
|
+
?expires_at: Time?
|
105
109
|
) -> void
|
106
110
|
|
107
111
|
def to_hash: -> {
|
@@ -128,7 +132,8 @@ module Dodopayments
|
|
128
132
|
trial_period_days: Integer,
|
129
133
|
cancelled_at: Time?,
|
130
134
|
discount_cycles_remaining: Integer?,
|
131
|
-
discount_id: String
|
135
|
+
discount_id: String?,
|
136
|
+
expires_at: Time?
|
132
137
|
}
|
133
138
|
end
|
134
139
|
end
|