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
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9c7b22e5857506ae73a79e9a4f5c8cbd92f03696fcf72f9934b7f70d73b9be99
|
4
|
+
data.tar.gz: 3aba6366092a43c500db25321615514724aa4e0015ca108ec27eb478346acd06
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0bb40b6240681cf2f68f968c3da1b960e782aa9daebe21cc1738730290ebb6aea7100f4aa8ac9b642dd685059dc5c155955984bc2bc1d7fb5c6604cf5e425171
|
7
|
+
data.tar.gz: be7ead7c6dcef10ddcacb9c6c6b46b423ccab46231a8f4ac9794054a0214b5220c69e0829837504be20a20f4214d846a5b0ba2f5c0fbb9ba7ead43e661669e0c
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,30 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 1.20.0 (2025-05-01)
|
4
|
+
|
5
|
+
Full Changelog: [v1.19.0...v1.20.0](https://github.com/dodopayments/dodopayments-ruby/compare/v1.19.0...v1.20.0)
|
6
|
+
|
7
|
+
### Features
|
8
|
+
|
9
|
+
* **api:** added addons ([b7ab9df](https://github.com/dodopayments/dodopayments-ruby/commit/b7ab9dfcffc9113bb89668fac0870241e68ec1f8))
|
10
|
+
* **api:** updated readme example ([7ab77ac](https://github.com/dodopayments/dodopayments-ruby/commit/7ab77ac6b2f2349a0876996b2740d4baeca97f3f))
|
11
|
+
* **api:** updated readme example ([9646785](https://github.com/dodopayments/dodopayments-ruby/commit/964678539575be673521723ef0b41c5b5af85f97))
|
12
|
+
|
13
|
+
|
14
|
+
### Bug Fixes
|
15
|
+
|
16
|
+
* re-exported array and map models should typecheck in steep ([443c685](https://github.com/dodopayments/dodopayments-ruby/commit/443c685afdddc50872c8eddbf7acf37d1bf65402))
|
17
|
+
|
18
|
+
|
19
|
+
### Chores
|
20
|
+
|
21
|
+
* migrate away from deprecated `JSON#fast_generate` ([11a01cc](https://github.com/dodopayments/dodopayments-ruby/commit/11a01ccc3ab39f47c6b13ff359bf4ec99378c40b))
|
22
|
+
|
23
|
+
|
24
|
+
### Documentation
|
25
|
+
|
26
|
+
* **readme:** fix typo ([32dda82](https://github.com/dodopayments/dodopayments-ruby/commit/32dda82d2b0fd01b6bc1c4b19a62a39ecc3f96c1))
|
27
|
+
|
3
28
|
## 1.19.0 (2025-04-30)
|
4
29
|
|
5
30
|
Full Changelog: [v1.18.3...v1.19.0](https://github.com/dodopayments/dodopayments-ruby/compare/v1.18.3...v1.19.0)
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Dodo Payments Ruby API library
|
2
2
|
|
3
|
-
The Dodo Payments Ruby library provides convenient access to the Dodo Payments REST API from any Ruby 3.
|
3
|
+
The Dodo Payments Ruby library provides convenient access to the Dodo Payments REST API from any Ruby 3.2.0+ application.
|
4
4
|
|
5
5
|
It is generated with [Stainless](https://www.stainless.com/).
|
6
6
|
|
@@ -17,7 +17,7 @@ To use this gem, install via Bundler by adding the following to your application
|
|
17
17
|
<!-- x-release-please-start-version -->
|
18
18
|
|
19
19
|
```ruby
|
20
|
-
gem "dodopayments", "~> 1.
|
20
|
+
gem "dodopayments", "~> 1.20.0"
|
21
21
|
```
|
22
22
|
|
23
23
|
<!-- x-release-please-end -->
|
@@ -29,7 +29,7 @@ require "bundler/setup"
|
|
29
29
|
require "dodopayments"
|
30
30
|
|
31
31
|
dodo_payments = Dodopayments::Client.new(
|
32
|
-
|
32
|
+
api_key: "My API Key", # defaults to ENV["DODO_PAYMENTS_API_KEY"]
|
33
33
|
environment: "test_mode" # defaults to "live_mode"
|
34
34
|
)
|
35
35
|
|
@@ -79,7 +79,7 @@ rescue Dodopayments::Errors::APIError => e
|
|
79
79
|
end
|
80
80
|
```
|
81
81
|
|
82
|
-
Error codes are as
|
82
|
+
Error codes are as follows:
|
83
83
|
|
84
84
|
| Cause | Error Type |
|
85
85
|
| ---------------- | -------------------------- |
|
@@ -217,7 +217,7 @@ This package considers improvements to the (non-runtime) `*.rbi` and `*.rbs` typ
|
|
217
217
|
|
218
218
|
## Requirements
|
219
219
|
|
220
|
-
Ruby 3.
|
220
|
+
Ruby 3.2.0 or higher.
|
221
221
|
|
222
222
|
## Contributing
|
223
223
|
|
data/lib/dodopayments/client.rb
CHANGED
@@ -20,9 +20,8 @@ module Dodopayments
|
|
20
20
|
ENVIRONMENTS = {live_mode: "https://live.dodopayments.com", test_mode: "https://test.dodopayments.com"}
|
21
21
|
# rubocop:enable Style/MutableConstant
|
22
22
|
|
23
|
-
# Bearer Token for API authentication
|
24
23
|
# @return [String]
|
25
|
-
attr_reader :
|
24
|
+
attr_reader :api_key
|
26
25
|
|
27
26
|
# @return [Dodopayments::Resources::Payments]
|
28
27
|
attr_reader :payments
|
@@ -66,18 +65,21 @@ module Dodopayments
|
|
66
65
|
# @return [Dodopayments::Resources::Discounts]
|
67
66
|
attr_reader :discounts
|
68
67
|
|
68
|
+
# @return [Dodopayments::Resources::Addons]
|
69
|
+
attr_reader :addons
|
70
|
+
|
69
71
|
# @api private
|
70
72
|
#
|
71
73
|
# @return [Hash{String=>String}]
|
72
74
|
private def auth_headers
|
73
|
-
return {} if @
|
75
|
+
return {} if @api_key.nil?
|
74
76
|
|
75
|
-
{"authorization" => "Bearer #{@
|
77
|
+
{"authorization" => "Bearer #{@api_key}"}
|
76
78
|
end
|
77
79
|
|
78
80
|
# Creates and returns a new client for interacting with the API.
|
79
81
|
#
|
80
|
-
# @param
|
82
|
+
# @param api_key [String, nil] Defaults to `ENV["DODO_PAYMENTS_API_KEY"]`
|
81
83
|
#
|
82
84
|
# @param environment [:live_mode, :test_mode, nil] Specifies the environment to use for the API.
|
83
85
|
#
|
@@ -97,7 +99,7 @@ module Dodopayments
|
|
97
99
|
#
|
98
100
|
# @param max_retry_delay [Float]
|
99
101
|
def initialize(
|
100
|
-
|
102
|
+
api_key: ENV["DODO_PAYMENTS_API_KEY"],
|
101
103
|
environment: nil,
|
102
104
|
base_url: ENV["DODO_PAYMENTS_BASE_URL"],
|
103
105
|
max_retries: Dodopayments::Client::DEFAULT_MAX_RETRIES,
|
@@ -110,11 +112,11 @@ module Dodopayments
|
|
110
112
|
raise ArgumentError.new(message)
|
111
113
|
end
|
112
114
|
|
113
|
-
if
|
114
|
-
raise ArgumentError.new("
|
115
|
+
if api_key.nil?
|
116
|
+
raise ArgumentError.new("api_key is required, and can be set via environ: \"DODO_PAYMENTS_API_KEY\"")
|
115
117
|
end
|
116
118
|
|
117
|
-
@
|
119
|
+
@api_key = api_key.to_s
|
118
120
|
|
119
121
|
super(
|
120
122
|
base_url: base_url,
|
@@ -138,6 +140,7 @@ module Dodopayments
|
|
138
140
|
@products = Dodopayments::Resources::Products.new(client: self)
|
139
141
|
@misc = Dodopayments::Resources::Misc.new(client: self)
|
140
142
|
@discounts = Dodopayments::Resources::Discounts.new(client: self)
|
143
|
+
@addons = Dodopayments::Resources::Addons.new(client: self)
|
141
144
|
end
|
142
145
|
end
|
143
146
|
end
|
@@ -261,7 +261,7 @@ module Dodopayments
|
|
261
261
|
headers["x-stainless-retry-count"] = "0"
|
262
262
|
end
|
263
263
|
|
264
|
-
timeout = opts.fetch(:timeout, @timeout).to_f.clamp(
|
264
|
+
timeout = opts.fetch(:timeout, @timeout).to_f.clamp(0..)
|
265
265
|
unless headers.key?("x-stainless-timeout") || timeout.zero?
|
266
266
|
headers["x-stainless-timeout"] = timeout.to_s
|
267
267
|
end
|
@@ -493,7 +493,7 @@ module Dodopayments
|
|
493
493
|
y << val.to_s
|
494
494
|
else
|
495
495
|
y << "Content-Type: application/json\r\n\r\n"
|
496
|
-
y << JSON.
|
496
|
+
y << JSON.generate(val)
|
497
497
|
end
|
498
498
|
y << "\r\n"
|
499
499
|
end
|
@@ -570,9 +570,9 @@ module Dodopayments
|
|
570
570
|
content_type = headers["content-type"]
|
571
571
|
case [content_type, body]
|
572
572
|
in [Dodopayments::Internal::Util::JSON_CONTENT, Hash | Array | -> { primitive?(_1) }]
|
573
|
-
[headers, JSON.
|
573
|
+
[headers, JSON.generate(body)]
|
574
574
|
in [Dodopayments::Internal::Util::JSONL_CONTENT, Enumerable] unless body.is_a?(Dodopayments::Internal::Type::FileInput)
|
575
|
-
[headers, body.lazy.map { JSON.
|
575
|
+
[headers, body.lazy.map { JSON.generate(_1) }]
|
576
576
|
in [%r{^multipart/form-data}, Hash | Dodopayments::Internal::Type::FileInput]
|
577
577
|
boundary, strio = encode_multipart_streaming(body)
|
578
578
|
headers = {**headers, "content-type" => "#{content_type}; boundary=#{boundary}"}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Dodopayments
|
4
|
+
module Models
|
5
|
+
class AddonCartResponseItem < Dodopayments::Internal::Type::BaseModel
|
6
|
+
# @!attribute addon_id
|
7
|
+
#
|
8
|
+
# @return [String]
|
9
|
+
required :addon_id, String
|
10
|
+
|
11
|
+
# @!attribute quantity
|
12
|
+
#
|
13
|
+
# @return [Integer]
|
14
|
+
required :quantity, Integer
|
15
|
+
|
16
|
+
# @!method initialize(addon_id:, quantity:)
|
17
|
+
# Response struct representing subscription details
|
18
|
+
#
|
19
|
+
# @param addon_id [String]
|
20
|
+
# @param quantity [Integer]
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Dodopayments
|
4
|
+
module Models
|
5
|
+
# @see Dodopayments::Resources::Addons#create
|
6
|
+
class AddonCreateParams < Dodopayments::Internal::Type::BaseModel
|
7
|
+
extend Dodopayments::Internal::Type::RequestParameters::Converter
|
8
|
+
include Dodopayments::Internal::Type::RequestParameters
|
9
|
+
|
10
|
+
# @!attribute currency
|
11
|
+
#
|
12
|
+
# @return [Symbol, Dodopayments::Models::Currency]
|
13
|
+
required :currency, enum: -> { Dodopayments::Models::Currency }
|
14
|
+
|
15
|
+
# @!attribute name
|
16
|
+
# Name of the Addon
|
17
|
+
#
|
18
|
+
# @return [String]
|
19
|
+
required :name, String
|
20
|
+
|
21
|
+
# @!attribute price
|
22
|
+
# Amount of the addon
|
23
|
+
#
|
24
|
+
# @return [Integer]
|
25
|
+
required :price, Integer
|
26
|
+
|
27
|
+
# @!attribute tax_category
|
28
|
+
# Represents the different categories of taxation applicable to various products
|
29
|
+
# and services.
|
30
|
+
#
|
31
|
+
# @return [Symbol, Dodopayments::Models::TaxCategory]
|
32
|
+
required :tax_category, enum: -> { Dodopayments::Models::TaxCategory }
|
33
|
+
|
34
|
+
# @!attribute description
|
35
|
+
# Optional description of the Addon
|
36
|
+
#
|
37
|
+
# @return [String, nil]
|
38
|
+
optional :description, String, nil?: true
|
39
|
+
|
40
|
+
# @!method initialize(currency:, name:, price:, tax_category:, description: nil, request_options: {})
|
41
|
+
# Some parameter documentations has been truncated, see
|
42
|
+
# {Dodopayments::Models::AddonCreateParams} for more details.
|
43
|
+
#
|
44
|
+
# @param currency [Symbol, Dodopayments::Models::Currency]
|
45
|
+
#
|
46
|
+
# @param name [String] Name of the Addon
|
47
|
+
#
|
48
|
+
# @param price [Integer] Amount of the addon
|
49
|
+
#
|
50
|
+
# @param tax_category [Symbol, Dodopayments::Models::TaxCategory] Represents the different categories of taxation applicable to various products a
|
51
|
+
# ...
|
52
|
+
#
|
53
|
+
# @param description [String, nil] Optional description of the Addon
|
54
|
+
#
|
55
|
+
# @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Dodopayments
|
4
|
+
module Models
|
5
|
+
# @see Dodopayments::Resources::Addons#list
|
6
|
+
class AddonListParams < Dodopayments::Internal::Type::BaseModel
|
7
|
+
extend Dodopayments::Internal::Type::RequestParameters::Converter
|
8
|
+
include Dodopayments::Internal::Type::RequestParameters
|
9
|
+
|
10
|
+
# @!attribute page_number
|
11
|
+
# Page number default is 0
|
12
|
+
#
|
13
|
+
# @return [Integer, nil]
|
14
|
+
optional :page_number, Integer, nil?: true
|
15
|
+
|
16
|
+
# @!attribute page_size
|
17
|
+
# Page size default is 10 max is 100
|
18
|
+
#
|
19
|
+
# @return [Integer, nil]
|
20
|
+
optional :page_size, Integer, nil?: true
|
21
|
+
|
22
|
+
# @!method initialize(page_number: nil, page_size: nil, request_options: {})
|
23
|
+
# @param page_number [Integer, nil] Page number default is 0
|
24
|
+
#
|
25
|
+
# @param page_size [Integer, nil] Page size default is 10 max is 100
|
26
|
+
#
|
27
|
+
# @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,93 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Dodopayments
|
4
|
+
module Models
|
5
|
+
# @see Dodopayments::Resources::Addons#create
|
6
|
+
class AddonResponse < Dodopayments::Internal::Type::BaseModel
|
7
|
+
# @!attribute id
|
8
|
+
# id of the Addon
|
9
|
+
#
|
10
|
+
# @return [String]
|
11
|
+
required :id, String
|
12
|
+
|
13
|
+
# @!attribute business_id
|
14
|
+
# Unique identifier for the business to which the addon belongs.
|
15
|
+
#
|
16
|
+
# @return [String]
|
17
|
+
required :business_id, String
|
18
|
+
|
19
|
+
# @!attribute created_at
|
20
|
+
# Created time
|
21
|
+
#
|
22
|
+
# @return [Time]
|
23
|
+
required :created_at, Time
|
24
|
+
|
25
|
+
# @!attribute currency
|
26
|
+
#
|
27
|
+
# @return [Symbol, Dodopayments::Models::Currency]
|
28
|
+
required :currency, enum: -> { Dodopayments::Models::Currency }
|
29
|
+
|
30
|
+
# @!attribute name
|
31
|
+
# Name of the Addon
|
32
|
+
#
|
33
|
+
# @return [String]
|
34
|
+
required :name, String
|
35
|
+
|
36
|
+
# @!attribute price
|
37
|
+
# Amount of the addon
|
38
|
+
#
|
39
|
+
# @return [Integer]
|
40
|
+
required :price, Integer
|
41
|
+
|
42
|
+
# @!attribute tax_category
|
43
|
+
# Represents the different categories of taxation applicable to various products
|
44
|
+
# and services.
|
45
|
+
#
|
46
|
+
# @return [Symbol, Dodopayments::Models::TaxCategory]
|
47
|
+
required :tax_category, enum: -> { Dodopayments::Models::TaxCategory }
|
48
|
+
|
49
|
+
# @!attribute updated_at
|
50
|
+
# Updated time
|
51
|
+
#
|
52
|
+
# @return [Time]
|
53
|
+
required :updated_at, Time
|
54
|
+
|
55
|
+
# @!attribute description
|
56
|
+
# Optional description of the Addon
|
57
|
+
#
|
58
|
+
# @return [String, nil]
|
59
|
+
optional :description, String, nil?: true
|
60
|
+
|
61
|
+
# @!attribute image
|
62
|
+
# Image of the Addon
|
63
|
+
#
|
64
|
+
# @return [String, nil]
|
65
|
+
optional :image, String, nil?: true
|
66
|
+
|
67
|
+
# @!method initialize(id:, business_id:, created_at:, currency:, name:, price:, tax_category:, updated_at:, description: nil, image: nil)
|
68
|
+
# Some parameter documentations has been truncated, see
|
69
|
+
# {Dodopayments::Models::AddonResponse} for more details.
|
70
|
+
#
|
71
|
+
# @param id [String] id of the Addon
|
72
|
+
#
|
73
|
+
# @param business_id [String] Unique identifier for the business to which the addon belongs.
|
74
|
+
#
|
75
|
+
# @param created_at [Time] Created time
|
76
|
+
#
|
77
|
+
# @param currency [Symbol, Dodopayments::Models::Currency]
|
78
|
+
#
|
79
|
+
# @param name [String] Name of the Addon
|
80
|
+
#
|
81
|
+
# @param price [Integer] Amount of the addon
|
82
|
+
#
|
83
|
+
# @param tax_category [Symbol, Dodopayments::Models::TaxCategory] Represents the different categories of taxation applicable to various products a
|
84
|
+
# ...
|
85
|
+
#
|
86
|
+
# @param updated_at [Time] Updated time
|
87
|
+
#
|
88
|
+
# @param description [String, nil] Optional description of the Addon
|
89
|
+
#
|
90
|
+
# @param image [String, nil] Image of the Addon
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Dodopayments
|
4
|
+
module Models
|
5
|
+
# @see Dodopayments::Resources::Addons#retrieve
|
6
|
+
class AddonRetrieveParams < Dodopayments::Internal::Type::BaseModel
|
7
|
+
extend Dodopayments::Internal::Type::RequestParameters::Converter
|
8
|
+
include Dodopayments::Internal::Type::RequestParameters
|
9
|
+
|
10
|
+
# @!method initialize(request_options: {})
|
11
|
+
# @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Dodopayments
|
4
|
+
module Models
|
5
|
+
# @see Dodopayments::Resources::Addons#update_images
|
6
|
+
class AddonUpdateImagesParams < Dodopayments::Internal::Type::BaseModel
|
7
|
+
extend Dodopayments::Internal::Type::RequestParameters::Converter
|
8
|
+
include Dodopayments::Internal::Type::RequestParameters
|
9
|
+
|
10
|
+
# @!method initialize(request_options: {})
|
11
|
+
# @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Dodopayments
|
4
|
+
module Models
|
5
|
+
# @see Dodopayments::Resources::Addons#update_images
|
6
|
+
class AddonUpdateImagesResponse < Dodopayments::Internal::Type::BaseModel
|
7
|
+
# @!attribute image_id
|
8
|
+
#
|
9
|
+
# @return [String]
|
10
|
+
required :image_id, String
|
11
|
+
|
12
|
+
# @!attribute url
|
13
|
+
#
|
14
|
+
# @return [String]
|
15
|
+
required :url, String
|
16
|
+
|
17
|
+
# @!method initialize(image_id:, url:)
|
18
|
+
# @param image_id [String]
|
19
|
+
# @param url [String]
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,66 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Dodopayments
|
4
|
+
module Models
|
5
|
+
# @see Dodopayments::Resources::Addons#update
|
6
|
+
class AddonUpdateParams < Dodopayments::Internal::Type::BaseModel
|
7
|
+
extend Dodopayments::Internal::Type::RequestParameters::Converter
|
8
|
+
include Dodopayments::Internal::Type::RequestParameters
|
9
|
+
|
10
|
+
# @!attribute currency
|
11
|
+
#
|
12
|
+
# @return [Symbol, Dodopayments::Models::Currency, nil]
|
13
|
+
optional :currency, enum: -> { Dodopayments::Models::Currency }, nil?: true
|
14
|
+
|
15
|
+
# @!attribute description
|
16
|
+
# Description of the Addon, optional and must be at most 1000 characters.
|
17
|
+
#
|
18
|
+
# @return [String, nil]
|
19
|
+
optional :description, String, nil?: true
|
20
|
+
|
21
|
+
# @!attribute image_id
|
22
|
+
# Addon image id after its uploaded to S3
|
23
|
+
#
|
24
|
+
# @return [String, nil]
|
25
|
+
optional :image_id, String, nil?: true
|
26
|
+
|
27
|
+
# @!attribute name
|
28
|
+
# Name of the Addon, optional and must be at most 100 characters.
|
29
|
+
#
|
30
|
+
# @return [String, nil]
|
31
|
+
optional :name, String, nil?: true
|
32
|
+
|
33
|
+
# @!attribute price
|
34
|
+
# Amount of the addon
|
35
|
+
#
|
36
|
+
# @return [Integer, nil]
|
37
|
+
optional :price, Integer, nil?: true
|
38
|
+
|
39
|
+
# @!attribute tax_category
|
40
|
+
# Represents the different categories of taxation applicable to various products
|
41
|
+
# and services.
|
42
|
+
#
|
43
|
+
# @return [Symbol, Dodopayments::Models::TaxCategory, nil]
|
44
|
+
optional :tax_category, enum: -> { Dodopayments::Models::TaxCategory }, nil?: true
|
45
|
+
|
46
|
+
# @!method initialize(currency: nil, description: nil, image_id: nil, name: nil, price: nil, tax_category: nil, request_options: {})
|
47
|
+
# Some parameter documentations has been truncated, see
|
48
|
+
# {Dodopayments::Models::AddonUpdateParams} for more details.
|
49
|
+
#
|
50
|
+
# @param currency [Symbol, Dodopayments::Models::Currency, nil]
|
51
|
+
#
|
52
|
+
# @param description [String, nil] Description of the Addon, optional and must be at most 1000 characters.
|
53
|
+
#
|
54
|
+
# @param image_id [String, nil] Addon image id after its uploaded to S3
|
55
|
+
#
|
56
|
+
# @param name [String, nil] Name of the Addon, optional and must be at most 100 characters.
|
57
|
+
#
|
58
|
+
# @param price [Integer, nil] Amount of the addon
|
59
|
+
#
|
60
|
+
# @param tax_category [Symbol, Dodopayments::Models::TaxCategory, nil] Represents the different categories of taxation applicable to various products a
|
61
|
+
# ...
|
62
|
+
#
|
63
|
+
# @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
@@ -0,0 +1,158 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Dodopayments
|
4
|
+
module Models
|
5
|
+
module Currency
|
6
|
+
extend Dodopayments::Internal::Type::Enum
|
7
|
+
|
8
|
+
AED = :AED
|
9
|
+
ALL = :ALL
|
10
|
+
AMD = :AMD
|
11
|
+
ANG = :ANG
|
12
|
+
AOA = :AOA
|
13
|
+
ARS = :ARS
|
14
|
+
AUD = :AUD
|
15
|
+
AWG = :AWG
|
16
|
+
AZN = :AZN
|
17
|
+
BAM = :BAM
|
18
|
+
BBD = :BBD
|
19
|
+
BDT = :BDT
|
20
|
+
BGN = :BGN
|
21
|
+
BHD = :BHD
|
22
|
+
BIF = :BIF
|
23
|
+
BMD = :BMD
|
24
|
+
BND = :BND
|
25
|
+
BOB = :BOB
|
26
|
+
BRL = :BRL
|
27
|
+
BSD = :BSD
|
28
|
+
BWP = :BWP
|
29
|
+
BYN = :BYN
|
30
|
+
BZD = :BZD
|
31
|
+
CAD = :CAD
|
32
|
+
CHF = :CHF
|
33
|
+
CLP = :CLP
|
34
|
+
CNY = :CNY
|
35
|
+
COP = :COP
|
36
|
+
CRC = :CRC
|
37
|
+
CUP = :CUP
|
38
|
+
CVE = :CVE
|
39
|
+
CZK = :CZK
|
40
|
+
DJF = :DJF
|
41
|
+
DKK = :DKK
|
42
|
+
DOP = :DOP
|
43
|
+
DZD = :DZD
|
44
|
+
EGP = :EGP
|
45
|
+
ETB = :ETB
|
46
|
+
EUR = :EUR
|
47
|
+
FJD = :FJD
|
48
|
+
FKP = :FKP
|
49
|
+
GBP = :GBP
|
50
|
+
GEL = :GEL
|
51
|
+
GHS = :GHS
|
52
|
+
GIP = :GIP
|
53
|
+
GMD = :GMD
|
54
|
+
GNF = :GNF
|
55
|
+
GTQ = :GTQ
|
56
|
+
GYD = :GYD
|
57
|
+
HKD = :HKD
|
58
|
+
HNL = :HNL
|
59
|
+
HRK = :HRK
|
60
|
+
HTG = :HTG
|
61
|
+
HUF = :HUF
|
62
|
+
IDR = :IDR
|
63
|
+
ILS = :ILS
|
64
|
+
INR = :INR
|
65
|
+
IQD = :IQD
|
66
|
+
JMD = :JMD
|
67
|
+
JOD = :JOD
|
68
|
+
JPY = :JPY
|
69
|
+
KES = :KES
|
70
|
+
KGS = :KGS
|
71
|
+
KHR = :KHR
|
72
|
+
KMF = :KMF
|
73
|
+
KRW = :KRW
|
74
|
+
KWD = :KWD
|
75
|
+
KYD = :KYD
|
76
|
+
KZT = :KZT
|
77
|
+
LAK = :LAK
|
78
|
+
LBP = :LBP
|
79
|
+
LKR = :LKR
|
80
|
+
LRD = :LRD
|
81
|
+
LSL = :LSL
|
82
|
+
LYD = :LYD
|
83
|
+
MAD = :MAD
|
84
|
+
MDL = :MDL
|
85
|
+
MGA = :MGA
|
86
|
+
MKD = :MKD
|
87
|
+
MMK = :MMK
|
88
|
+
MNT = :MNT
|
89
|
+
MOP = :MOP
|
90
|
+
MRU = :MRU
|
91
|
+
MUR = :MUR
|
92
|
+
MVR = :MVR
|
93
|
+
MWK = :MWK
|
94
|
+
MXN = :MXN
|
95
|
+
MYR = :MYR
|
96
|
+
MZN = :MZN
|
97
|
+
NAD = :NAD
|
98
|
+
NGN = :NGN
|
99
|
+
NIO = :NIO
|
100
|
+
NOK = :NOK
|
101
|
+
NPR = :NPR
|
102
|
+
NZD = :NZD
|
103
|
+
OMR = :OMR
|
104
|
+
PAB = :PAB
|
105
|
+
PEN = :PEN
|
106
|
+
PGK = :PGK
|
107
|
+
PHP = :PHP
|
108
|
+
PKR = :PKR
|
109
|
+
PLN = :PLN
|
110
|
+
PYG = :PYG
|
111
|
+
QAR = :QAR
|
112
|
+
RON = :RON
|
113
|
+
RSD = :RSD
|
114
|
+
RUB = :RUB
|
115
|
+
RWF = :RWF
|
116
|
+
SAR = :SAR
|
117
|
+
SBD = :SBD
|
118
|
+
SCR = :SCR
|
119
|
+
SEK = :SEK
|
120
|
+
SGD = :SGD
|
121
|
+
SHP = :SHP
|
122
|
+
SLE = :SLE
|
123
|
+
SLL = :SLL
|
124
|
+
SOS = :SOS
|
125
|
+
SRD = :SRD
|
126
|
+
SSP = :SSP
|
127
|
+
STN = :STN
|
128
|
+
SVC = :SVC
|
129
|
+
SZL = :SZL
|
130
|
+
THB = :THB
|
131
|
+
TND = :TND
|
132
|
+
TOP = :TOP
|
133
|
+
TRY = :TRY
|
134
|
+
TTD = :TTD
|
135
|
+
TWD = :TWD
|
136
|
+
TZS = :TZS
|
137
|
+
UAH = :UAH
|
138
|
+
UGX = :UGX
|
139
|
+
USD = :USD
|
140
|
+
UYU = :UYU
|
141
|
+
UZS = :UZS
|
142
|
+
VES = :VES
|
143
|
+
VND = :VND
|
144
|
+
VUV = :VUV
|
145
|
+
WST = :WST
|
146
|
+
XAF = :XAF
|
147
|
+
XCD = :XCD
|
148
|
+
XOF = :XOF
|
149
|
+
XPF = :XPF
|
150
|
+
YER = :YER
|
151
|
+
ZAR = :ZAR
|
152
|
+
ZMW = :ZMW
|
153
|
+
|
154
|
+
# @!method self.values
|
155
|
+
# @return [Array<Symbol>]
|
156
|
+
end
|
157
|
+
end
|
158
|
+
end
|