dodopayments 1.49.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 +14 -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 +9 -1
- data/lib/dodopayments/models/webhook_create_params.rb +1 -4
- data/lib/dodopayments/models/{webhook_create_response.rb → webhook_details.rb} +2 -2
- data/lib/dodopayments/models.rb +10 -2
- data/lib/dodopayments/resources/checkout_sessions.rb +61 -0
- data/lib/dodopayments/resources/subscriptions.rb +2 -2
- data/lib/dodopayments/resources/webhooks.rb +8 -8
- data/lib/dodopayments/version.rb +1 -1
- data/lib/dodopayments.rb +7 -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 +2 -0
- data/rbi/dodopayments/models/{webhook_list_response.rbi → webhook_details.rbi} +2 -5
- data/rbi/dodopayments/models.rbi +11 -2
- data/rbi/dodopayments/resources/checkout_sessions.rbi +80 -0
- data/rbi/dodopayments/resources/subscriptions.rbi +2 -2
- data/rbi/dodopayments/resources/webhooks.rbi +4 -4
- 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/{webhook_list_response.rbs → webhook_details.rbs} +2 -2
- data/sig/dodopayments/models.rbs +10 -2
- data/sig/dodopayments/resources/checkout_sessions.rbs +24 -0
- data/sig/dodopayments/resources/subscriptions.rbs +1 -1
- data/sig/dodopayments/resources/webhooks.rbs +4 -4
- metadata +20 -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
@@ -0,0 +1,58 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Dodopayments
|
4
|
+
module Models
|
5
|
+
class OnDemandSubscription < Dodopayments::Internal::Type::BaseModel
|
6
|
+
# @!attribute mandate_only
|
7
|
+
# If set as True, does not perform any charge and only authorizes payment method
|
8
|
+
# details for future use.
|
9
|
+
#
|
10
|
+
# @return [Boolean]
|
11
|
+
required :mandate_only, Dodopayments::Internal::Type::Boolean
|
12
|
+
|
13
|
+
# @!attribute adaptive_currency_fees_inclusive
|
14
|
+
# Whether adaptive currency fees should be included in the product_price (true) or
|
15
|
+
# added on top (false). This field is ignored if adaptive pricing is not enabled
|
16
|
+
# for the business.
|
17
|
+
#
|
18
|
+
# @return [Boolean, nil]
|
19
|
+
optional :adaptive_currency_fees_inclusive, Dodopayments::Internal::Type::Boolean, nil?: true
|
20
|
+
|
21
|
+
# @!attribute product_currency
|
22
|
+
# Optional currency of the product price. If not specified, defaults to the
|
23
|
+
# currency of the product.
|
24
|
+
#
|
25
|
+
# @return [Symbol, Dodopayments::Models::Currency, nil]
|
26
|
+
optional :product_currency, enum: -> { Dodopayments::Currency }, nil?: true
|
27
|
+
|
28
|
+
# @!attribute product_description
|
29
|
+
# Optional product description override for billing and line items. If not
|
30
|
+
# specified, the stored description of the product will be used.
|
31
|
+
#
|
32
|
+
# @return [String, nil]
|
33
|
+
optional :product_description, String, nil?: true
|
34
|
+
|
35
|
+
# @!attribute product_price
|
36
|
+
# Product price for the initial charge to customer If not specified the stored
|
37
|
+
# price of the product will be used Represented in the lowest denomination of the
|
38
|
+
# currency (e.g., cents for USD). For example, to charge $1.00, pass `100`.
|
39
|
+
#
|
40
|
+
# @return [Integer, nil]
|
41
|
+
optional :product_price, Integer, nil?: true
|
42
|
+
|
43
|
+
# @!method initialize(mandate_only:, adaptive_currency_fees_inclusive: nil, product_currency: nil, product_description: nil, product_price: nil)
|
44
|
+
# Some parameter documentations has been truncated, see
|
45
|
+
# {Dodopayments::Models::OnDemandSubscription} for more details.
|
46
|
+
#
|
47
|
+
# @param mandate_only [Boolean] If set as True, does not perform any charge and only authorizes payment method d
|
48
|
+
#
|
49
|
+
# @param adaptive_currency_fees_inclusive [Boolean, nil] Whether adaptive currency fees should be included in the product_price (true) or
|
50
|
+
#
|
51
|
+
# @param product_currency [Symbol, Dodopayments::Models::Currency, nil] Optional currency of the product price. If not specified, defaults to the curren
|
52
|
+
#
|
53
|
+
# @param product_description [String, nil] Optional product description override for billing and line items.
|
54
|
+
#
|
55
|
+
# @param product_price [Integer, nil] Product price for the initial charge to customer
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
@@ -23,10 +23,7 @@ module Dodopayments
|
|
23
23
|
# List of products in the cart. Must contain at least 1 and at most 100 items.
|
24
24
|
#
|
25
25
|
# @return [Array<Dodopayments::Models::OneTimeProductCartItem>]
|
26
|
-
required :product_cart,
|
27
|
-
-> {
|
28
|
-
Dodopayments::Internal::Type::ArrayOf[Dodopayments::OneTimeProductCartItem]
|
29
|
-
}
|
26
|
+
required :product_cart, -> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::OneTimeProductCartItem] }
|
30
27
|
|
31
28
|
# @!attribute allowed_payment_method_types
|
32
29
|
# List of payment methods allowed during checkout.
|
@@ -150,7 +150,13 @@ module Dodopayments
|
|
150
150
|
# @return [String, nil]
|
151
151
|
optional :discount_id, String, nil?: true
|
152
152
|
|
153
|
-
# @!
|
153
|
+
# @!attribute expires_at
|
154
|
+
# Timestamp when the subscription will expire
|
155
|
+
#
|
156
|
+
# @return [Time, nil]
|
157
|
+
optional :expires_at, Time, nil?: true
|
158
|
+
|
159
|
+
# @!method initialize(addons:, billing:, cancel_at_next_billing_date:, created_at:, currency:, customer:, metadata:, next_billing_date:, on_demand:, payment_frequency_count:, payment_frequency_interval:, previous_billing_date:, product_id:, quantity:, recurring_pre_tax_amount:, status:, subscription_id:, subscription_period_count:, subscription_period_interval:, tax_inclusive:, trial_period_days:, cancelled_at: nil, discount_cycles_remaining: nil, discount_id: nil, expires_at: nil)
|
154
160
|
# Some parameter documentations has been truncated, see
|
155
161
|
# {Dodopayments::Models::Subscription} for more details.
|
156
162
|
#
|
@@ -203,6 +209,8 @@ module Dodopayments
|
|
203
209
|
# @param discount_cycles_remaining [Integer, nil] Number of remaining discount cycles if discount is applied
|
204
210
|
#
|
205
211
|
# @param discount_id [String, nil] The discount id if discount is applied
|
212
|
+
#
|
213
|
+
# @param expires_at [Time, nil] Timestamp when the subscription will expire
|
206
214
|
end
|
207
215
|
end
|
208
216
|
end
|
@@ -71,8 +71,8 @@ module Dodopayments
|
|
71
71
|
|
72
72
|
# @!attribute on_demand
|
73
73
|
#
|
74
|
-
# @return [Dodopayments::Models::
|
75
|
-
optional :on_demand, -> { Dodopayments::
|
74
|
+
# @return [Dodopayments::Models::OnDemandSubscription, nil]
|
75
|
+
optional :on_demand, -> { Dodopayments::OnDemandSubscription }, nil?: true
|
76
76
|
|
77
77
|
# @!attribute payment_link
|
78
78
|
# If true, generates a payment link. Defaults to false if not specified.
|
@@ -128,7 +128,7 @@ module Dodopayments
|
|
128
128
|
#
|
129
129
|
# @param metadata [Hash{Symbol=>String}] Additional metadata for the subscription
|
130
130
|
#
|
131
|
-
# @param on_demand [Dodopayments::Models::
|
131
|
+
# @param on_demand [Dodopayments::Models::OnDemandSubscription, nil]
|
132
132
|
#
|
133
133
|
# @param payment_link [Boolean, nil] If true, generates a payment link.
|
134
134
|
#
|
@@ -141,59 +141,6 @@ module Dodopayments
|
|
141
141
|
# @param trial_period_days [Integer, nil] Optional trial period in days
|
142
142
|
#
|
143
143
|
# @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
|
144
|
-
|
145
|
-
class OnDemand < Dodopayments::Internal::Type::BaseModel
|
146
|
-
# @!attribute mandate_only
|
147
|
-
# If set as True, does not perform any charge and only authorizes payment method
|
148
|
-
# details for future use.
|
149
|
-
#
|
150
|
-
# @return [Boolean]
|
151
|
-
required :mandate_only, Dodopayments::Internal::Type::Boolean
|
152
|
-
|
153
|
-
# @!attribute adaptive_currency_fees_inclusive
|
154
|
-
# Whether adaptive currency fees should be included in the product_price (true) or
|
155
|
-
# added on top (false). This field is ignored if adaptive pricing is not enabled
|
156
|
-
# for the business.
|
157
|
-
#
|
158
|
-
# @return [Boolean, nil]
|
159
|
-
optional :adaptive_currency_fees_inclusive, Dodopayments::Internal::Type::Boolean, nil?: true
|
160
|
-
|
161
|
-
# @!attribute product_currency
|
162
|
-
# Optional currency of the product price. If not specified, defaults to the
|
163
|
-
# currency of the product.
|
164
|
-
#
|
165
|
-
# @return [Symbol, Dodopayments::Models::Currency, nil]
|
166
|
-
optional :product_currency, enum: -> { Dodopayments::Currency }, nil?: true
|
167
|
-
|
168
|
-
# @!attribute product_description
|
169
|
-
# Optional product description override for billing and line items. If not
|
170
|
-
# specified, the stored description of the product will be used.
|
171
|
-
#
|
172
|
-
# @return [String, nil]
|
173
|
-
optional :product_description, String, nil?: true
|
174
|
-
|
175
|
-
# @!attribute product_price
|
176
|
-
# Product price for the initial charge to customer If not specified the stored
|
177
|
-
# price of the product will be used Represented in the lowest denomination of the
|
178
|
-
# currency (e.g., cents for USD). For example, to charge $1.00, pass `100`.
|
179
|
-
#
|
180
|
-
# @return [Integer, nil]
|
181
|
-
optional :product_price, Integer, nil?: true
|
182
|
-
|
183
|
-
# @!method initialize(mandate_only:, adaptive_currency_fees_inclusive: nil, product_currency: nil, product_description: nil, product_price: nil)
|
184
|
-
# Some parameter documentations has been truncated, see
|
185
|
-
# {Dodopayments::Models::SubscriptionCreateParams::OnDemand} for more details.
|
186
|
-
#
|
187
|
-
# @param mandate_only [Boolean] If set as True, does not perform any charge and only authorizes payment method d
|
188
|
-
#
|
189
|
-
# @param adaptive_currency_fees_inclusive [Boolean, nil] Whether adaptive currency fees should be included in the product_price (true) or
|
190
|
-
#
|
191
|
-
# @param product_currency [Symbol, Dodopayments::Models::Currency, nil] Optional currency of the product price. If not specified, defaults to the curren
|
192
|
-
#
|
193
|
-
# @param product_description [String, nil] Optional product description override for billing and line items.
|
194
|
-
#
|
195
|
-
# @param product_price [Integer, nil] Product price for the initial charge to customer
|
196
|
-
end
|
197
144
|
end
|
198
145
|
end
|
199
146
|
end
|
@@ -13,6 +13,7 @@ module Dodopayments
|
|
13
13
|
optional :billing, -> { Dodopayments::BillingAddress }, nil?: true
|
14
14
|
|
15
15
|
# @!attribute cancel_at_next_billing_date
|
16
|
+
# When set, the subscription will remain active until the end of billing period
|
16
17
|
#
|
17
18
|
# @return [Boolean, nil]
|
18
19
|
optional :cancel_at_next_billing_date, Dodopayments::Internal::Type::Boolean, nil?: true
|
@@ -44,12 +45,19 @@ module Dodopayments
|
|
44
45
|
|
45
46
|
# @!method initialize(billing: nil, cancel_at_next_billing_date: nil, disable_on_demand: nil, metadata: nil, next_billing_date: nil, status: nil, tax_id: nil, request_options: {})
|
46
47
|
# @param billing [Dodopayments::Models::BillingAddress, nil]
|
47
|
-
#
|
48
|
+
#
|
49
|
+
# @param cancel_at_next_billing_date [Boolean, nil] When set, the subscription will remain active until the end of billing period
|
50
|
+
#
|
48
51
|
# @param disable_on_demand [Dodopayments::Models::SubscriptionUpdateParams::DisableOnDemand, nil]
|
52
|
+
#
|
49
53
|
# @param metadata [Hash{Symbol=>String}, nil]
|
54
|
+
#
|
50
55
|
# @param next_billing_date [Time, nil]
|
56
|
+
#
|
51
57
|
# @param status [Symbol, Dodopayments::Models::SubscriptionStatus, nil]
|
58
|
+
#
|
52
59
|
# @param tax_id [String, nil]
|
60
|
+
#
|
53
61
|
# @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
|
54
62
|
|
55
63
|
class DisableOnDemand < Dodopayments::Internal::Type::BaseModel
|
@@ -32,10 +32,7 @@ module Dodopayments
|
|
32
32
|
# Webhook event will only be sent for events in the list.
|
33
33
|
#
|
34
34
|
# @return [Array<Symbol, Dodopayments::Models::WebhookEventType>, nil]
|
35
|
-
optional :filter_types,
|
36
|
-
-> {
|
37
|
-
Dodopayments::Internal::Type::ArrayOf[enum: Dodopayments::WebhookEventType]
|
38
|
-
}
|
35
|
+
optional :filter_types, -> { Dodopayments::Internal::Type::ArrayOf[enum: Dodopayments::WebhookEventType] }
|
39
36
|
|
40
37
|
# @!attribute headers
|
41
38
|
# Custom headers to be passed
|
@@ -3,7 +3,7 @@
|
|
3
3
|
module Dodopayments
|
4
4
|
module Models
|
5
5
|
# @see Dodopayments::Resources::Webhooks#create
|
6
|
-
class
|
6
|
+
class WebhookDetails < Dodopayments::Internal::Type::BaseModel
|
7
7
|
# @!attribute id
|
8
8
|
# The webhook's ID.
|
9
9
|
#
|
@@ -64,7 +64,7 @@ module Dodopayments
|
|
64
64
|
|
65
65
|
# @!method initialize(id:, created_at:, description:, metadata:, updated_at:, url:, disabled: nil, filter_types: nil, rate_limit: nil)
|
66
66
|
# Some parameter documentations has been truncated, see
|
67
|
-
# {Dodopayments::Models::
|
67
|
+
# {Dodopayments::Models::WebhookDetails} for more details.
|
68
68
|
#
|
69
69
|
# @param id [String] The webhook's ID.
|
70
70
|
#
|
data/lib/dodopayments/models.rb
CHANGED
@@ -71,6 +71,12 @@ module Dodopayments
|
|
71
71
|
|
72
72
|
BrandUpdateParams = Dodopayments::Models::BrandUpdateParams
|
73
73
|
|
74
|
+
CheckoutSessionCreateParams = Dodopayments::Models::CheckoutSessionCreateParams
|
75
|
+
|
76
|
+
CheckoutSessionRequest = Dodopayments::Models::CheckoutSessionRequest
|
77
|
+
|
78
|
+
CheckoutSessionResponse = Dodopayments::Models::CheckoutSessionResponse
|
79
|
+
|
74
80
|
CountryCode = Dodopayments::Models::CountryCode
|
75
81
|
|
76
82
|
CreateNewCustomer = Dodopayments::Models::CreateNewCustomer
|
@@ -155,6 +161,8 @@ module Dodopayments
|
|
155
161
|
|
156
162
|
NewCustomer = Dodopayments::Models::NewCustomer
|
157
163
|
|
164
|
+
OnDemandSubscription = Dodopayments::Models::OnDemandSubscription
|
165
|
+
|
158
166
|
OneTimeProductCartItem = Dodopayments::Models::OneTimeProductCartItem
|
159
167
|
|
160
168
|
Payment = Dodopayments::Models::Payment
|
@@ -225,6 +233,8 @@ module Dodopayments
|
|
225
233
|
|
226
234
|
WebhookDeleteParams = Dodopayments::Models::WebhookDeleteParams
|
227
235
|
|
236
|
+
WebhookDetails = Dodopayments::Models::WebhookDetails
|
237
|
+
|
228
238
|
WebhookEventType = Dodopayments::Models::WebhookEventType
|
229
239
|
|
230
240
|
WebhookListParams = Dodopayments::Models::WebhookListParams
|
@@ -238,6 +248,4 @@ module Dodopayments
|
|
238
248
|
Webhooks = Dodopayments::Models::Webhooks
|
239
249
|
|
240
250
|
WebhookUpdateParams = Dodopayments::Models::WebhookUpdateParams
|
241
|
-
|
242
|
-
YourWebhookURLCreateParams = Dodopayments::Models::YourWebhookURLCreateParams
|
243
251
|
end
|
@@ -0,0 +1,61 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Dodopayments
|
4
|
+
module Resources
|
5
|
+
class CheckoutSessions
|
6
|
+
# Some parameter documentations has been truncated, see
|
7
|
+
# {Dodopayments::Models::CheckoutSessionCreateParams} for more details.
|
8
|
+
#
|
9
|
+
# @overload create(product_cart:, allowed_payment_method_types: nil, billing_address: nil, billing_currency: nil, confirm: nil, customer: nil, customization: nil, discount_code: nil, feature_flags: nil, metadata: nil, return_url: nil, show_saved_payment_methods: nil, subscription_data: nil, request_options: {})
|
10
|
+
#
|
11
|
+
# @param product_cart [Array<Dodopayments::Models::CheckoutSessionRequest::ProductCart>]
|
12
|
+
#
|
13
|
+
# @param allowed_payment_method_types [Array<Symbol, Dodopayments::Models::PaymentMethodTypes>, nil] Customers will never see payment methods that are not in this list.
|
14
|
+
#
|
15
|
+
# @param billing_address [Dodopayments::Models::CheckoutSessionRequest::BillingAddress, nil] Billing address information for the session
|
16
|
+
#
|
17
|
+
# @param billing_currency [Symbol, Dodopayments::Models::Currency, nil] This field is ingored if adaptive pricing is disabled
|
18
|
+
#
|
19
|
+
# @param confirm [Boolean] If confirm is true, all the details will be finalized. If required data is missi
|
20
|
+
#
|
21
|
+
# @param customer [Dodopayments::Models::AttachExistingCustomer, Dodopayments::Models::NewCustomer, nil] Customer details for the session
|
22
|
+
#
|
23
|
+
# @param customization [Dodopayments::Models::CheckoutSessionRequest::Customization] Customization for the checkout session page
|
24
|
+
#
|
25
|
+
# @param discount_code [String, nil]
|
26
|
+
#
|
27
|
+
# @param feature_flags [Dodopayments::Models::CheckoutSessionRequest::FeatureFlags]
|
28
|
+
#
|
29
|
+
# @param metadata [Hash{Symbol=>String}, nil] Additional metadata associated with the payment. Defaults to empty if not provid
|
30
|
+
#
|
31
|
+
# @param return_url [String, nil] The url to redirect after payment failure or success.
|
32
|
+
#
|
33
|
+
# @param show_saved_payment_methods [Boolean] Display saved payment methods of a returning customer False by default
|
34
|
+
#
|
35
|
+
# @param subscription_data [Dodopayments::Models::CheckoutSessionRequest::SubscriptionData, nil]
|
36
|
+
#
|
37
|
+
# @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
|
38
|
+
#
|
39
|
+
# @return [Dodopayments::Models::CheckoutSessionResponse]
|
40
|
+
#
|
41
|
+
# @see Dodopayments::Models::CheckoutSessionCreateParams
|
42
|
+
def create(params)
|
43
|
+
parsed, options = Dodopayments::CheckoutSessionCreateParams.dump_request(params)
|
44
|
+
@client.request(
|
45
|
+
method: :post,
|
46
|
+
path: "checkouts",
|
47
|
+
body: parsed,
|
48
|
+
model: Dodopayments::CheckoutSessionResponse,
|
49
|
+
options: options
|
50
|
+
)
|
51
|
+
end
|
52
|
+
|
53
|
+
# @api private
|
54
|
+
#
|
55
|
+
# @param client [Dodopayments::Client]
|
56
|
+
def initialize(client:)
|
57
|
+
@client = client
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
@@ -26,7 +26,7 @@ module Dodopayments
|
|
26
26
|
#
|
27
27
|
# @param metadata [Hash{Symbol=>String}] Additional metadata for the subscription
|
28
28
|
#
|
29
|
-
# @param on_demand [Dodopayments::Models::
|
29
|
+
# @param on_demand [Dodopayments::Models::OnDemandSubscription, nil]
|
30
30
|
#
|
31
31
|
# @param payment_link [Boolean, nil] If true, generates a payment link.
|
32
32
|
#
|
@@ -78,7 +78,7 @@ module Dodopayments
|
|
78
78
|
#
|
79
79
|
# @param billing [Dodopayments::Models::BillingAddress, nil]
|
80
80
|
#
|
81
|
-
# @param cancel_at_next_billing_date [Boolean, nil]
|
81
|
+
# @param cancel_at_next_billing_date [Boolean, nil] When set, the subscription will remain active until the end of billing period
|
82
82
|
#
|
83
83
|
# @param disable_on_demand [Dodopayments::Models::SubscriptionUpdateParams::DisableOnDemand, nil]
|
84
84
|
#
|
@@ -31,7 +31,7 @@ module Dodopayments
|
|
31
31
|
#
|
32
32
|
# @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
|
33
33
|
#
|
34
|
-
# @return [Dodopayments::Models::
|
34
|
+
# @return [Dodopayments::Models::WebhookDetails]
|
35
35
|
#
|
36
36
|
# @see Dodopayments::Models::WebhookCreateParams
|
37
37
|
def create(params)
|
@@ -40,7 +40,7 @@ module Dodopayments
|
|
40
40
|
method: :post,
|
41
41
|
path: "webhooks",
|
42
42
|
body: parsed,
|
43
|
-
model: Dodopayments::
|
43
|
+
model: Dodopayments::WebhookDetails,
|
44
44
|
options: options
|
45
45
|
)
|
46
46
|
end
|
@@ -52,14 +52,14 @@ module Dodopayments
|
|
52
52
|
# @param webhook_id [String]
|
53
53
|
# @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
|
54
54
|
#
|
55
|
-
# @return [Dodopayments::Models::
|
55
|
+
# @return [Dodopayments::Models::WebhookDetails]
|
56
56
|
#
|
57
57
|
# @see Dodopayments::Models::WebhookRetrieveParams
|
58
58
|
def retrieve(webhook_id, params = {})
|
59
59
|
@client.request(
|
60
60
|
method: :get,
|
61
61
|
path: ["webhooks/%1$s", webhook_id],
|
62
|
-
model: Dodopayments::
|
62
|
+
model: Dodopayments::WebhookDetails,
|
63
63
|
options: params[:request_options]
|
64
64
|
)
|
65
65
|
end
|
@@ -87,7 +87,7 @@ module Dodopayments
|
|
87
87
|
#
|
88
88
|
# @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
|
89
89
|
#
|
90
|
-
# @return [Dodopayments::Models::
|
90
|
+
# @return [Dodopayments::Models::WebhookDetails]
|
91
91
|
#
|
92
92
|
# @see Dodopayments::Models::WebhookUpdateParams
|
93
93
|
def update(webhook_id, params = {})
|
@@ -96,7 +96,7 @@ module Dodopayments
|
|
96
96
|
method: :patch,
|
97
97
|
path: ["webhooks/%1$s", webhook_id],
|
98
98
|
body: parsed,
|
99
|
-
model: Dodopayments::
|
99
|
+
model: Dodopayments::WebhookDetails,
|
100
100
|
options: options
|
101
101
|
)
|
102
102
|
end
|
@@ -111,7 +111,7 @@ module Dodopayments
|
|
111
111
|
#
|
112
112
|
# @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
|
113
113
|
#
|
114
|
-
# @return [Dodopayments::Internal::CursorPagePagination<Dodopayments::Models::
|
114
|
+
# @return [Dodopayments::Internal::CursorPagePagination<Dodopayments::Models::WebhookDetails>]
|
115
115
|
#
|
116
116
|
# @see Dodopayments::Models::WebhookListParams
|
117
117
|
def list(params = {})
|
@@ -121,7 +121,7 @@ module Dodopayments
|
|
121
121
|
path: "webhooks",
|
122
122
|
query: parsed,
|
123
123
|
page: Dodopayments::Internal::CursorPagePagination,
|
124
|
-
model: Dodopayments::
|
124
|
+
model: Dodopayments::WebhookDetails,
|
125
125
|
options: options
|
126
126
|
)
|
127
127
|
end
|
data/lib/dodopayments/version.rb
CHANGED
data/lib/dodopayments.rb
CHANGED
@@ -52,12 +52,12 @@ require_relative "dodopayments/internal/transport/pooled_net_requester"
|
|
52
52
|
require_relative "dodopayments/client"
|
53
53
|
require_relative "dodopayments/internal/cursor_page_pagination"
|
54
54
|
require_relative "dodopayments/internal/default_page_number_pagination"
|
55
|
+
require_relative "dodopayments/models/checkout_session_request"
|
55
56
|
require_relative "dodopayments/models/license_key"
|
56
57
|
require_relative "dodopayments/models/get_dispute"
|
57
58
|
require_relative "dodopayments/models/refund"
|
58
59
|
require_relative "dodopayments/models/subscription"
|
59
60
|
require_relative "dodopayments/models/payment"
|
60
|
-
require_relative "dodopayments/models/webhook_payload"
|
61
61
|
require_relative "dodopayments/models/addon_cart_response_item"
|
62
62
|
require_relative "dodopayments/models/addon_create_params"
|
63
63
|
require_relative "dodopayments/models/addon_list_params"
|
@@ -77,6 +77,8 @@ require_relative "dodopayments/models/brand_retrieve_params"
|
|
77
77
|
require_relative "dodopayments/models/brand_update_images_params"
|
78
78
|
require_relative "dodopayments/models/brand_update_images_response"
|
79
79
|
require_relative "dodopayments/models/brand_update_params"
|
80
|
+
require_relative "dodopayments/models/checkout_session_create_params"
|
81
|
+
require_relative "dodopayments/models/checkout_session_response"
|
80
82
|
require_relative "dodopayments/models/country_code"
|
81
83
|
require_relative "dodopayments/models/create_new_customer"
|
82
84
|
require_relative "dodopayments/models/currency"
|
@@ -120,6 +122,7 @@ require_relative "dodopayments/models/license_validate_response"
|
|
120
122
|
require_relative "dodopayments/models/misc_list_supported_countries_params"
|
121
123
|
require_relative "dodopayments/models/misc_list_supported_countries_response"
|
122
124
|
require_relative "dodopayments/models/new_customer"
|
125
|
+
require_relative "dodopayments/models/on_demand_subscription"
|
123
126
|
require_relative "dodopayments/models/one_time_product_cart_item"
|
124
127
|
require_relative "dodopayments/models/payment_create_params"
|
125
128
|
require_relative "dodopayments/models/payment_create_response"
|
@@ -161,24 +164,22 @@ require_relative "dodopayments/models/subscription_update_params"
|
|
161
164
|
require_relative "dodopayments/models/tax_category"
|
162
165
|
require_relative "dodopayments/models/time_interval"
|
163
166
|
require_relative "dodopayments/models/webhook_create_params"
|
164
|
-
require_relative "dodopayments/models/webhook_create_response"
|
165
167
|
require_relative "dodopayments/models/webhook_delete_params"
|
168
|
+
require_relative "dodopayments/models/webhook_details"
|
166
169
|
require_relative "dodopayments/models/webhook_event_type"
|
167
170
|
require_relative "dodopayments/models/webhook_list_params"
|
168
|
-
require_relative "dodopayments/models/
|
171
|
+
require_relative "dodopayments/models/webhook_payload"
|
169
172
|
require_relative "dodopayments/models/webhook_retrieve_params"
|
170
|
-
require_relative "dodopayments/models/webhook_retrieve_response"
|
171
173
|
require_relative "dodopayments/models/webhook_retrieve_secret_params"
|
172
174
|
require_relative "dodopayments/models/webhook_retrieve_secret_response"
|
173
175
|
require_relative "dodopayments/models/webhooks/header_retrieve_params"
|
174
176
|
require_relative "dodopayments/models/webhooks/header_retrieve_response"
|
175
177
|
require_relative "dodopayments/models/webhooks/header_update_params"
|
176
178
|
require_relative "dodopayments/models/webhook_update_params"
|
177
|
-
require_relative "dodopayments/models/webhook_update_response"
|
178
|
-
require_relative "dodopayments/models/your_webhook_url_create_params"
|
179
179
|
require_relative "dodopayments/models"
|
180
180
|
require_relative "dodopayments/resources/addons"
|
181
181
|
require_relative "dodopayments/resources/brands"
|
182
|
+
require_relative "dodopayments/resources/checkout_sessions"
|
182
183
|
require_relative "dodopayments/resources/customers"
|
183
184
|
require_relative "dodopayments/resources/customers/customer_portal"
|
184
185
|
require_relative "dodopayments/resources/discounts"
|
@@ -198,4 +199,3 @@ require_relative "dodopayments/resources/subscriptions"
|
|
198
199
|
require_relative "dodopayments/resources/webhook_events"
|
199
200
|
require_relative "dodopayments/resources/webhooks"
|
200
201
|
require_relative "dodopayments/resources/webhooks/headers"
|
201
|
-
require_relative "dodopayments/resources/your_webhook_url"
|
data/rbi/dodopayments/client.rbi
CHANGED
@@ -23,6 +23,9 @@ module Dodopayments
|
|
23
23
|
sig { returns(String) }
|
24
24
|
attr_reader :bearer_token
|
25
25
|
|
26
|
+
sig { returns(Dodopayments::Resources::CheckoutSessions) }
|
27
|
+
attr_reader :checkout_sessions
|
28
|
+
|
26
29
|
sig { returns(Dodopayments::Resources::Payments) }
|
27
30
|
attr_reader :payments
|
28
31
|
|
@@ -74,9 +77,6 @@ module Dodopayments
|
|
74
77
|
sig { returns(Dodopayments::Resources::Webhooks) }
|
75
78
|
attr_reader :webhooks
|
76
79
|
|
77
|
-
sig { returns(Dodopayments::Resources::YourWebhookURL) }
|
78
|
-
attr_reader :your_webhook_url
|
79
|
-
|
80
80
|
# @api private
|
81
81
|
sig { override.returns(T::Hash[String, String]) }
|
82
82
|
private def auth_headers
|
data/rbi/dodopayments/errors.rbi
CHANGED
@@ -59,10 +59,10 @@ module Dodopayments
|
|
59
59
|
end
|
60
60
|
|
61
61
|
class APIConnectionError < Dodopayments::Errors::APIError
|
62
|
-
sig {
|
62
|
+
sig { returns(NilClass) }
|
63
63
|
attr_accessor :status
|
64
64
|
|
65
|
-
sig {
|
65
|
+
sig { returns(NilClass) }
|
66
66
|
attr_accessor :body
|
67
67
|
|
68
68
|
# @api private
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module Dodopayments
|
4
|
+
module Models
|
5
|
+
class CheckoutSessionCreateParams < Dodopayments::Models::CheckoutSessionRequest
|
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::CheckoutSessionCreateParams,
|
13
|
+
Dodopayments::Internal::AnyHash
|
14
|
+
)
|
15
|
+
end
|
16
|
+
|
17
|
+
sig do
|
18
|
+
params(request_options: Dodopayments::RequestOptions::OrHash).returns(
|
19
|
+
T.attached_class
|
20
|
+
)
|
21
|
+
end
|
22
|
+
def self.new(request_options: {})
|
23
|
+
end
|
24
|
+
|
25
|
+
sig do
|
26
|
+
override.returns({ request_options: Dodopayments::RequestOptions })
|
27
|
+
end
|
28
|
+
def to_hash
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|