dodopayments 2.10.0 → 2.11.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 +10 -0
- data/README.md +9 -9
- data/lib/dodopayments/client.rb +4 -0
- data/lib/dodopayments/models/checkout_session_flags.rb +15 -1
- data/lib/dodopayments/models/checkout_session_request.rb +11 -1
- data/lib/dodopayments/models/checkout_session_response.rb +33 -1
- data/lib/dodopayments/models/discount_detail.rb +143 -0
- data/lib/dodopayments/models/filter_type.rb +71 -0
- data/lib/dodopayments/models/github_permission.rb +19 -0
- data/lib/dodopayments/models/integration_config.rb +3 -19
- data/lib/dodopayments/models/integration_config_response.rb +3 -19
- data/lib/dodopayments/models/invoices/payment_retrieve_payout_params.rb +22 -0
- data/lib/dodopayments/models/meter_filter.rb +3 -331
- data/lib/dodopayments/models/payment.rb +3 -141
- data/lib/dodopayments/models/payment_create_params.rb +11 -1
- data/lib/dodopayments/models/payment_method_types.rb +1 -0
- data/lib/dodopayments/models/product_collection.rb +74 -0
- data/lib/dodopayments/models/product_collection_create_params.rb +47 -0
- data/lib/dodopayments/models/product_collection_delete_params.rb +20 -0
- data/lib/dodopayments/models/product_collection_list_params.rb +46 -0
- data/lib/dodopayments/models/product_collection_list_response.rb +65 -0
- data/lib/dodopayments/models/product_collection_retrieve_params.rb +20 -0
- data/lib/dodopayments/models/product_collection_unarchive_params.rb +20 -0
- data/lib/dodopayments/models/product_collection_unarchive_response.rb +33 -0
- data/lib/dodopayments/models/product_collection_update_images_params.rb +29 -0
- data/lib/dodopayments/models/product_collection_update_images_response.rb +25 -0
- data/lib/dodopayments/models/product_collection_update_params.rb +61 -0
- data/lib/dodopayments/models/product_collections/group_create_params.rb +22 -0
- data/lib/dodopayments/models/product_collections/group_delete_params.rb +28 -0
- data/lib/dodopayments/models/product_collections/group_product.rb +26 -0
- data/lib/dodopayments/models/product_collections/group_update_params.rb +59 -0
- data/lib/dodopayments/models/product_collections/groups/item_create_params.rb +41 -0
- data/lib/dodopayments/models/product_collections/groups/item_create_response.rb +15 -0
- data/lib/dodopayments/models/product_collections/groups/item_delete_params.rb +36 -0
- data/lib/dodopayments/models/product_collections/groups/item_update_params.rb +47 -0
- data/lib/dodopayments/models/product_collections/groups/product_collection_product.rb +132 -0
- data/lib/dodopayments/models/product_collections/product_collection_group_details.rb +42 -0
- data/lib/dodopayments/models/product_collections/product_collection_group_response.rb +39 -0
- data/lib/dodopayments/models/subscription.rb +13 -142
- data/lib/dodopayments/models/subscription_create_params.rb +11 -1
- data/lib/dodopayments/models/subscription_list_response.rb +10 -1
- data/lib/dodopayments/models/subscription_update_params.rb +12 -1
- data/lib/dodopayments/models/subscription_update_payment_method_params.rb +9 -9
- data/lib/dodopayments/models/webhook_event_type.rb +1 -5
- data/lib/dodopayments/models.rb +24 -0
- data/lib/dodopayments/resources/checkout_sessions.rb +6 -2
- data/lib/dodopayments/resources/invoices/payments.rb +18 -0
- data/lib/dodopayments/resources/payments.rb +3 -1
- data/lib/dodopayments/resources/product_collections/groups/items.rb +111 -0
- data/lib/dodopayments/resources/product_collections/groups.rb +109 -0
- data/lib/dodopayments/resources/product_collections.rb +179 -0
- data/lib/dodopayments/resources/subscriptions.rb +9 -5
- data/lib/dodopayments/version.rb +1 -1
- data/lib/dodopayments.rb +29 -0
- data/rbi/dodopayments/client.rbi +3 -0
- data/rbi/dodopayments/models/checkout_session_flags.rbi +23 -0
- data/rbi/dodopayments/models/checkout_session_request.rbi +12 -0
- data/rbi/dodopayments/models/checkout_session_response.rbi +43 -5
- data/rbi/dodopayments/models/discount_detail.rbi +161 -0
- data/rbi/dodopayments/models/filter_type.rbi +112 -0
- data/rbi/dodopayments/models/github_permission.rbi +26 -0
- data/rbi/dodopayments/models/integration_config.rbi +3 -59
- data/rbi/dodopayments/models/integration_config_response.rbi +3 -59
- data/rbi/dodopayments/models/invoices/payment_retrieve_payout_params.rbi +40 -0
- data/rbi/dodopayments/models/meter_filter.rbi +3 -572
- data/rbi/dodopayments/models/payment.rbi +3 -163
- data/rbi/dodopayments/models/payment_create_params.rbi +12 -0
- data/rbi/dodopayments/models/payment_method_types.rbi +1 -0
- data/rbi/dodopayments/models/product_collection.rbi +108 -0
- data/rbi/dodopayments/models/product_collection_create_params.rbi +82 -0
- data/rbi/dodopayments/models/product_collection_delete_params.rbi +38 -0
- data/rbi/dodopayments/models/product_collection_list_params.rbi +82 -0
- data/rbi/dodopayments/models/product_collection_list_response.rbi +88 -0
- data/rbi/dodopayments/models/product_collection_retrieve_params.rbi +38 -0
- data/rbi/dodopayments/models/product_collection_unarchive_params.rbi +38 -0
- data/rbi/dodopayments/models/product_collection_unarchive_response.rbi +56 -0
- data/rbi/dodopayments/models/product_collection_update_images_params.rbi +52 -0
- data/rbi/dodopayments/models/product_collection_update_images_response.rbi +40 -0
- data/rbi/dodopayments/models/product_collection_update_params.rbi +84 -0
- data/rbi/dodopayments/models/product_collections/group_create_params.rbi +40 -0
- data/rbi/dodopayments/models/product_collections/group_delete_params.rbi +48 -0
- data/rbi/dodopayments/models/product_collections/group_product.rbi +46 -0
- data/rbi/dodopayments/models/product_collections/group_update_params.rbi +80 -0
- data/rbi/dodopayments/models/product_collections/groups/item_create_params.rbi +68 -0
- data/rbi/dodopayments/models/product_collections/groups/item_create_response.rbi +17 -0
- data/rbi/dodopayments/models/product_collections/groups/item_delete_params.rbi +55 -0
- data/rbi/dodopayments/models/product_collections/groups/item_update_params.rbi +68 -0
- data/rbi/dodopayments/models/product_collections/groups/product_collection_product.rbi +148 -0
- data/rbi/dodopayments/models/product_collections/product_collection_group_details.rbi +67 -0
- data/rbi/dodopayments/models/product_collections/product_collection_group_response.rbi +68 -0
- data/rbi/dodopayments/models/subscription.rbi +13 -164
- data/rbi/dodopayments/models/subscription_create_params.rbi +12 -0
- data/rbi/dodopayments/models/subscription_list_response.rbi +10 -0
- data/rbi/dodopayments/models/subscription_update_params.rbi +14 -0
- data/rbi/dodopayments/models/subscription_update_payment_method_params.rbi +16 -16
- data/rbi/dodopayments/models/webhook_event_type.rbi +4 -18
- data/rbi/dodopayments/models.rbi +31 -0
- data/rbi/dodopayments/resources/checkout_sessions.rbi +10 -0
- data/rbi/dodopayments/resources/invoices/payments.rbi +9 -0
- data/rbi/dodopayments/resources/payments.rbi +5 -0
- data/rbi/dodopayments/resources/product_collections/groups/items.rbi +83 -0
- data/rbi/dodopayments/resources/product_collections/groups.rbi +88 -0
- data/rbi/dodopayments/resources/product_collections.rbi +149 -0
- data/rbi/dodopayments/resources/subscriptions.rbi +15 -4
- data/sig/dodopayments/client.rbs +2 -0
- data/sig/dodopayments/models/checkout_session_flags.rbs +7 -0
- data/sig/dodopayments/models/checkout_session_request.rbs +5 -0
- data/sig/dodopayments/models/checkout_session_response.rbs +27 -3
- data/sig/dodopayments/models/discount_detail.rbs +95 -0
- data/sig/dodopayments/models/filter_type.rbs +52 -0
- data/sig/dodopayments/models/github_permission.rbs +17 -0
- data/sig/dodopayments/models/integration_config.rbs +4 -18
- data/sig/dodopayments/models/integration_config_response.rbs +4 -18
- data/sig/dodopayments/models/invoices/payment_retrieve_payout_params.rbs +25 -0
- data/sig/dodopayments/models/meter_filter.rbs +4 -252
- data/sig/dodopayments/models/payment.rbs +4 -96
- data/sig/dodopayments/models/payment_create_params.rbs +5 -0
- data/sig/dodopayments/models/payment_method_types.rbs +2 -0
- data/sig/dodopayments/models/product_collection.rbs +55 -0
- data/sig/dodopayments/models/product_collection_create_params.rbs +41 -0
- data/sig/dodopayments/models/product_collection_delete_params.rbs +23 -0
- data/sig/dodopayments/models/product_collection_list_params.rbs +49 -0
- data/sig/dodopayments/models/product_collection_list_response.rbs +50 -0
- data/sig/dodopayments/models/product_collection_retrieve_params.rbs +23 -0
- data/sig/dodopayments/models/product_collection_unarchive_params.rbs +23 -0
- data/sig/dodopayments/models/product_collection_unarchive_response.rbs +30 -0
- data/sig/dodopayments/models/product_collection_update_images_params.rbs +28 -0
- data/sig/dodopayments/models/product_collection_update_images_response.rbs +16 -0
- data/sig/dodopayments/models/product_collection_update_params.rbs +51 -0
- data/sig/dodopayments/models/product_collections/group_create_params.rbs +27 -0
- data/sig/dodopayments/models/product_collections/group_delete_params.rbs +30 -0
- data/sig/dodopayments/models/product_collections/group_product.rbs +17 -0
- data/sig/dodopayments/models/product_collections/group_update_params.rbs +48 -0
- data/sig/dodopayments/models/product_collections/groups/item_create_params.rbs +40 -0
- data/sig/dodopayments/models/product_collections/groups/item_create_response.rbs +12 -0
- data/sig/dodopayments/models/product_collections/groups/item_delete_params.rbs +36 -0
- data/sig/dodopayments/models/product_collections/groups/item_update_params.rbs +40 -0
- data/sig/dodopayments/models/product_collections/groups/product_collection_product.rbs +99 -0
- data/sig/dodopayments/models/product_collections/product_collection_group_details.rbs +34 -0
- data/sig/dodopayments/models/product_collections/product_collection_group_response.rbs +39 -0
- data/sig/dodopayments/models/subscription.rbs +9 -96
- data/sig/dodopayments/models/subscription_create_params.rbs +5 -0
- data/sig/dodopayments/models/subscription_list_response.rbs +5 -0
- data/sig/dodopayments/models/subscription_update_params.rbs +5 -0
- data/sig/dodopayments/models/subscription_update_payment_method_params.rbs +9 -9
- data/sig/dodopayments/models/webhook_event_type.rbs +2 -10
- data/sig/dodopayments/models.rbs +24 -0
- data/sig/dodopayments/resources/checkout_sessions.rbs +2 -0
- data/sig/dodopayments/resources/invoices/payments.rbs +5 -0
- data/sig/dodopayments/resources/payments.rbs +1 -0
- data/sig/dodopayments/resources/product_collections/groups/items.rbs +33 -0
- data/sig/dodopayments/resources/product_collections/groups.rbs +34 -0
- data/sig/dodopayments/resources/product_collections.rbs +56 -0
- data/sig/dodopayments/resources/subscriptions.rbs +3 -1
- metadata +89 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 37a5895dd2b5d696adb46dd626413dbbf90366649cc8dbc064f551fa9c479cfd
|
|
4
|
+
data.tar.gz: 7a0d7cc47bf89c6de92c1018078438c8209a8bdb16f72c746f867e48a868f2f2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4081412b2c3f6a61b73f4b9f5fe0aa570250e523cb0675f39a5d6ef242e66a086ca4b0b0a3546b607a1e8bc0d51e5fb267a4330b66d309a90f076f1267347973
|
|
7
|
+
data.tar.gz: 81c5473276481eff28bb2a62757133119f160a7c83abce993662a0073d90807f85a12cc3e2edd29117b9befb1944fabfa0b7a6d8b629ab0f22a3220ab58588ff
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.11.0 (2026-05-21)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v2.10.0...v2.11.0](https://github.com/dodopayments/dodopayments-ruby/compare/v2.10.0...v2.11.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** fixed a breaking modal change ([ca90fef](https://github.com/dodopayments/dodopayments-ruby/commit/ca90fef9200c68c0686261728a7d1add4820cdb5))
|
|
10
|
+
* **api:** stainless fixes ([3b16e3f](https://github.com/dodopayments/dodopayments-ruby/commit/3b16e3f755914b312d060f705631c8e5f172beb7))
|
|
11
|
+
* **api:** updated openapi spec to v1.99.0 and added missing endpoints as well ([11e4b50](https://github.com/dodopayments/dodopayments-ruby/commit/11e4b50fb9a96cad609583025a02490e58677296))
|
|
12
|
+
|
|
3
13
|
## 2.10.0 (2026-05-14)
|
|
4
14
|
|
|
5
15
|
Full Changelog: [v2.9.1...v2.10.0](https://github.com/dodopayments/dodopayments-ruby/compare/v2.9.1...v2.10.0)
|
data/README.md
CHANGED
|
@@ -26,7 +26,7 @@ To use this gem, install via Bundler by adding the following to your application
|
|
|
26
26
|
<!-- x-release-please-start-version -->
|
|
27
27
|
|
|
28
28
|
```ruby
|
|
29
|
-
gem "dodopayments", "~> 2.
|
|
29
|
+
gem "dodopayments", "~> 2.11.0"
|
|
30
30
|
```
|
|
31
31
|
|
|
32
32
|
<!-- x-release-please-end -->
|
|
@@ -42,7 +42,7 @@ dodo_payments = Dodopayments::Client.new(
|
|
|
42
42
|
environment: "test_mode" # defaults to "live_mode"
|
|
43
43
|
)
|
|
44
44
|
|
|
45
|
-
checkout_session_response = dodo_payments.checkout_sessions.create(product_cart: [{product_id: "
|
|
45
|
+
checkout_session_response = dodo_payments.checkout_sessions.create(product_cart: [{product_id: "pdt_example", quantity: 1}])
|
|
46
46
|
|
|
47
47
|
puts(checkout_session_response.session_id)
|
|
48
48
|
```
|
|
@@ -81,7 +81,7 @@ When the library is unable to connect to the API, or if the API returns a non-su
|
|
|
81
81
|
|
|
82
82
|
```ruby
|
|
83
83
|
begin
|
|
84
|
-
checkout_session = dodo_payments.checkout_sessions.create(product_cart: [{product_id: "
|
|
84
|
+
checkout_session = dodo_payments.checkout_sessions.create(product_cart: [{product_id: "pdt_example", quantity: 1}])
|
|
85
85
|
rescue Dodopayments::Errors::APIConnectionError => e
|
|
86
86
|
puts("The server could not be reached")
|
|
87
87
|
puts(e.cause) # an underlying Exception, likely raised within `net/http`
|
|
@@ -125,7 +125,7 @@ dodo_payments = Dodopayments::Client.new(
|
|
|
125
125
|
|
|
126
126
|
# Or, configure per-request:
|
|
127
127
|
dodo_payments.checkout_sessions.create(
|
|
128
|
-
product_cart: [{product_id: "
|
|
128
|
+
product_cart: [{product_id: "pdt_example", quantity: 1}],
|
|
129
129
|
request_options: {max_retries: 5}
|
|
130
130
|
)
|
|
131
131
|
```
|
|
@@ -142,7 +142,7 @@ dodo_payments = Dodopayments::Client.new(
|
|
|
142
142
|
|
|
143
143
|
# Or, configure per-request:
|
|
144
144
|
dodo_payments.checkout_sessions.create(
|
|
145
|
-
product_cart: [{product_id: "
|
|
145
|
+
product_cart: [{product_id: "pdt_example", quantity: 1}],
|
|
146
146
|
request_options: {timeout: 5}
|
|
147
147
|
)
|
|
148
148
|
```
|
|
@@ -176,7 +176,7 @@ Note: the `extra_` parameters of the same name overrides the documented paramete
|
|
|
176
176
|
```ruby
|
|
177
177
|
checkout_session_response =
|
|
178
178
|
dodo_payments.checkout_sessions.create(
|
|
179
|
-
product_cart: [{product_id: "
|
|
179
|
+
product_cart: [{product_id: "pdt_example", quantity: 1}],
|
|
180
180
|
request_options: {
|
|
181
181
|
extra_query: {my_query_parameter: value},
|
|
182
182
|
extra_body: {my_body_parameter: value},
|
|
@@ -223,7 +223,7 @@ You can provide typesafe request parameters like so:
|
|
|
223
223
|
|
|
224
224
|
```ruby
|
|
225
225
|
dodo_payments.checkout_sessions.create(
|
|
226
|
-
product_cart: [Dodopayments::ProductItemReq.new(product_id: "
|
|
226
|
+
product_cart: [Dodopayments::ProductItemReq.new(product_id: "pdt_example", quantity: 1)]
|
|
227
227
|
)
|
|
228
228
|
```
|
|
229
229
|
|
|
@@ -231,11 +231,11 @@ Or, equivalently:
|
|
|
231
231
|
|
|
232
232
|
```ruby
|
|
233
233
|
# Hashes work, but are not typesafe:
|
|
234
|
-
dodo_payments.checkout_sessions.create(product_cart: [{product_id: "
|
|
234
|
+
dodo_payments.checkout_sessions.create(product_cart: [{product_id: "pdt_example", quantity: 1}])
|
|
235
235
|
|
|
236
236
|
# You can also splat a full Params class:
|
|
237
237
|
params = Dodopayments::CheckoutSessionCreateParams.new(
|
|
238
|
-
product_cart: [Dodopayments::ProductItemReq.new(product_id: "
|
|
238
|
+
product_cart: [Dodopayments::ProductItemReq.new(product_id: "pdt_example", quantity: 1)]
|
|
239
239
|
)
|
|
240
240
|
dodo_payments.checkout_sessions.create(**params)
|
|
241
241
|
```
|
data/lib/dodopayments/client.rb
CHANGED
|
@@ -96,6 +96,9 @@ module Dodopayments
|
|
|
96
96
|
# @return [Dodopayments::Resources::Entitlements]
|
|
97
97
|
attr_reader :entitlements
|
|
98
98
|
|
|
99
|
+
# @return [Dodopayments::Resources::ProductCollections]
|
|
100
|
+
attr_reader :product_collections
|
|
101
|
+
|
|
99
102
|
# @api private
|
|
100
103
|
#
|
|
101
104
|
# @return [Hash{String=>String}]
|
|
@@ -195,6 +198,7 @@ module Dodopayments
|
|
|
195
198
|
@balances = Dodopayments::Resources::Balances.new(client: self)
|
|
196
199
|
@credit_entitlements = Dodopayments::Resources::CreditEntitlements.new(client: self)
|
|
197
200
|
@entitlements = Dodopayments::Resources::Entitlements.new(client: self)
|
|
201
|
+
@product_collections = Dodopayments::Resources::ProductCollections.new(client: self)
|
|
198
202
|
end
|
|
199
203
|
end
|
|
200
204
|
end
|
|
@@ -11,6 +11,18 @@ module Dodopayments
|
|
|
11
11
|
# @return [Boolean, nil]
|
|
12
12
|
optional :allow_currency_selection, Dodopayments::Internal::Type::Boolean
|
|
13
13
|
|
|
14
|
+
# @!attribute allow_customer_editing_business_name
|
|
15
|
+
# If true, the customer can supply or edit the business name associated with the
|
|
16
|
+
# tax id during checkout. Works independently of `allow_customer_editing_tax_id` —
|
|
17
|
+
# either flag (or `allow_tax_id`) is sufficient to let the customer override the
|
|
18
|
+
# session's business name. Typically set together with
|
|
19
|
+
# `allow_customer_editing_tax_id`.
|
|
20
|
+
#
|
|
21
|
+
# Default is false
|
|
22
|
+
#
|
|
23
|
+
# @return [Boolean, nil]
|
|
24
|
+
optional :allow_customer_editing_business_name, Dodopayments::Internal::Type::Boolean
|
|
25
|
+
|
|
14
26
|
# @!attribute allow_customer_editing_city
|
|
15
27
|
#
|
|
16
28
|
# @return [Boolean, nil]
|
|
@@ -101,12 +113,14 @@ module Dodopayments
|
|
|
101
113
|
# @return [Boolean, nil]
|
|
102
114
|
optional :require_phone_number, Dodopayments::Internal::Type::Boolean
|
|
103
115
|
|
|
104
|
-
# @!method initialize(allow_currency_selection: nil, allow_customer_editing_city: nil, allow_customer_editing_country: nil, allow_customer_editing_email: nil, allow_customer_editing_name: nil, allow_customer_editing_state: nil, allow_customer_editing_street: nil, allow_customer_editing_tax_id: nil, allow_customer_editing_zipcode: nil, allow_discount_code: nil, allow_phone_number_collection: nil, allow_tax_id: nil, always_create_new_customer: nil, redirect_immediately: nil, require_phone_number: nil)
|
|
116
|
+
# @!method initialize(allow_currency_selection: nil, allow_customer_editing_business_name: nil, allow_customer_editing_city: nil, allow_customer_editing_country: nil, allow_customer_editing_email: nil, allow_customer_editing_name: nil, allow_customer_editing_state: nil, allow_customer_editing_street: nil, allow_customer_editing_tax_id: nil, allow_customer_editing_zipcode: nil, allow_discount_code: nil, allow_phone_number_collection: nil, allow_tax_id: nil, always_create_new_customer: nil, redirect_immediately: nil, require_phone_number: nil)
|
|
105
117
|
# Some parameter documentations has been truncated, see
|
|
106
118
|
# {Dodopayments::Models::CheckoutSessionFlags} for more details.
|
|
107
119
|
#
|
|
108
120
|
# @param allow_currency_selection [Boolean] if customer is allowed to change currency, set it to true
|
|
109
121
|
#
|
|
122
|
+
# @param allow_customer_editing_business_name [Boolean] If true, the customer can supply or edit the business name associated
|
|
123
|
+
#
|
|
110
124
|
# @param allow_customer_editing_city [Boolean]
|
|
111
125
|
#
|
|
112
126
|
# @param allow_customer_editing_country [Boolean]
|
|
@@ -61,6 +61,14 @@ module Dodopayments
|
|
|
61
61
|
# @return [Dodopayments::Models::AttachExistingCustomer, Dodopayments::Models::NewCustomer, nil]
|
|
62
62
|
optional :customer, union: -> { Dodopayments::CustomerRequest }, nil?: true
|
|
63
63
|
|
|
64
|
+
# @!attribute customer_business_name
|
|
65
|
+
# Optional business / legal name associated with the tax id. When provided
|
|
66
|
+
# together with a valid tax id for a B2B purchase, this name is rendered on the
|
|
67
|
+
# invoice instead of the customer's personal name.
|
|
68
|
+
#
|
|
69
|
+
# @return [String, nil]
|
|
70
|
+
optional :customer_business_name, String, nil?: true
|
|
71
|
+
|
|
64
72
|
# @!attribute customization
|
|
65
73
|
# Customization for the checkout session page
|
|
66
74
|
#
|
|
@@ -162,7 +170,7 @@ module Dodopayments
|
|
|
162
170
|
# @return [String, nil]
|
|
163
171
|
optional :tax_id, String, nil?: true
|
|
164
172
|
|
|
165
|
-
# @!method initialize(product_cart:, allowed_payment_method_types: nil, billing_address: nil, billing_currency: nil, cancel_url: nil, confirm: nil, custom_fields: nil, customer: nil, customization: nil, discount_code: nil, discount_codes: nil, feature_flags: nil, force_3ds: nil, mandate_min_amount_inr_paise: nil, metadata: nil, minimal_address: nil, payment_method_id: nil, product_collection_id: nil, return_url: nil, short_link: nil, show_saved_payment_methods: nil, subscription_data: nil, tax_id: nil)
|
|
173
|
+
# @!method initialize(product_cart:, allowed_payment_method_types: nil, billing_address: nil, billing_currency: nil, cancel_url: nil, confirm: nil, custom_fields: nil, customer: nil, customer_business_name: nil, customization: nil, discount_code: nil, discount_codes: nil, feature_flags: nil, force_3ds: nil, mandate_min_amount_inr_paise: nil, metadata: nil, minimal_address: nil, payment_method_id: nil, product_collection_id: nil, return_url: nil, short_link: nil, show_saved_payment_methods: nil, subscription_data: nil, tax_id: nil)
|
|
166
174
|
# Some parameter documentations has been truncated, see
|
|
167
175
|
# {Dodopayments::Models::CheckoutSessionRequest} for more details.
|
|
168
176
|
#
|
|
@@ -182,6 +190,8 @@ module Dodopayments
|
|
|
182
190
|
#
|
|
183
191
|
# @param customer [Dodopayments::Models::AttachExistingCustomer, Dodopayments::Models::NewCustomer, nil] Customer details for the session
|
|
184
192
|
#
|
|
193
|
+
# @param customer_business_name [String, nil] Optional business / legal name associated with the tax id. When provided
|
|
194
|
+
#
|
|
185
195
|
# @param customization [Dodopayments::Models::CheckoutSessionCustomization] Customization for the checkout session page
|
|
186
196
|
#
|
|
187
197
|
# @param discount_code [String, nil] DEPRECATED: Use discount_codes instead. Cannot be used together with discount_co
|
|
@@ -16,10 +16,42 @@ module Dodopayments
|
|
|
16
16
|
# @return [String, nil]
|
|
17
17
|
optional :checkout_url, String, nil?: true
|
|
18
18
|
|
|
19
|
-
# @!
|
|
19
|
+
# @!attribute client_secret
|
|
20
|
+
# Client secret used to load the Dodo Payments checkout SDK. Returned when
|
|
21
|
+
# `confirm: true` was passed and a PaymentIntent was created at session-creation
|
|
22
|
+
# time. `None` otherwise.
|
|
23
|
+
#
|
|
24
|
+
# @return [String, nil]
|
|
25
|
+
optional :client_secret, String, nil?: true
|
|
26
|
+
|
|
27
|
+
# @!attribute payment_id
|
|
28
|
+
# Underlying payment id when `confirm: true` was passed and a PaymentIntent was
|
|
29
|
+
# created at session-creation time. `None` otherwise.
|
|
30
|
+
#
|
|
31
|
+
# @return [String, nil]
|
|
32
|
+
optional :payment_id, String, nil?: true
|
|
33
|
+
|
|
34
|
+
# @!attribute publishable_key
|
|
35
|
+
# Publishable key for the Dodo Payments checkout SDK. Returned when
|
|
36
|
+
# `confirm: true` was passed and a PaymentIntent was created at session-creation
|
|
37
|
+
# time. `None` otherwise.
|
|
38
|
+
#
|
|
39
|
+
# @return [String, nil]
|
|
40
|
+
optional :publishable_key, String, nil?: true
|
|
41
|
+
|
|
42
|
+
# @!method initialize(session_id:, checkout_url: nil, client_secret: nil, payment_id: nil, publishable_key: nil)
|
|
43
|
+
# Some parameter documentations has been truncated, see
|
|
44
|
+
# {Dodopayments::Models::CheckoutSessionResponse} for more details.
|
|
45
|
+
#
|
|
20
46
|
# @param session_id [String] The ID of the created checkout session
|
|
21
47
|
#
|
|
22
48
|
# @param checkout_url [String, nil] Checkout url (None when payment_method_id is provided)
|
|
49
|
+
#
|
|
50
|
+
# @param client_secret [String, nil] Client secret used to load the Dodo Payments checkout SDK. Returned when
|
|
51
|
+
#
|
|
52
|
+
# @param payment_id [String, nil] Underlying payment id when `confirm: true` was passed and a PaymentIntent
|
|
53
|
+
#
|
|
54
|
+
# @param publishable_key [String, nil] Publishable key for the Dodo Payments checkout SDK. Returned when
|
|
23
55
|
end
|
|
24
56
|
end
|
|
25
57
|
end
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Models
|
|
5
|
+
class DiscountDetail < Dodopayments::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute amount
|
|
7
|
+
# The discount amount (basis points for percentage, USD cents for flat)
|
|
8
|
+
#
|
|
9
|
+
# @return [Integer]
|
|
10
|
+
required :amount, Integer
|
|
11
|
+
|
|
12
|
+
# @!attribute business_id
|
|
13
|
+
# The business this discount belongs to
|
|
14
|
+
#
|
|
15
|
+
# @return [String]
|
|
16
|
+
required :business_id, String
|
|
17
|
+
|
|
18
|
+
# @!attribute code
|
|
19
|
+
# The discount code
|
|
20
|
+
#
|
|
21
|
+
# @return [String]
|
|
22
|
+
required :code, String
|
|
23
|
+
|
|
24
|
+
# @!attribute created_at
|
|
25
|
+
# Timestamp when the discount was created
|
|
26
|
+
#
|
|
27
|
+
# @return [Time]
|
|
28
|
+
required :created_at, Time
|
|
29
|
+
|
|
30
|
+
# @!attribute discount_id
|
|
31
|
+
# The unique discount ID
|
|
32
|
+
#
|
|
33
|
+
# @return [String]
|
|
34
|
+
required :discount_id, String
|
|
35
|
+
|
|
36
|
+
# @!attribute metadata
|
|
37
|
+
# Additional metadata
|
|
38
|
+
#
|
|
39
|
+
# @return [Hash{Symbol=>String}]
|
|
40
|
+
required :metadata, Dodopayments::Internal::Type::HashOf[String]
|
|
41
|
+
|
|
42
|
+
# @!attribute position
|
|
43
|
+
# Position of this discount in the stack (0-based)
|
|
44
|
+
#
|
|
45
|
+
# @return [Integer]
|
|
46
|
+
required :position, Integer
|
|
47
|
+
|
|
48
|
+
# @!attribute preserve_on_plan_change
|
|
49
|
+
# Whether this discount should be preserved when a subscription changes plans
|
|
50
|
+
#
|
|
51
|
+
# @return [Boolean]
|
|
52
|
+
required :preserve_on_plan_change, Dodopayments::Internal::Type::Boolean
|
|
53
|
+
|
|
54
|
+
# @!attribute restricted_to
|
|
55
|
+
# List of product IDs to which this discount is restricted
|
|
56
|
+
#
|
|
57
|
+
# @return [Array<String>]
|
|
58
|
+
required :restricted_to, Dodopayments::Internal::Type::ArrayOf[String]
|
|
59
|
+
|
|
60
|
+
# @!attribute times_used
|
|
61
|
+
# How many times this discount has been used
|
|
62
|
+
#
|
|
63
|
+
# @return [Integer]
|
|
64
|
+
required :times_used, Integer
|
|
65
|
+
|
|
66
|
+
# @!attribute type
|
|
67
|
+
# The type of discount
|
|
68
|
+
#
|
|
69
|
+
# @return [Symbol, Dodopayments::Models::DiscountType]
|
|
70
|
+
required :type, enum: -> { Dodopayments::DiscountType }
|
|
71
|
+
|
|
72
|
+
# @!attribute cycles_remaining
|
|
73
|
+
# Remaining billing cycles for this discount on this subscription (None for
|
|
74
|
+
# one-time payments)
|
|
75
|
+
#
|
|
76
|
+
# @return [Integer, nil]
|
|
77
|
+
optional :cycles_remaining, Integer, nil?: true
|
|
78
|
+
|
|
79
|
+
# @!attribute expires_at
|
|
80
|
+
# Optional date/time after which discount is expired
|
|
81
|
+
#
|
|
82
|
+
# @return [Time, nil]
|
|
83
|
+
optional :expires_at, Time, nil?: true
|
|
84
|
+
|
|
85
|
+
# @!attribute name
|
|
86
|
+
# Name for the Discount
|
|
87
|
+
#
|
|
88
|
+
# @return [String, nil]
|
|
89
|
+
optional :name, String, nil?: true
|
|
90
|
+
|
|
91
|
+
# @!attribute subscription_cycles
|
|
92
|
+
# Number of subscription billing cycles this discount is valid for
|
|
93
|
+
#
|
|
94
|
+
# @return [Integer, nil]
|
|
95
|
+
optional :subscription_cycles, Integer, nil?: true
|
|
96
|
+
|
|
97
|
+
# @!attribute usage_limit
|
|
98
|
+
# Usage limit for this discount, if any
|
|
99
|
+
#
|
|
100
|
+
# @return [Integer, nil]
|
|
101
|
+
optional :usage_limit, Integer, nil?: true
|
|
102
|
+
|
|
103
|
+
# @!method initialize(amount:, business_id:, code:, created_at:, discount_id:, metadata:, position:, preserve_on_plan_change:, restricted_to:, times_used:, type:, cycles_remaining: nil, expires_at: nil, name: nil, subscription_cycles: nil, usage_limit: nil)
|
|
104
|
+
# Some parameter documentations has been truncated, see
|
|
105
|
+
# {Dodopayments::Models::DiscountDetail} for more details.
|
|
106
|
+
#
|
|
107
|
+
# Response struct for a discount with its position in a stack and optional
|
|
108
|
+
# cycle-tracking information (for subscriptions).
|
|
109
|
+
#
|
|
110
|
+
# @param amount [Integer] The discount amount (basis points for percentage, USD cents for flat)
|
|
111
|
+
#
|
|
112
|
+
# @param business_id [String] The business this discount belongs to
|
|
113
|
+
#
|
|
114
|
+
# @param code [String] The discount code
|
|
115
|
+
#
|
|
116
|
+
# @param created_at [Time] Timestamp when the discount was created
|
|
117
|
+
#
|
|
118
|
+
# @param discount_id [String] The unique discount ID
|
|
119
|
+
#
|
|
120
|
+
# @param metadata [Hash{Symbol=>String}] Additional metadata
|
|
121
|
+
#
|
|
122
|
+
# @param position [Integer] Position of this discount in the stack (0-based)
|
|
123
|
+
#
|
|
124
|
+
# @param preserve_on_plan_change [Boolean] Whether this discount should be preserved when a subscription changes plans
|
|
125
|
+
#
|
|
126
|
+
# @param restricted_to [Array<String>] List of product IDs to which this discount is restricted
|
|
127
|
+
#
|
|
128
|
+
# @param times_used [Integer] How many times this discount has been used
|
|
129
|
+
#
|
|
130
|
+
# @param type [Symbol, Dodopayments::Models::DiscountType] The type of discount
|
|
131
|
+
#
|
|
132
|
+
# @param cycles_remaining [Integer, nil] Remaining billing cycles for this discount on this subscription (None for one-ti
|
|
133
|
+
#
|
|
134
|
+
# @param expires_at [Time, nil] Optional date/time after which discount is expired
|
|
135
|
+
#
|
|
136
|
+
# @param name [String, nil] Name for the Discount
|
|
137
|
+
#
|
|
138
|
+
# @param subscription_cycles [Integer, nil] Number of subscription billing cycles this discount is valid for
|
|
139
|
+
#
|
|
140
|
+
# @param usage_limit [Integer, nil] Usage limit for this discount, if any
|
|
141
|
+
end
|
|
142
|
+
end
|
|
143
|
+
end
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Models
|
|
5
|
+
# Filter clauses — either a flat list of `MeterFilterCondition`s or a list of
|
|
6
|
+
# nested `MeterFilter`s. Up to 3 levels of nesting are accepted; the limit is
|
|
7
|
+
# enforced at runtime.
|
|
8
|
+
module FilterType
|
|
9
|
+
extend Dodopayments::Internal::Type::Union
|
|
10
|
+
|
|
11
|
+
# Array of filter conditions.
|
|
12
|
+
variant -> { Dodopayments::Models::FilterType::MeterFilterConditionListArray }
|
|
13
|
+
|
|
14
|
+
# Array of nested filters.
|
|
15
|
+
variant -> { Dodopayments::Models::FilterType::MeterFilterArray }
|
|
16
|
+
|
|
17
|
+
class MeterFilterConditionList < Dodopayments::Internal::Type::BaseModel
|
|
18
|
+
# @!attribute key
|
|
19
|
+
# Filter key to apply
|
|
20
|
+
#
|
|
21
|
+
# @return [String]
|
|
22
|
+
required :key, String
|
|
23
|
+
|
|
24
|
+
# @!attribute operator
|
|
25
|
+
# Filter operator
|
|
26
|
+
#
|
|
27
|
+
# @return [Symbol, Dodopayments::Models::FilterOperator]
|
|
28
|
+
required :operator, enum: -> { Dodopayments::FilterOperator }
|
|
29
|
+
|
|
30
|
+
# @!attribute value
|
|
31
|
+
# Filter value - can be string, number, or boolean
|
|
32
|
+
#
|
|
33
|
+
# @return [String, Float, Boolean]
|
|
34
|
+
required :value, union: -> { Dodopayments::FilterType::MeterFilterConditionList::Value }
|
|
35
|
+
|
|
36
|
+
# @!method initialize(key:, operator:, value:)
|
|
37
|
+
# @param key [String] Filter key to apply
|
|
38
|
+
#
|
|
39
|
+
# @param operator [Symbol, Dodopayments::Models::FilterOperator] Filter operator
|
|
40
|
+
#
|
|
41
|
+
# @param value [String, Float, Boolean] Filter value - can be string, number, or boolean
|
|
42
|
+
|
|
43
|
+
# Filter value - can be string, number, or boolean
|
|
44
|
+
#
|
|
45
|
+
# @see Dodopayments::Models::FilterType::MeterFilterConditionList#value
|
|
46
|
+
module Value
|
|
47
|
+
extend Dodopayments::Internal::Type::Union
|
|
48
|
+
|
|
49
|
+
variant String
|
|
50
|
+
|
|
51
|
+
variant Float
|
|
52
|
+
|
|
53
|
+
variant Dodopayments::Internal::Type::Boolean
|
|
54
|
+
|
|
55
|
+
# @!method self.variants
|
|
56
|
+
# @return [Array(String, Float, Boolean)]
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# @!method self.variants
|
|
61
|
+
# @return [Array(Array<Dodopayments::Models::FilterType::MeterFilterConditionList>, Array<Dodopayments::Models::MeterFilter>)]
|
|
62
|
+
|
|
63
|
+
# @type [Dodopayments::Internal::Type::Converter]
|
|
64
|
+
MeterFilterConditionListArray =
|
|
65
|
+
Dodopayments::Internal::Type::ArrayOf[-> { Dodopayments::FilterType::MeterFilterConditionList }]
|
|
66
|
+
|
|
67
|
+
# @type [Dodopayments::Internal::Type::Converter]
|
|
68
|
+
MeterFilterArray = Dodopayments::Internal::Type::ArrayOf[-> { Dodopayments::MeterFilter }]
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Models
|
|
5
|
+
# Repository permission to grant on a `github` entitlement.
|
|
6
|
+
module GitHubPermission
|
|
7
|
+
extend Dodopayments::Internal::Type::Enum
|
|
8
|
+
|
|
9
|
+
PULL = :pull
|
|
10
|
+
PUSH = :push
|
|
11
|
+
ADMIN = :admin
|
|
12
|
+
MAINTAIN = :maintain
|
|
13
|
+
TRIAGE = :triage
|
|
14
|
+
|
|
15
|
+
# @!method self.values
|
|
16
|
+
# @return [Array<Symbol>]
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -27,8 +27,8 @@ module Dodopayments
|
|
|
27
27
|
# @!attribute permission
|
|
28
28
|
# Permission to grant on the repository.
|
|
29
29
|
#
|
|
30
|
-
# @return [Symbol, Dodopayments::Models::
|
|
31
|
-
required :permission, enum: -> { Dodopayments::
|
|
30
|
+
# @return [Symbol, Dodopayments::Models::GitHubPermission]
|
|
31
|
+
required :permission, enum: -> { Dodopayments::GitHubPermission }
|
|
32
32
|
|
|
33
33
|
# @!attribute target_id
|
|
34
34
|
# Repository or organisation slug to grant access to.
|
|
@@ -37,25 +37,9 @@ module Dodopayments
|
|
|
37
37
|
required :target_id, String
|
|
38
38
|
|
|
39
39
|
# @!method initialize(permission:, target_id:)
|
|
40
|
-
# @param permission [Symbol, Dodopayments::Models::
|
|
40
|
+
# @param permission [Symbol, Dodopayments::Models::GitHubPermission] Permission to grant on the repository.
|
|
41
41
|
#
|
|
42
42
|
# @param target_id [String] Repository or organisation slug to grant access to.
|
|
43
|
-
|
|
44
|
-
# Permission to grant on the repository.
|
|
45
|
-
#
|
|
46
|
-
# @see Dodopayments::Models::IntegrationConfig::GitHubConfig#permission
|
|
47
|
-
module Permission
|
|
48
|
-
extend Dodopayments::Internal::Type::Enum
|
|
49
|
-
|
|
50
|
-
PULL = :pull
|
|
51
|
-
PUSH = :push
|
|
52
|
-
ADMIN = :admin
|
|
53
|
-
MAINTAIN = :maintain
|
|
54
|
-
TRIAGE = :triage
|
|
55
|
-
|
|
56
|
-
# @!method self.values
|
|
57
|
-
# @return [Array<Symbol>]
|
|
58
|
-
end
|
|
59
43
|
end
|
|
60
44
|
|
|
61
45
|
class DiscordConfig < Dodopayments::Internal::Type::BaseModel
|
|
@@ -29,8 +29,8 @@ module Dodopayments
|
|
|
29
29
|
# @!attribute permission
|
|
30
30
|
# Permission to grant on the repository.
|
|
31
31
|
#
|
|
32
|
-
# @return [Symbol, Dodopayments::Models::
|
|
33
|
-
required :permission, enum: -> { Dodopayments::
|
|
32
|
+
# @return [Symbol, Dodopayments::Models::GitHubPermission]
|
|
33
|
+
required :permission, enum: -> { Dodopayments::GitHubPermission }
|
|
34
34
|
|
|
35
35
|
# @!attribute target_id
|
|
36
36
|
# Repository or organisation slug to grant access to.
|
|
@@ -39,25 +39,9 @@ module Dodopayments
|
|
|
39
39
|
required :target_id, String
|
|
40
40
|
|
|
41
41
|
# @!method initialize(permission:, target_id:)
|
|
42
|
-
# @param permission [Symbol, Dodopayments::Models::
|
|
42
|
+
# @param permission [Symbol, Dodopayments::Models::GitHubPermission] Permission to grant on the repository.
|
|
43
43
|
#
|
|
44
44
|
# @param target_id [String] Repository or organisation slug to grant access to.
|
|
45
|
-
|
|
46
|
-
# Permission to grant on the repository.
|
|
47
|
-
#
|
|
48
|
-
# @see Dodopayments::Models::IntegrationConfigResponse::GitHubConfig#permission
|
|
49
|
-
module Permission
|
|
50
|
-
extend Dodopayments::Internal::Type::Enum
|
|
51
|
-
|
|
52
|
-
PULL = :pull
|
|
53
|
-
PUSH = :push
|
|
54
|
-
ADMIN = :admin
|
|
55
|
-
MAINTAIN = :maintain
|
|
56
|
-
TRIAGE = :triage
|
|
57
|
-
|
|
58
|
-
# @!method self.values
|
|
59
|
-
# @return [Array<Symbol>]
|
|
60
|
-
end
|
|
61
45
|
end
|
|
62
46
|
|
|
63
47
|
class DiscordConfig < Dodopayments::Internal::Type::BaseModel
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Models
|
|
5
|
+
module Invoices
|
|
6
|
+
# @see Dodopayments::Resources::Invoices::Payments#retrieve_payout
|
|
7
|
+
class PaymentRetrievePayoutParams < Dodopayments::Internal::Type::BaseModel
|
|
8
|
+
extend Dodopayments::Internal::Type::RequestParameters::Converter
|
|
9
|
+
include Dodopayments::Internal::Type::RequestParameters
|
|
10
|
+
|
|
11
|
+
# @!attribute payout_id
|
|
12
|
+
#
|
|
13
|
+
# @return [String]
|
|
14
|
+
required :payout_id, String
|
|
15
|
+
|
|
16
|
+
# @!method initialize(payout_id:, request_options: {})
|
|
17
|
+
# @param payout_id [String]
|
|
18
|
+
# @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|