dodopayments 1.19.0 → 1.20.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 +25 -0
- data/README.md +5 -5
- data/lib/dodopayments/client.rb +12 -9
- data/lib/dodopayments/internal/transport/base_client.rb +1 -1
- data/lib/dodopayments/internal/util.rb +3 -3
- data/lib/dodopayments/models/addon_cart_response_item.rb +23 -0
- data/lib/dodopayments/models/addon_create_params.rb +58 -0
- data/lib/dodopayments/models/addon_list_params.rb +30 -0
- data/lib/dodopayments/models/addon_response.rb +93 -0
- data/lib/dodopayments/models/addon_retrieve_params.rb +14 -0
- data/lib/dodopayments/models/addon_update_images_params.rb +14 -0
- data/lib/dodopayments/models/addon_update_images_response.rb +22 -0
- data/lib/dodopayments/models/addon_update_params.rb +66 -0
- data/lib/dodopayments/models/currency.rb +158 -0
- data/lib/dodopayments/models/payment.rb +14 -315
- data/lib/dodopayments/models/payment_create_params.rb +3 -158
- data/lib/dodopayments/models/payment_list_response.rb +3 -157
- data/lib/dodopayments/models/payout_list_response.rb +3 -157
- data/lib/dodopayments/models/price.rb +6 -314
- data/lib/dodopayments/models/product.rb +3 -19
- data/lib/dodopayments/models/product_create_params.rb +3 -17
- data/lib/dodopayments/models/product_list_response.rb +6 -176
- data/lib/dodopayments/models/product_update_params.rb +3 -17
- data/lib/dodopayments/models/refund.rb +3 -157
- data/lib/dodopayments/models/subscription.rb +21 -158
- data/lib/dodopayments/models/subscription_create_params.rb +30 -159
- data/lib/dodopayments/models/subscription_create_response.rb +10 -1
- data/lib/dodopayments/models/subscription_list_response.rb +179 -0
- data/lib/dodopayments/models/subscription_update_params.rb +19 -1
- data/lib/dodopayments/models/tax_category.rb +19 -0
- data/lib/dodopayments/resources/addons.rb +141 -0
- data/lib/dodopayments/resources/payments.rb +1 -1
- data/lib/dodopayments/resources/products.rb +2 -2
- data/lib/dodopayments/resources/subscriptions.rb +9 -5
- data/lib/dodopayments/version.rb +1 -1
- data/lib/dodopayments.rb +12 -0
- data/rbi/dodopayments/client.rbi +7 -5
- data/rbi/dodopayments/errors.rbi +1 -1
- data/rbi/dodopayments/models/addon_cart_response_item.rbi +20 -0
- data/rbi/dodopayments/models/addon_create_params.rbi +69 -0
- data/rbi/dodopayments/models/addon_list_params.rbi +45 -0
- data/rbi/dodopayments/models/addon_response.rbi +103 -0
- data/rbi/dodopayments/models/addon_retrieve_params.rbi +19 -0
- data/rbi/dodopayments/models/addon_update_images_params.rbi +19 -0
- data/rbi/dodopayments/models/addon_update_images_response.rbi +19 -0
- data/rbi/dodopayments/models/addon_update_params.rbi +77 -0
- data/rbi/dodopayments/models/currency.rbi +161 -0
- data/rbi/dodopayments/models/payment.rbi +15 -318
- data/rbi/dodopayments/models/payment_create_params.rbi +3 -159
- data/rbi/dodopayments/models/payment_list_response.rbi +3 -159
- data/rbi/dodopayments/models/payout_list_response.rbi +3 -159
- data/rbi/dodopayments/models/price.rbi +6 -318
- data/rbi/dodopayments/models/product.rbi +3 -20
- data/rbi/dodopayments/models/product_create_params.rbi +3 -21
- data/rbi/dodopayments/models/product_list_response.rbi +6 -180
- data/rbi/dodopayments/models/product_update_params.rbi +3 -21
- data/rbi/dodopayments/models/refund.rbi +3 -159
- data/rbi/dodopayments/models/subscription.rbi +19 -159
- data/rbi/dodopayments/models/subscription_create_params.rbi +27 -160
- data/rbi/dodopayments/models/subscription_create_response.rbi +8 -0
- data/rbi/dodopayments/models/subscription_list_response.rbi +190 -0
- data/rbi/dodopayments/models/subscription_update_params.rbi +37 -1
- data/rbi/dodopayments/models/tax_category.rbi +22 -0
- data/rbi/dodopayments/resources/addons.rbi +97 -0
- data/rbi/dodopayments/resources/payments.rbi +1 -1
- data/rbi/dodopayments/resources/products.rbi +2 -2
- data/rbi/dodopayments/resources/subscriptions.rbi +13 -2
- data/sig/dodopayments/client.rbs +4 -2
- data/sig/dodopayments/models/addon_cart_response_item.rbs +15 -0
- data/sig/dodopayments/models/addon_create_params.rbs +39 -0
- data/sig/dodopayments/models/addon_list_params.rbs +24 -0
- data/sig/dodopayments/models/addon_response.rbs +54 -0
- data/sig/dodopayments/models/addon_retrieve_params.rbs +15 -0
- data/sig/dodopayments/models/addon_update_images_params.rbs +15 -0
- data/sig/dodopayments/models/addon_update_images_response.rbs +15 -0
- data/sig/dodopayments/models/addon_update_params.rbs +43 -0
- data/sig/dodopayments/models/currency.rbs +302 -0
- data/sig/dodopayments/models/payment.rbs +10 -604
- data/sig/dodopayments/models/payment_create_params.rbs +3 -302
- data/sig/dodopayments/models/payment_list_response.rbs +3 -302
- data/sig/dodopayments/models/payout_list_response.rbs +3 -302
- data/sig/dodopayments/models/price.rbs +6 -604
- data/sig/dodopayments/models/product.rbs +3 -16
- data/sig/dodopayments/models/product_create_params.rbs +3 -16
- data/sig/dodopayments/models/product_list_response.rbs +6 -318
- data/sig/dodopayments/models/product_update_params.rbs +3 -16
- data/sig/dodopayments/models/refund.rbs +3 -302
- data/sig/dodopayments/models/subscription.rbs +11 -302
- data/sig/dodopayments/models/subscription_create_params.rbs +19 -302
- data/sig/dodopayments/models/subscription_create_response.rbs +4 -0
- data/sig/dodopayments/models/subscription_list_response.rbs +98 -0
- data/sig/dodopayments/models/subscription_update_params.rbs +14 -0
- data/sig/dodopayments/models/tax_category.rbs +16 -0
- data/sig/dodopayments/resources/addons.rbs +43 -0
- data/sig/dodopayments/resources/payments.rbs +1 -1
- data/sig/dodopayments/resources/products.rbs +2 -2
- data/sig/dodopayments/resources/subscriptions.rbs +4 -2
- metadata +40 -4
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Dodopayments
|
4
|
+
module Models
|
5
|
+
# Represents the different categories of taxation applicable to various products
|
6
|
+
# and services.
|
7
|
+
module TaxCategory
|
8
|
+
extend Dodopayments::Internal::Type::Enum
|
9
|
+
|
10
|
+
DIGITAL_PRODUCTS = :digital_products
|
11
|
+
SAAS = :saas
|
12
|
+
E_BOOK = :e_book
|
13
|
+
EDTECH = :edtech
|
14
|
+
|
15
|
+
# @!method self.values
|
16
|
+
# @return [Array<Symbol>]
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,141 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Dodopayments
|
4
|
+
module Resources
|
5
|
+
class Addons
|
6
|
+
# Some parameter documentations has been truncated, see
|
7
|
+
# {Dodopayments::Models::AddonCreateParams} for more details.
|
8
|
+
#
|
9
|
+
# @overload create(currency:, name:, price:, tax_category:, description: nil, request_options: {})
|
10
|
+
#
|
11
|
+
# @param currency [Symbol, Dodopayments::Models::Currency]
|
12
|
+
#
|
13
|
+
# @param name [String] Name of the Addon
|
14
|
+
#
|
15
|
+
# @param price [Integer] Amount of the addon
|
16
|
+
#
|
17
|
+
# @param tax_category [Symbol, Dodopayments::Models::TaxCategory] Represents the different categories of taxation applicable to various products a
|
18
|
+
# ...
|
19
|
+
#
|
20
|
+
# @param description [String, nil] Optional description of the Addon
|
21
|
+
#
|
22
|
+
# @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
|
23
|
+
#
|
24
|
+
# @return [Dodopayments::Models::AddonResponse]
|
25
|
+
#
|
26
|
+
# @see Dodopayments::Models::AddonCreateParams
|
27
|
+
def create(params)
|
28
|
+
parsed, options = Dodopayments::Models::AddonCreateParams.dump_request(params)
|
29
|
+
@client.request(
|
30
|
+
method: :post,
|
31
|
+
path: "addons",
|
32
|
+
body: parsed,
|
33
|
+
model: Dodopayments::Models::AddonResponse,
|
34
|
+
options: options
|
35
|
+
)
|
36
|
+
end
|
37
|
+
|
38
|
+
# @overload retrieve(id, request_options: {})
|
39
|
+
#
|
40
|
+
# @param id [String] Addon Id
|
41
|
+
#
|
42
|
+
# @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
|
43
|
+
#
|
44
|
+
# @return [Dodopayments::Models::AddonResponse]
|
45
|
+
#
|
46
|
+
# @see Dodopayments::Models::AddonRetrieveParams
|
47
|
+
def retrieve(id, params = {})
|
48
|
+
@client.request(
|
49
|
+
method: :get,
|
50
|
+
path: ["addons/%1$s", id],
|
51
|
+
model: Dodopayments::Models::AddonResponse,
|
52
|
+
options: params[:request_options]
|
53
|
+
)
|
54
|
+
end
|
55
|
+
|
56
|
+
# Some parameter documentations has been truncated, see
|
57
|
+
# {Dodopayments::Models::AddonUpdateParams} for more details.
|
58
|
+
#
|
59
|
+
# @overload update(id, currency: nil, description: nil, image_id: nil, name: nil, price: nil, tax_category: nil, request_options: {})
|
60
|
+
#
|
61
|
+
# @param id [String] Addon Id
|
62
|
+
#
|
63
|
+
# @param currency [Symbol, Dodopayments::Models::Currency, nil]
|
64
|
+
#
|
65
|
+
# @param description [String, nil] Description of the Addon, optional and must be at most 1000 characters.
|
66
|
+
#
|
67
|
+
# @param image_id [String, nil] Addon image id after its uploaded to S3
|
68
|
+
#
|
69
|
+
# @param name [String, nil] Name of the Addon, optional and must be at most 100 characters.
|
70
|
+
#
|
71
|
+
# @param price [Integer, nil] Amount of the addon
|
72
|
+
#
|
73
|
+
# @param tax_category [Symbol, Dodopayments::Models::TaxCategory, nil] Represents the different categories of taxation applicable to various products a
|
74
|
+
# ...
|
75
|
+
#
|
76
|
+
# @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
|
77
|
+
#
|
78
|
+
# @return [Dodopayments::Models::AddonResponse]
|
79
|
+
#
|
80
|
+
# @see Dodopayments::Models::AddonUpdateParams
|
81
|
+
def update(id, params = {})
|
82
|
+
parsed, options = Dodopayments::Models::AddonUpdateParams.dump_request(params)
|
83
|
+
@client.request(
|
84
|
+
method: :patch,
|
85
|
+
path: ["addons/%1$s", id],
|
86
|
+
body: parsed,
|
87
|
+
model: Dodopayments::Models::AddonResponse,
|
88
|
+
options: options
|
89
|
+
)
|
90
|
+
end
|
91
|
+
|
92
|
+
# @overload list(page_number: nil, page_size: nil, request_options: {})
|
93
|
+
#
|
94
|
+
# @param page_number [Integer, nil] Page number default is 0
|
95
|
+
#
|
96
|
+
# @param page_size [Integer, nil] Page size default is 10 max is 100
|
97
|
+
#
|
98
|
+
# @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
|
99
|
+
#
|
100
|
+
# @return [Dodopayments::Internal::DefaultPageNumberPagination<Dodopayments::Models::AddonResponse>]
|
101
|
+
#
|
102
|
+
# @see Dodopayments::Models::AddonListParams
|
103
|
+
def list(params = {})
|
104
|
+
parsed, options = Dodopayments::Models::AddonListParams.dump_request(params)
|
105
|
+
@client.request(
|
106
|
+
method: :get,
|
107
|
+
path: "addons",
|
108
|
+
query: parsed,
|
109
|
+
page: Dodopayments::Internal::DefaultPageNumberPagination,
|
110
|
+
model: Dodopayments::Models::AddonResponse,
|
111
|
+
options: options
|
112
|
+
)
|
113
|
+
end
|
114
|
+
|
115
|
+
# @overload update_images(id, request_options: {})
|
116
|
+
#
|
117
|
+
# @param id [String] Addon Id
|
118
|
+
#
|
119
|
+
# @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
|
120
|
+
#
|
121
|
+
# @return [Dodopayments::Models::AddonUpdateImagesResponse]
|
122
|
+
#
|
123
|
+
# @see Dodopayments::Models::AddonUpdateImagesParams
|
124
|
+
def update_images(id, params = {})
|
125
|
+
@client.request(
|
126
|
+
method: :put,
|
127
|
+
path: ["addons/%1$s/images", id],
|
128
|
+
model: Dodopayments::Models::AddonUpdateImagesResponse,
|
129
|
+
options: params[:request_options]
|
130
|
+
)
|
131
|
+
end
|
132
|
+
|
133
|
+
# @api private
|
134
|
+
#
|
135
|
+
# @param client [Dodopayments::Client]
|
136
|
+
def initialize(client:)
|
137
|
+
@client = client
|
138
|
+
end
|
139
|
+
end
|
140
|
+
end
|
141
|
+
end
|
@@ -16,7 +16,7 @@ module Dodopayments
|
|
16
16
|
#
|
17
17
|
# @param allowed_payment_method_types [Array<Symbol, Dodopayments::Models::PaymentCreateParams::AllowedPaymentMethodType>, nil] List of payment methods allowed during checkout. ...
|
18
18
|
#
|
19
|
-
# @param billing_currency [Symbol, Dodopayments::Models::
|
19
|
+
# @param billing_currency [Symbol, Dodopayments::Models::Currency, nil]
|
20
20
|
#
|
21
21
|
# @param discount_code [String, nil] Discount Code to apply to the transaction
|
22
22
|
#
|
@@ -13,7 +13,7 @@ module Dodopayments
|
|
13
13
|
#
|
14
14
|
# @param price [Dodopayments::Models::Price::OneTimePrice, Dodopayments::Models::Price::RecurringPrice]
|
15
15
|
#
|
16
|
-
# @param tax_category [Symbol, Dodopayments::Models::
|
16
|
+
# @param tax_category [Symbol, Dodopayments::Models::TaxCategory] Represents the different categories of taxation applicable to various products a
|
17
17
|
# ...
|
18
18
|
#
|
19
19
|
# @param addons [Array<String>, nil] Addons available for subscription product
|
@@ -89,7 +89,7 @@ module Dodopayments
|
|
89
89
|
#
|
90
90
|
# @param price [Dodopayments::Models::Price::OneTimePrice, Dodopayments::Models::Price::RecurringPrice, nil]
|
91
91
|
#
|
92
|
-
# @param tax_category [Symbol, Dodopayments::Models::
|
92
|
+
# @param tax_category [Symbol, Dodopayments::Models::TaxCategory, nil] Represents the different categories of taxation applicable to various products a
|
93
93
|
# ...
|
94
94
|
#
|
95
95
|
# @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
|
@@ -6,7 +6,7 @@ module Dodopayments
|
|
6
6
|
# Some parameter documentations has been truncated, see
|
7
7
|
# {Dodopayments::Models::SubscriptionCreateParams} for more details.
|
8
8
|
#
|
9
|
-
# @overload create(billing:, customer:, product_id:, quantity:, allowed_payment_method_types: nil, billing_currency: nil, discount_code: nil, metadata: nil, on_demand: nil, payment_link: nil, return_url: nil, show_saved_payment_methods: nil, tax_id: nil, trial_period_days: nil, request_options: {})
|
9
|
+
# @overload create(billing:, customer:, product_id:, quantity:, addons: nil, allowed_payment_method_types: nil, billing_currency: nil, discount_code: nil, metadata: nil, on_demand: nil, payment_link: nil, return_url: nil, show_saved_payment_methods: nil, tax_id: nil, trial_period_days: nil, request_options: {})
|
10
10
|
#
|
11
11
|
# @param billing [Dodopayments::Models::BillingAddress]
|
12
12
|
#
|
@@ -16,9 +16,11 @@ module Dodopayments
|
|
16
16
|
#
|
17
17
|
# @param quantity [Integer] Number of units to subscribe for. Must be at least 1.
|
18
18
|
#
|
19
|
+
# @param addons [Array<Dodopayments::Models::SubscriptionCreateParams::Addon>, nil] Attach addons to this subscription
|
20
|
+
#
|
19
21
|
# @param allowed_payment_method_types [Array<Symbol, Dodopayments::Models::SubscriptionCreateParams::AllowedPaymentMethodType>, nil] List of payment methods allowed during checkout. ...
|
20
22
|
#
|
21
|
-
# @param billing_currency [Symbol, Dodopayments::Models::
|
23
|
+
# @param billing_currency [Symbol, Dodopayments::Models::Currency, nil]
|
22
24
|
#
|
23
25
|
# @param discount_code [String, nil] Discount Code to apply to the subscription
|
24
26
|
#
|
@@ -71,12 +73,14 @@ module Dodopayments
|
|
71
73
|
)
|
72
74
|
end
|
73
75
|
|
74
|
-
# @overload update(subscription_id, billing: nil, metadata: nil, status: nil, tax_id: nil, request_options: {})
|
76
|
+
# @overload update(subscription_id, billing: nil, disable_on_demand: nil, metadata: nil, status: nil, tax_id: nil, request_options: {})
|
75
77
|
#
|
76
78
|
# @param subscription_id [String] Subscription Id
|
77
79
|
#
|
78
80
|
# @param billing [Dodopayments::Models::BillingAddress, nil]
|
79
81
|
#
|
82
|
+
# @param disable_on_demand [Dodopayments::Models::SubscriptionUpdateParams::DisableOnDemand, nil]
|
83
|
+
#
|
80
84
|
# @param metadata [Hash{Symbol=>String}, nil]
|
81
85
|
#
|
82
86
|
# @param status [Symbol, Dodopayments::Models::SubscriptionStatus, nil]
|
@@ -115,7 +119,7 @@ module Dodopayments
|
|
115
119
|
#
|
116
120
|
# @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
|
117
121
|
#
|
118
|
-
# @return [Dodopayments::Internal::DefaultPageNumberPagination<Dodopayments::Models::
|
122
|
+
# @return [Dodopayments::Internal::DefaultPageNumberPagination<Dodopayments::Models::SubscriptionListResponse>]
|
119
123
|
#
|
120
124
|
# @see Dodopayments::Models::SubscriptionListParams
|
121
125
|
def list(params = {})
|
@@ -125,7 +129,7 @@ module Dodopayments
|
|
125
129
|
path: "subscriptions",
|
126
130
|
query: parsed,
|
127
131
|
page: Dodopayments::Internal::DefaultPageNumberPagination,
|
128
|
-
model: Dodopayments::Models::
|
132
|
+
model: Dodopayments::Models::SubscriptionListResponse,
|
129
133
|
options: options
|
130
134
|
)
|
131
135
|
end
|
data/lib/dodopayments/version.rb
CHANGED
data/lib/dodopayments.rb
CHANGED
@@ -47,10 +47,19 @@ require_relative "dodopayments/internal/transport/base_client"
|
|
47
47
|
require_relative "dodopayments/internal/transport/pooled_net_requester"
|
48
48
|
require_relative "dodopayments/client"
|
49
49
|
require_relative "dodopayments/internal/default_page_number_pagination"
|
50
|
+
require_relative "dodopayments/models/addon_cart_response_item"
|
51
|
+
require_relative "dodopayments/models/addon_create_params"
|
52
|
+
require_relative "dodopayments/models/addon_list_params"
|
53
|
+
require_relative "dodopayments/models/addon_response"
|
54
|
+
require_relative "dodopayments/models/addon_retrieve_params"
|
55
|
+
require_relative "dodopayments/models/addon_update_images_params"
|
56
|
+
require_relative "dodopayments/models/addon_update_images_response"
|
57
|
+
require_relative "dodopayments/models/addon_update_params"
|
50
58
|
require_relative "dodopayments/models/attach_existing_customer"
|
51
59
|
require_relative "dodopayments/models/billing_address"
|
52
60
|
require_relative "dodopayments/models/country_code"
|
53
61
|
require_relative "dodopayments/models/create_new_customer"
|
62
|
+
require_relative "dodopayments/models/currency"
|
54
63
|
require_relative "dodopayments/models/customer"
|
55
64
|
require_relative "dodopayments/models/customer_create_params"
|
56
65
|
require_relative "dodopayments/models/customer_limited_details"
|
@@ -122,13 +131,16 @@ require_relative "dodopayments/models/subscription_charge_response"
|
|
122
131
|
require_relative "dodopayments/models/subscription_create_params"
|
123
132
|
require_relative "dodopayments/models/subscription_create_response"
|
124
133
|
require_relative "dodopayments/models/subscription_list_params"
|
134
|
+
require_relative "dodopayments/models/subscription_list_response"
|
125
135
|
require_relative "dodopayments/models/subscription_retrieve_params"
|
126
136
|
require_relative "dodopayments/models/subscription_status"
|
127
137
|
require_relative "dodopayments/models/subscription_update_params"
|
138
|
+
require_relative "dodopayments/models/tax_category"
|
128
139
|
require_relative "dodopayments/models/time_interval"
|
129
140
|
require_relative "dodopayments/models/webhook_event"
|
130
141
|
require_relative "dodopayments/models/webhook_event_list_params"
|
131
142
|
require_relative "dodopayments/models/webhook_event_retrieve_params"
|
143
|
+
require_relative "dodopayments/resources/addons"
|
132
144
|
require_relative "dodopayments/resources/customers"
|
133
145
|
require_relative "dodopayments/resources/customers/customer_portal"
|
134
146
|
require_relative "dodopayments/resources/discounts"
|
data/rbi/dodopayments/client.rbi
CHANGED
@@ -16,9 +16,8 @@ module Dodopayments
|
|
16
16
|
T::Hash[Symbol, String]
|
17
17
|
)
|
18
18
|
|
19
|
-
# Bearer Token for API authentication
|
20
19
|
sig { returns(String) }
|
21
|
-
attr_reader :
|
20
|
+
attr_reader :api_key
|
22
21
|
|
23
22
|
sig { returns(Dodopayments::Resources::Payments) }
|
24
23
|
attr_reader :payments
|
@@ -62,6 +61,9 @@ module Dodopayments
|
|
62
61
|
sig { returns(Dodopayments::Resources::Discounts) }
|
63
62
|
attr_reader :discounts
|
64
63
|
|
64
|
+
sig { returns(Dodopayments::Resources::Addons) }
|
65
|
+
attr_reader :addons
|
66
|
+
|
65
67
|
# @api private
|
66
68
|
sig { override.returns(T::Hash[String, String]) }
|
67
69
|
private def auth_headers; end
|
@@ -69,7 +71,7 @@ module Dodopayments
|
|
69
71
|
# Creates and returns a new client for interacting with the API.
|
70
72
|
sig do
|
71
73
|
params(
|
72
|
-
|
74
|
+
api_key: T.nilable(String),
|
73
75
|
environment: NilClass,
|
74
76
|
base_url: T.nilable(String),
|
75
77
|
max_retries: Integer,
|
@@ -80,8 +82,8 @@ module Dodopayments
|
|
80
82
|
.returns(T.attached_class)
|
81
83
|
end
|
82
84
|
def self.new(
|
83
|
-
#
|
84
|
-
|
85
|
+
# Defaults to `ENV["DODO_PAYMENTS_API_KEY"]`
|
86
|
+
api_key: ENV["DODO_PAYMENTS_API_KEY"],
|
85
87
|
# Specifies the environment to use for the API.
|
86
88
|
#
|
87
89
|
# Each environment maps to a different base URL:
|
data/rbi/dodopayments/errors.rbi
CHANGED
@@ -0,0 +1,20 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module Dodopayments
|
4
|
+
module Models
|
5
|
+
class AddonCartResponseItem < Dodopayments::Internal::Type::BaseModel
|
6
|
+
sig { returns(String) }
|
7
|
+
attr_accessor :addon_id
|
8
|
+
|
9
|
+
sig { returns(Integer) }
|
10
|
+
attr_accessor :quantity
|
11
|
+
|
12
|
+
# Response struct representing subscription details
|
13
|
+
sig { params(addon_id: String, quantity: Integer).returns(T.attached_class) }
|
14
|
+
def self.new(addon_id:, quantity:); end
|
15
|
+
|
16
|
+
sig { override.returns({addon_id: String, quantity: Integer}) }
|
17
|
+
def to_hash; end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,69 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module Dodopayments
|
4
|
+
module Models
|
5
|
+
class AddonCreateParams < Dodopayments::Internal::Type::BaseModel
|
6
|
+
extend Dodopayments::Internal::Type::RequestParameters::Converter
|
7
|
+
include Dodopayments::Internal::Type::RequestParameters
|
8
|
+
|
9
|
+
sig { returns(Dodopayments::Models::Currency::OrSymbol) }
|
10
|
+
attr_accessor :currency
|
11
|
+
|
12
|
+
# Name of the Addon
|
13
|
+
sig { returns(String) }
|
14
|
+
attr_accessor :name
|
15
|
+
|
16
|
+
# Amount of the addon
|
17
|
+
sig { returns(Integer) }
|
18
|
+
attr_accessor :price
|
19
|
+
|
20
|
+
# Represents the different categories of taxation applicable to various products
|
21
|
+
# and services.
|
22
|
+
sig { returns(Dodopayments::Models::TaxCategory::OrSymbol) }
|
23
|
+
attr_accessor :tax_category
|
24
|
+
|
25
|
+
# Optional description of the Addon
|
26
|
+
sig { returns(T.nilable(String)) }
|
27
|
+
attr_accessor :description
|
28
|
+
|
29
|
+
sig do
|
30
|
+
params(
|
31
|
+
currency: Dodopayments::Models::Currency::OrSymbol,
|
32
|
+
name: String,
|
33
|
+
price: Integer,
|
34
|
+
tax_category: Dodopayments::Models::TaxCategory::OrSymbol,
|
35
|
+
description: T.nilable(String),
|
36
|
+
request_options: T.any(Dodopayments::RequestOptions, Dodopayments::Internal::AnyHash)
|
37
|
+
)
|
38
|
+
.returns(T.attached_class)
|
39
|
+
end
|
40
|
+
def self.new(
|
41
|
+
currency:,
|
42
|
+
# Name of the Addon
|
43
|
+
name:,
|
44
|
+
# Amount of the addon
|
45
|
+
price:,
|
46
|
+
# Represents the different categories of taxation applicable to various products
|
47
|
+
# and services.
|
48
|
+
tax_category:,
|
49
|
+
# Optional description of the Addon
|
50
|
+
description: nil,
|
51
|
+
request_options: {}
|
52
|
+
); end
|
53
|
+
sig do
|
54
|
+
override
|
55
|
+
.returns(
|
56
|
+
{
|
57
|
+
currency: Dodopayments::Models::Currency::OrSymbol,
|
58
|
+
name: String,
|
59
|
+
price: Integer,
|
60
|
+
tax_category: Dodopayments::Models::TaxCategory::OrSymbol,
|
61
|
+
description: T.nilable(String),
|
62
|
+
request_options: Dodopayments::RequestOptions
|
63
|
+
}
|
64
|
+
)
|
65
|
+
end
|
66
|
+
def to_hash; end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module Dodopayments
|
4
|
+
module Models
|
5
|
+
class AddonListParams < Dodopayments::Internal::Type::BaseModel
|
6
|
+
extend Dodopayments::Internal::Type::RequestParameters::Converter
|
7
|
+
include Dodopayments::Internal::Type::RequestParameters
|
8
|
+
|
9
|
+
# Page number default is 0
|
10
|
+
sig { returns(T.nilable(Integer)) }
|
11
|
+
attr_accessor :page_number
|
12
|
+
|
13
|
+
# Page size default is 10 max is 100
|
14
|
+
sig { returns(T.nilable(Integer)) }
|
15
|
+
attr_accessor :page_size
|
16
|
+
|
17
|
+
sig do
|
18
|
+
params(
|
19
|
+
page_number: T.nilable(Integer),
|
20
|
+
page_size: T.nilable(Integer),
|
21
|
+
request_options: T.any(Dodopayments::RequestOptions, Dodopayments::Internal::AnyHash)
|
22
|
+
)
|
23
|
+
.returns(T.attached_class)
|
24
|
+
end
|
25
|
+
def self.new(
|
26
|
+
# Page number default is 0
|
27
|
+
page_number: nil,
|
28
|
+
# Page size default is 10 max is 100
|
29
|
+
page_size: nil,
|
30
|
+
request_options: {}
|
31
|
+
); end
|
32
|
+
sig do
|
33
|
+
override
|
34
|
+
.returns(
|
35
|
+
{
|
36
|
+
page_number: T.nilable(Integer),
|
37
|
+
page_size: T.nilable(Integer),
|
38
|
+
request_options: Dodopayments::RequestOptions
|
39
|
+
}
|
40
|
+
)
|
41
|
+
end
|
42
|
+
def to_hash; end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,103 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module Dodopayments
|
4
|
+
module Models
|
5
|
+
class AddonResponse < Dodopayments::Internal::Type::BaseModel
|
6
|
+
# id of the Addon
|
7
|
+
sig { returns(String) }
|
8
|
+
attr_accessor :id
|
9
|
+
|
10
|
+
# Unique identifier for the business to which the addon belongs.
|
11
|
+
sig { returns(String) }
|
12
|
+
attr_accessor :business_id
|
13
|
+
|
14
|
+
# Created time
|
15
|
+
sig { returns(Time) }
|
16
|
+
attr_accessor :created_at
|
17
|
+
|
18
|
+
sig { returns(Dodopayments::Models::Currency::TaggedSymbol) }
|
19
|
+
attr_accessor :currency
|
20
|
+
|
21
|
+
# Name of the Addon
|
22
|
+
sig { returns(String) }
|
23
|
+
attr_accessor :name
|
24
|
+
|
25
|
+
# Amount of the addon
|
26
|
+
sig { returns(Integer) }
|
27
|
+
attr_accessor :price
|
28
|
+
|
29
|
+
# Represents the different categories of taxation applicable to various products
|
30
|
+
# and services.
|
31
|
+
sig { returns(Dodopayments::Models::TaxCategory::TaggedSymbol) }
|
32
|
+
attr_accessor :tax_category
|
33
|
+
|
34
|
+
# Updated time
|
35
|
+
sig { returns(Time) }
|
36
|
+
attr_accessor :updated_at
|
37
|
+
|
38
|
+
# Optional description of the Addon
|
39
|
+
sig { returns(T.nilable(String)) }
|
40
|
+
attr_accessor :description
|
41
|
+
|
42
|
+
# Image of the Addon
|
43
|
+
sig { returns(T.nilable(String)) }
|
44
|
+
attr_accessor :image
|
45
|
+
|
46
|
+
sig do
|
47
|
+
params(
|
48
|
+
id: String,
|
49
|
+
business_id: String,
|
50
|
+
created_at: Time,
|
51
|
+
currency: Dodopayments::Models::Currency::OrSymbol,
|
52
|
+
name: String,
|
53
|
+
price: Integer,
|
54
|
+
tax_category: Dodopayments::Models::TaxCategory::OrSymbol,
|
55
|
+
updated_at: Time,
|
56
|
+
description: T.nilable(String),
|
57
|
+
image: T.nilable(String)
|
58
|
+
)
|
59
|
+
.returns(T.attached_class)
|
60
|
+
end
|
61
|
+
def self.new(
|
62
|
+
# id of the Addon
|
63
|
+
id:,
|
64
|
+
# Unique identifier for the business to which the addon belongs.
|
65
|
+
business_id:,
|
66
|
+
# Created time
|
67
|
+
created_at:,
|
68
|
+
currency:,
|
69
|
+
# Name of the Addon
|
70
|
+
name:,
|
71
|
+
# Amount of the addon
|
72
|
+
price:,
|
73
|
+
# Represents the different categories of taxation applicable to various products
|
74
|
+
# and services.
|
75
|
+
tax_category:,
|
76
|
+
# Updated time
|
77
|
+
updated_at:,
|
78
|
+
# Optional description of the Addon
|
79
|
+
description: nil,
|
80
|
+
# Image of the Addon
|
81
|
+
image: nil
|
82
|
+
); end
|
83
|
+
sig do
|
84
|
+
override
|
85
|
+
.returns(
|
86
|
+
{
|
87
|
+
id: String,
|
88
|
+
business_id: String,
|
89
|
+
created_at: Time,
|
90
|
+
currency: Dodopayments::Models::Currency::TaggedSymbol,
|
91
|
+
name: String,
|
92
|
+
price: Integer,
|
93
|
+
tax_category: Dodopayments::Models::TaxCategory::TaggedSymbol,
|
94
|
+
updated_at: Time,
|
95
|
+
description: T.nilable(String),
|
96
|
+
image: T.nilable(String)
|
97
|
+
}
|
98
|
+
)
|
99
|
+
end
|
100
|
+
def to_hash; end
|
101
|
+
end
|
102
|
+
end
|
103
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module Dodopayments
|
4
|
+
module Models
|
5
|
+
class AddonRetrieveParams < Dodopayments::Internal::Type::BaseModel
|
6
|
+
extend Dodopayments::Internal::Type::RequestParameters::Converter
|
7
|
+
include Dodopayments::Internal::Type::RequestParameters
|
8
|
+
|
9
|
+
sig do
|
10
|
+
params(request_options: T.any(Dodopayments::RequestOptions, Dodopayments::Internal::AnyHash))
|
11
|
+
.returns(T.attached_class)
|
12
|
+
end
|
13
|
+
def self.new(request_options: {}); end
|
14
|
+
|
15
|
+
sig { override.returns({request_options: Dodopayments::RequestOptions}) }
|
16
|
+
def to_hash; end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module Dodopayments
|
4
|
+
module Models
|
5
|
+
class AddonUpdateImagesParams < Dodopayments::Internal::Type::BaseModel
|
6
|
+
extend Dodopayments::Internal::Type::RequestParameters::Converter
|
7
|
+
include Dodopayments::Internal::Type::RequestParameters
|
8
|
+
|
9
|
+
sig do
|
10
|
+
params(request_options: T.any(Dodopayments::RequestOptions, Dodopayments::Internal::AnyHash))
|
11
|
+
.returns(T.attached_class)
|
12
|
+
end
|
13
|
+
def self.new(request_options: {}); end
|
14
|
+
|
15
|
+
sig { override.returns({request_options: Dodopayments::RequestOptions}) }
|
16
|
+
def to_hash; end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module Dodopayments
|
4
|
+
module Models
|
5
|
+
class AddonUpdateImagesResponse < Dodopayments::Internal::Type::BaseModel
|
6
|
+
sig { returns(String) }
|
7
|
+
attr_accessor :image_id
|
8
|
+
|
9
|
+
sig { returns(String) }
|
10
|
+
attr_accessor :url
|
11
|
+
|
12
|
+
sig { params(image_id: String, url: String).returns(T.attached_class) }
|
13
|
+
def self.new(image_id:, url:); end
|
14
|
+
|
15
|
+
sig { override.returns({image_id: String, url: String}) }
|
16
|
+
def to_hash; end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|