dodopayments 2.17.0 → 2.18.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.
Files changed (111) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +21 -0
  3. data/README.md +1 -1
  4. data/lib/dodopayments/internal/cursor_page_pagination.rb +1 -1
  5. data/lib/dodopayments/models/credit_entitlements/credit_ledger_entry.rb +14 -1
  6. data/lib/dodopayments/models/entitlements/grant_fulfill_license_key_params.rb +53 -0
  7. data/lib/dodopayments/models/metadata.rb +8 -0
  8. data/lib/dodopayments/models/payment_method_types.rb +1 -0
  9. data/lib/dodopayments/models/product.rb +3 -17
  10. data/lib/dodopayments/models/product_create_params.rb +3 -16
  11. data/lib/dodopayments/models/product_list_response.rb +3 -17
  12. data/lib/dodopayments/models/product_update_params.rb +3 -16
  13. data/lib/dodopayments/models/products/list_localized_prices_response.rb +18 -0
  14. data/lib/dodopayments/models/products/localized_price.rb +75 -0
  15. data/lib/dodopayments/models/products/localized_price_archive_params.rb +28 -0
  16. data/lib/dodopayments/models/products/localized_price_create_params.rb +51 -0
  17. data/lib/dodopayments/models/products/localized_price_list_params.rb +22 -0
  18. data/lib/dodopayments/models/products/localized_price_retrieve_params.rb +28 -0
  19. data/lib/dodopayments/models/products/localized_price_update_params.rb +42 -0
  20. data/lib/dodopayments/models/products/pricing_mode.rb +17 -0
  21. data/lib/dodopayments/models.rb +3 -0
  22. data/lib/dodopayments/resources/checkout_sessions.rb +2 -1
  23. data/lib/dodopayments/resources/entitlements/grants.rb +35 -0
  24. data/lib/dodopayments/resources/invoices/payments.rb +6 -3
  25. data/lib/dodopayments/resources/products/localized_prices.rb +144 -0
  26. data/lib/dodopayments/resources/products.rb +11 -5
  27. data/lib/dodopayments/resources/webhooks/headers.rb +3 -2
  28. data/lib/dodopayments/resources/webhooks.rb +7 -4
  29. data/lib/dodopayments/version.rb +1 -1
  30. data/lib/dodopayments.rb +11 -0
  31. data/rbi/dodopayments/models/credit_entitlements/credit_ledger_entry.rbi +12 -0
  32. data/rbi/dodopayments/models/entitlements/grant_fulfill_license_key_params.rbi +74 -0
  33. data/rbi/dodopayments/models/metadata.rbi +11 -0
  34. data/rbi/dodopayments/models/payment_method_types.rbi +2 -0
  35. data/rbi/dodopayments/models/product.rbi +4 -26
  36. data/rbi/dodopayments/models/product_create_params.rbi +3 -43
  37. data/rbi/dodopayments/models/product_list_response.rbi +3 -47
  38. data/rbi/dodopayments/models/product_update_params.rbi +3 -43
  39. data/rbi/dodopayments/models/products/list_localized_prices_response.rbi +36 -0
  40. data/rbi/dodopayments/models/products/localized_price.rbi +98 -0
  41. data/rbi/dodopayments/models/products/localized_price_archive_params.rbi +48 -0
  42. data/rbi/dodopayments/models/products/localized_price_create_params.rbi +72 -0
  43. data/rbi/dodopayments/models/products/localized_price_list_params.rbi +43 -0
  44. data/rbi/dodopayments/models/products/localized_price_retrieve_params.rbi +48 -0
  45. data/rbi/dodopayments/models/products/localized_price_update_params.rbi +62 -0
  46. data/rbi/dodopayments/models/products/pricing_mode.rbi +28 -0
  47. data/rbi/dodopayments/models.rbi +6 -0
  48. data/rbi/dodopayments/resources/checkout_sessions.rbi +5 -1
  49. data/rbi/dodopayments/resources/entitlements/grants.rbi +28 -0
  50. data/rbi/dodopayments/resources/invoices/payments.rbi +15 -3
  51. data/rbi/dodopayments/resources/products/localized_prices.rbi +103 -0
  52. data/rbi/dodopayments/resources/products.rbi +16 -4
  53. data/rbi/dodopayments/resources/webhooks/headers.rbi +6 -1
  54. data/rbi/dodopayments/resources/webhooks.rbi +16 -3
  55. data/sig/dodopayments/models/checkout_session_request.rbs +4 -4
  56. data/sig/dodopayments/models/credit_entitlements/balance_create_ledger_entry_params.rbs +4 -4
  57. data/sig/dodopayments/models/credit_entitlements/balance_list_grants_response.rbs +4 -4
  58. data/sig/dodopayments/models/credit_entitlements/credit_ledger_entry.rbs +5 -0
  59. data/sig/dodopayments/models/customer.rbs +7 -5
  60. data/sig/dodopayments/models/customer_create_params.rbs +7 -5
  61. data/sig/dodopayments/models/customer_limited_details.rbs +7 -5
  62. data/sig/dodopayments/models/customer_update_params.rbs +4 -4
  63. data/sig/dodopayments/models/discount.rbs +4 -4
  64. data/sig/dodopayments/models/discount_create_params.rbs +7 -5
  65. data/sig/dodopayments/models/discount_detail.rbs +4 -4
  66. data/sig/dodopayments/models/discount_update_params.rbs +4 -4
  67. data/sig/dodopayments/models/entitlement.rbs +4 -4
  68. data/sig/dodopayments/models/entitlement_create_params.rbs +7 -5
  69. data/sig/dodopayments/models/entitlement_update_params.rbs +4 -4
  70. data/sig/dodopayments/models/entitlements/entitlement_grant.rbs +4 -4
  71. data/sig/dodopayments/models/entitlements/grant_fulfill_license_key_params.rbs +43 -0
  72. data/sig/dodopayments/models/metadata.rbs +7 -0
  73. data/sig/dodopayments/models/payment.rbs +4 -4
  74. data/sig/dodopayments/models/payment_create_params.rbs +7 -5
  75. data/sig/dodopayments/models/payment_create_response.rbs +4 -4
  76. data/sig/dodopayments/models/payment_list_response.rbs +4 -4
  77. data/sig/dodopayments/models/payment_method_types.rbs +2 -0
  78. data/sig/dodopayments/models/product.rbs +8 -19
  79. data/sig/dodopayments/models/product_create_params.rbs +11 -20
  80. data/sig/dodopayments/models/product_list_response.rbs +8 -19
  81. data/sig/dodopayments/models/product_update_params.rbs +8 -19
  82. data/sig/dodopayments/models/products/list_localized_prices_response.rbs +20 -0
  83. data/sig/dodopayments/models/products/localized_price.rbs +57 -0
  84. data/sig/dodopayments/models/products/localized_price_archive_params.rbs +30 -0
  85. data/sig/dodopayments/models/products/localized_price_create_params.rbs +43 -0
  86. data/sig/dodopayments/models/products/localized_price_list_params.rbs +26 -0
  87. data/sig/dodopayments/models/products/localized_price_retrieve_params.rbs +30 -0
  88. data/sig/dodopayments/models/products/localized_price_update_params.rbs +34 -0
  89. data/sig/dodopayments/models/products/pricing_mode.rbs +16 -0
  90. data/sig/dodopayments/models/refund.rbs +4 -4
  91. data/sig/dodopayments/models/refund_create_params.rbs +7 -5
  92. data/sig/dodopayments/models/subscription.rbs +4 -4
  93. data/sig/dodopayments/models/subscription_charge_params.rbs +4 -4
  94. data/sig/dodopayments/models/subscription_create_params.rbs +7 -5
  95. data/sig/dodopayments/models/subscription_create_response.rbs +4 -4
  96. data/sig/dodopayments/models/subscription_list_response.rbs +4 -4
  97. data/sig/dodopayments/models/subscription_update_params.rbs +4 -4
  98. data/sig/dodopayments/models/update_subscription_plan_req.rbs +4 -4
  99. data/sig/dodopayments/models.rbs +2 -0
  100. data/sig/dodopayments/resources/checkout_sessions.rbs +2 -2
  101. data/sig/dodopayments/resources/credit_entitlements/balances.rbs +1 -1
  102. data/sig/dodopayments/resources/customers.rbs +2 -2
  103. data/sig/dodopayments/resources/discounts.rbs +2 -2
  104. data/sig/dodopayments/resources/entitlements/grants.rbs +8 -0
  105. data/sig/dodopayments/resources/entitlements.rbs +2 -2
  106. data/sig/dodopayments/resources/payments.rbs +1 -1
  107. data/sig/dodopayments/resources/products/localized_prices.rbs +41 -0
  108. data/sig/dodopayments/resources/products.rbs +6 -4
  109. data/sig/dodopayments/resources/refunds.rbs +1 -1
  110. data/sig/dodopayments/resources/subscriptions.rbs +5 -5
  111. metadata +35 -2
@@ -79,11 +79,7 @@ module Dodopayments
79
79
  # Pricing mode for localized pricing. NULL means base-only (no localized rules
80
80
  # apply).
81
81
  sig do
82
- returns(
83
- T.nilable(
84
- Dodopayments::Models::ProductListResponse::PricingMode::TaggedSymbol
85
- )
86
- )
82
+ returns(T.nilable(Dodopayments::Products::PricingMode::TaggedSymbol))
87
83
  end
88
84
  attr_accessor :pricing_mode
89
85
 
@@ -116,9 +112,7 @@ module Dodopayments
116
112
  )
117
113
  ),
118
114
  pricing_mode:
119
- T.nilable(
120
- Dodopayments::Models::ProductListResponse::PricingMode::OrSymbol
121
- ),
115
+ T.nilable(Dodopayments::Products::PricingMode::OrSymbol),
122
116
  tax_inclusive: T.nilable(T::Boolean)
123
117
  ).returns(T.attached_class)
124
118
  end
@@ -186,51 +180,13 @@ module Dodopayments
186
180
  price: T.nilable(Integer),
187
181
  price_detail: T.nilable(Dodopayments::Price::Variants),
188
182
  pricing_mode:
189
- T.nilable(
190
- Dodopayments::Models::ProductListResponse::PricingMode::TaggedSymbol
191
- ),
183
+ T.nilable(Dodopayments::Products::PricingMode::TaggedSymbol),
192
184
  tax_inclusive: T.nilable(T::Boolean)
193
185
  }
194
186
  )
195
187
  end
196
188
  def to_hash
197
189
  end
198
-
199
- # Pricing mode for localized pricing. NULL means base-only (no localized rules
200
- # apply).
201
- module PricingMode
202
- extend Dodopayments::Internal::Type::Enum
203
-
204
- TaggedSymbol =
205
- T.type_alias do
206
- T.all(
207
- Symbol,
208
- Dodopayments::Models::ProductListResponse::PricingMode
209
- )
210
- end
211
- OrSymbol = T.type_alias { T.any(Symbol, String) }
212
-
213
- BY_CURRENCY =
214
- T.let(
215
- :by_currency,
216
- Dodopayments::Models::ProductListResponse::PricingMode::TaggedSymbol
217
- )
218
- BY_COUNTRY =
219
- T.let(
220
- :by_country,
221
- Dodopayments::Models::ProductListResponse::PricingMode::TaggedSymbol
222
- )
223
-
224
- sig do
225
- override.returns(
226
- T::Array[
227
- Dodopayments::Models::ProductListResponse::PricingMode::TaggedSymbol
228
- ]
229
- )
230
- end
231
- def self.values
232
- end
233
- end
234
190
  end
235
191
  end
236
192
  end
@@ -135,11 +135,7 @@ module Dodopayments
135
135
  # Update the pricing mode. Omit to leave unchanged; set to null to clear (which
136
136
  # archives all active localized rules for this product). Changing to a different
137
137
  # non-null mode also archives any rules whose mode doesn't match the new mode.
138
- sig do
139
- returns(
140
- T.nilable(Dodopayments::ProductUpdateParams::PricingMode::OrSymbol)
141
- )
142
- end
138
+ sig { returns(T.nilable(Dodopayments::Products::PricingMode::OrSymbol)) }
143
139
  attr_accessor :pricing_mode
144
140
 
145
141
  # Tax category of the product.
@@ -177,7 +173,7 @@ module Dodopayments
177
173
  )
178
174
  ),
179
175
  pricing_mode:
180
- T.nilable(Dodopayments::ProductUpdateParams::PricingMode::OrSymbol),
176
+ T.nilable(Dodopayments::Products::PricingMode::OrSymbol),
181
177
  tax_category: T.nilable(Dodopayments::TaxCategory::OrSymbol),
182
178
  request_options: Dodopayments::RequestOptions::OrHash
183
179
  ).returns(T.attached_class)
@@ -276,9 +272,7 @@ module Dodopayments
276
272
  )
277
273
  ),
278
274
  pricing_mode:
279
- T.nilable(
280
- Dodopayments::ProductUpdateParams::PricingMode::OrSymbol
281
- ),
275
+ T.nilable(Dodopayments::Products::PricingMode::OrSymbol),
282
276
  tax_category: T.nilable(Dodopayments::TaxCategory::OrSymbol),
283
277
  request_options: Dodopayments::RequestOptions
284
278
  }
@@ -340,40 +334,6 @@ module Dodopayments
340
334
  def to_hash
341
335
  end
342
336
  end
343
-
344
- # Update the pricing mode. Omit to leave unchanged; set to null to clear (which
345
- # archives all active localized rules for this product). Changing to a different
346
- # non-null mode also archives any rules whose mode doesn't match the new mode.
347
- module PricingMode
348
- extend Dodopayments::Internal::Type::Enum
349
-
350
- TaggedSymbol =
351
- T.type_alias do
352
- T.all(Symbol, Dodopayments::ProductUpdateParams::PricingMode)
353
- end
354
- OrSymbol = T.type_alias { T.any(Symbol, String) }
355
-
356
- BY_CURRENCY =
357
- T.let(
358
- :by_currency,
359
- Dodopayments::ProductUpdateParams::PricingMode::TaggedSymbol
360
- )
361
- BY_COUNTRY =
362
- T.let(
363
- :by_country,
364
- Dodopayments::ProductUpdateParams::PricingMode::TaggedSymbol
365
- )
366
-
367
- sig do
368
- override.returns(
369
- T::Array[
370
- Dodopayments::ProductUpdateParams::PricingMode::TaggedSymbol
371
- ]
372
- )
373
- end
374
- def self.values
375
- end
376
- end
377
337
  end
378
338
  end
379
339
  end
@@ -0,0 +1,36 @@
1
+ # typed: strong
2
+
3
+ module Dodopayments
4
+ module Models
5
+ module Products
6
+ class ListLocalizedPricesResponse < Dodopayments::Internal::Type::BaseModel
7
+ OrHash =
8
+ T.type_alias do
9
+ T.any(
10
+ Dodopayments::Products::ListLocalizedPricesResponse,
11
+ Dodopayments::Internal::AnyHash
12
+ )
13
+ end
14
+
15
+ sig { returns(T::Array[Dodopayments::Products::LocalizedPrice]) }
16
+ attr_accessor :items
17
+
18
+ sig do
19
+ params(
20
+ items: T::Array[Dodopayments::Products::LocalizedPrice::OrHash]
21
+ ).returns(T.attached_class)
22
+ end
23
+ def self.new(items:)
24
+ end
25
+
26
+ sig do
27
+ override.returns(
28
+ { items: T::Array[Dodopayments::Products::LocalizedPrice] }
29
+ )
30
+ end
31
+ def to_hash
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,98 @@
1
+ # typed: strong
2
+
3
+ module Dodopayments
4
+ module Models
5
+ module Products
6
+ class LocalizedPrice < Dodopayments::Internal::Type::BaseModel
7
+ OrHash =
8
+ T.type_alias do
9
+ T.any(
10
+ Dodopayments::Products::LocalizedPrice,
11
+ Dodopayments::Internal::AnyHash
12
+ )
13
+ end
14
+
15
+ # Unique identifier for the localized price.
16
+ sig { returns(String) }
17
+ attr_accessor :id
18
+
19
+ # Amount in the smallest currency unit (e.g., cents).
20
+ sig { returns(Integer) }
21
+ attr_accessor :amount
22
+
23
+ # Timestamp when the localized price was created.
24
+ sig { returns(Time) }
25
+ attr_accessor :created_at
26
+
27
+ # Currency to charge in.
28
+ sig { returns(Dodopayments::Currency::TaggedSymbol) }
29
+ attr_accessor :currency
30
+
31
+ # Pricing mode of the rule: by_currency or by_country.
32
+ sig { returns(Dodopayments::Products::PricingMode::TaggedSymbol) }
33
+ attr_accessor :mode
34
+
35
+ # Product this localized price belongs to.
36
+ sig { returns(String) }
37
+ attr_accessor :product_id
38
+
39
+ # Timestamp when the localized price was last updated.
40
+ sig { returns(Time) }
41
+ attr_accessor :updated_at
42
+
43
+ # Country the rule applies to. Only set when mode is by_country.
44
+ sig { returns(T.nilable(Dodopayments::CountryCode::TaggedSymbol)) }
45
+ attr_accessor :country_code
46
+
47
+ sig do
48
+ params(
49
+ id: String,
50
+ amount: Integer,
51
+ created_at: Time,
52
+ currency: Dodopayments::Currency::OrSymbol,
53
+ mode: Dodopayments::Products::PricingMode::OrSymbol,
54
+ product_id: String,
55
+ updated_at: Time,
56
+ country_code: T.nilable(Dodopayments::CountryCode::OrSymbol)
57
+ ).returns(T.attached_class)
58
+ end
59
+ def self.new(
60
+ # Unique identifier for the localized price.
61
+ id:,
62
+ # Amount in the smallest currency unit (e.g., cents).
63
+ amount:,
64
+ # Timestamp when the localized price was created.
65
+ created_at:,
66
+ # Currency to charge in.
67
+ currency:,
68
+ # Pricing mode of the rule: by_currency or by_country.
69
+ mode:,
70
+ # Product this localized price belongs to.
71
+ product_id:,
72
+ # Timestamp when the localized price was last updated.
73
+ updated_at:,
74
+ # Country the rule applies to. Only set when mode is by_country.
75
+ country_code: nil
76
+ )
77
+ end
78
+
79
+ sig do
80
+ override.returns(
81
+ {
82
+ id: String,
83
+ amount: Integer,
84
+ created_at: Time,
85
+ currency: Dodopayments::Currency::TaggedSymbol,
86
+ mode: Dodopayments::Products::PricingMode::TaggedSymbol,
87
+ product_id: String,
88
+ updated_at: Time,
89
+ country_code: T.nilable(Dodopayments::CountryCode::TaggedSymbol)
90
+ }
91
+ )
92
+ end
93
+ def to_hash
94
+ end
95
+ end
96
+ end
97
+ end
98
+ end
@@ -0,0 +1,48 @@
1
+ # typed: strong
2
+
3
+ module Dodopayments
4
+ module Models
5
+ module Products
6
+ class LocalizedPriceArchiveParams < Dodopayments::Internal::Type::BaseModel
7
+ extend Dodopayments::Internal::Type::RequestParameters::Converter
8
+ include Dodopayments::Internal::Type::RequestParameters
9
+
10
+ OrHash =
11
+ T.type_alias do
12
+ T.any(
13
+ Dodopayments::Products::LocalizedPriceArchiveParams,
14
+ Dodopayments::Internal::AnyHash
15
+ )
16
+ end
17
+
18
+ sig { returns(String) }
19
+ attr_accessor :product_id
20
+
21
+ sig { returns(String) }
22
+ attr_accessor :id
23
+
24
+ sig do
25
+ params(
26
+ product_id: String,
27
+ id: String,
28
+ request_options: Dodopayments::RequestOptions::OrHash
29
+ ).returns(T.attached_class)
30
+ end
31
+ def self.new(product_id:, id:, request_options: {})
32
+ end
33
+
34
+ sig do
35
+ override.returns(
36
+ {
37
+ product_id: String,
38
+ id: String,
39
+ request_options: Dodopayments::RequestOptions
40
+ }
41
+ )
42
+ end
43
+ def to_hash
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,72 @@
1
+ # typed: strong
2
+
3
+ module Dodopayments
4
+ module Models
5
+ module Products
6
+ class LocalizedPriceCreateParams < Dodopayments::Internal::Type::BaseModel
7
+ extend Dodopayments::Internal::Type::RequestParameters::Converter
8
+ include Dodopayments::Internal::Type::RequestParameters
9
+
10
+ OrHash =
11
+ T.type_alias do
12
+ T.any(
13
+ Dodopayments::Products::LocalizedPriceCreateParams,
14
+ Dodopayments::Internal::AnyHash
15
+ )
16
+ end
17
+
18
+ sig { returns(String) }
19
+ attr_accessor :product_id
20
+
21
+ # Amount in the smallest currency unit (e.g., cents). Must be greater than zero.
22
+ sig { returns(Integer) }
23
+ attr_accessor :amount
24
+
25
+ # Currency to charge in. Must be a supported currency.
26
+ sig { returns(Dodopayments::Currency::OrSymbol) }
27
+ attr_accessor :currency
28
+
29
+ # Required when the product's pricing_mode is by_country; forbidden when
30
+ # by_currency.
31
+ sig { returns(T.nilable(Dodopayments::CountryCode::OrSymbol)) }
32
+ attr_accessor :country_code
33
+
34
+ sig do
35
+ params(
36
+ product_id: String,
37
+ amount: Integer,
38
+ currency: Dodopayments::Currency::OrSymbol,
39
+ country_code: T.nilable(Dodopayments::CountryCode::OrSymbol),
40
+ request_options: Dodopayments::RequestOptions::OrHash
41
+ ).returns(T.attached_class)
42
+ end
43
+ def self.new(
44
+ product_id:,
45
+ # Amount in the smallest currency unit (e.g., cents). Must be greater than zero.
46
+ amount:,
47
+ # Currency to charge in. Must be a supported currency.
48
+ currency:,
49
+ # Required when the product's pricing_mode is by_country; forbidden when
50
+ # by_currency.
51
+ country_code: nil,
52
+ request_options: {}
53
+ )
54
+ end
55
+
56
+ sig do
57
+ override.returns(
58
+ {
59
+ product_id: String,
60
+ amount: Integer,
61
+ currency: Dodopayments::Currency::OrSymbol,
62
+ country_code: T.nilable(Dodopayments::CountryCode::OrSymbol),
63
+ request_options: Dodopayments::RequestOptions
64
+ }
65
+ )
66
+ end
67
+ def to_hash
68
+ end
69
+ end
70
+ end
71
+ end
72
+ end
@@ -0,0 +1,43 @@
1
+ # typed: strong
2
+
3
+ module Dodopayments
4
+ module Models
5
+ module Products
6
+ class LocalizedPriceListParams < Dodopayments::Internal::Type::BaseModel
7
+ extend Dodopayments::Internal::Type::RequestParameters::Converter
8
+ include Dodopayments::Internal::Type::RequestParameters
9
+
10
+ OrHash =
11
+ T.type_alias do
12
+ T.any(
13
+ Dodopayments::Products::LocalizedPriceListParams,
14
+ Dodopayments::Internal::AnyHash
15
+ )
16
+ end
17
+
18
+ sig { returns(String) }
19
+ attr_accessor :product_id
20
+
21
+ sig do
22
+ params(
23
+ product_id: String,
24
+ request_options: Dodopayments::RequestOptions::OrHash
25
+ ).returns(T.attached_class)
26
+ end
27
+ def self.new(product_id:, request_options: {})
28
+ end
29
+
30
+ sig do
31
+ override.returns(
32
+ {
33
+ product_id: String,
34
+ request_options: Dodopayments::RequestOptions
35
+ }
36
+ )
37
+ end
38
+ def to_hash
39
+ end
40
+ end
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,48 @@
1
+ # typed: strong
2
+
3
+ module Dodopayments
4
+ module Models
5
+ module Products
6
+ class LocalizedPriceRetrieveParams < Dodopayments::Internal::Type::BaseModel
7
+ extend Dodopayments::Internal::Type::RequestParameters::Converter
8
+ include Dodopayments::Internal::Type::RequestParameters
9
+
10
+ OrHash =
11
+ T.type_alias do
12
+ T.any(
13
+ Dodopayments::Products::LocalizedPriceRetrieveParams,
14
+ Dodopayments::Internal::AnyHash
15
+ )
16
+ end
17
+
18
+ sig { returns(String) }
19
+ attr_accessor :product_id
20
+
21
+ sig { returns(String) }
22
+ attr_accessor :id
23
+
24
+ sig do
25
+ params(
26
+ product_id: String,
27
+ id: String,
28
+ request_options: Dodopayments::RequestOptions::OrHash
29
+ ).returns(T.attached_class)
30
+ end
31
+ def self.new(product_id:, id:, request_options: {})
32
+ end
33
+
34
+ sig do
35
+ override.returns(
36
+ {
37
+ product_id: String,
38
+ id: String,
39
+ request_options: Dodopayments::RequestOptions
40
+ }
41
+ )
42
+ end
43
+ def to_hash
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,62 @@
1
+ # typed: strong
2
+
3
+ module Dodopayments
4
+ module Models
5
+ module Products
6
+ class LocalizedPriceUpdateParams < Dodopayments::Internal::Type::BaseModel
7
+ extend Dodopayments::Internal::Type::RequestParameters::Converter
8
+ include Dodopayments::Internal::Type::RequestParameters
9
+
10
+ OrHash =
11
+ T.type_alias do
12
+ T.any(
13
+ Dodopayments::Products::LocalizedPriceUpdateParams,
14
+ Dodopayments::Internal::AnyHash
15
+ )
16
+ end
17
+
18
+ sig { returns(String) }
19
+ attr_accessor :product_id
20
+
21
+ sig { returns(String) }
22
+ attr_accessor :id
23
+
24
+ # New amount in the smallest currency unit (e.g., cents). Must be greater than
25
+ # zero. The currency and country_code of an existing rule cannot be changed.
26
+ sig { returns(T.nilable(Integer)) }
27
+ attr_accessor :amount
28
+
29
+ sig do
30
+ params(
31
+ product_id: String,
32
+ id: String,
33
+ amount: T.nilable(Integer),
34
+ request_options: Dodopayments::RequestOptions::OrHash
35
+ ).returns(T.attached_class)
36
+ end
37
+ def self.new(
38
+ product_id:,
39
+ id:,
40
+ # New amount in the smallest currency unit (e.g., cents). Must be greater than
41
+ # zero. The currency and country_code of an existing rule cannot be changed.
42
+ amount: nil,
43
+ request_options: {}
44
+ )
45
+ end
46
+
47
+ sig do
48
+ override.returns(
49
+ {
50
+ product_id: String,
51
+ id: String,
52
+ amount: T.nilable(Integer),
53
+ request_options: Dodopayments::RequestOptions
54
+ }
55
+ )
56
+ end
57
+ def to_hash
58
+ end
59
+ end
60
+ end
61
+ end
62
+ end
@@ -0,0 +1,28 @@
1
+ # typed: strong
2
+
3
+ module Dodopayments
4
+ module Models
5
+ module Products
6
+ module PricingMode
7
+ extend Dodopayments::Internal::Type::Enum
8
+
9
+ TaggedSymbol =
10
+ T.type_alias { T.all(Symbol, Dodopayments::Products::PricingMode) }
11
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
12
+
13
+ BY_CURRENCY =
14
+ T.let(:by_currency, Dodopayments::Products::PricingMode::TaggedSymbol)
15
+ BY_COUNTRY =
16
+ T.let(:by_country, Dodopayments::Products::PricingMode::TaggedSymbol)
17
+
18
+ sig do
19
+ override.returns(
20
+ T::Array[Dodopayments::Products::PricingMode::TaggedSymbol]
21
+ )
22
+ end
23
+ def self.values
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -310,6 +310,12 @@ module Dodopayments
310
310
 
311
311
  LicenseValidateParams = Dodopayments::Models::LicenseValidateParams
312
312
 
313
+ Metadata =
314
+ T.let(
315
+ Dodopayments::Models::Metadata,
316
+ Dodopayments::Internal::Type::Converter
317
+ )
318
+
313
319
  Meter = Dodopayments::Models::Meter
314
320
 
315
321
  MeterAggregation = Dodopayments::Models::MeterAggregation
@@ -116,7 +116,11 @@ module Dodopayments
116
116
  request_options: Dodopayments::RequestOptions::OrHash
117
117
  ).returns(Dodopayments::CheckoutSessionStatus)
118
118
  end
119
- def retrieve(id, request_options: {})
119
+ def retrieve(
120
+ # Checkout Session ID
121
+ id,
122
+ request_options: {}
123
+ )
120
124
  end
121
125
 
122
126
  sig do
@@ -35,6 +35,34 @@ module Dodopayments
35
35
  )
36
36
  end
37
37
 
38
+ # For entitlements whose license-key config uses `manual` fulfillment, grants are
39
+ # created in the `pending` state without a key. Call this endpoint to deliver the
40
+ # key: the grant moves to `delivered`, the customer is emailed the key, and the
41
+ # `license_key.created` and `entitlement_grant.delivered` webhook events are sent.
42
+ sig do
43
+ params(
44
+ grant_id: String,
45
+ key: String,
46
+ activations_limit: T.nilable(Integer),
47
+ expires_at: T.nilable(Time),
48
+ request_options: Dodopayments::RequestOptions::OrHash
49
+ ).returns(Dodopayments::Entitlements::EntitlementGrant)
50
+ end
51
+ def fulfill_license_key(
52
+ # Grant ID
53
+ grant_id,
54
+ # The license key value to deliver to the customer.
55
+ key:,
56
+ # Per-key activation limit. Defaults to the entitlement's license-key
57
+ # configuration.
58
+ activations_limit: nil,
59
+ # When the key expires. Defaults to the duration in the entitlement's license-key
60
+ # configuration.
61
+ expires_at: nil,
62
+ request_options: {}
63
+ )
64
+ end
65
+
38
66
  # Revoke a single grant. Idempotent: re-revoking an already-revoked grant returns
39
67
  # the grant in its current state.
40
68
  sig do
@@ -10,7 +10,11 @@ module Dodopayments
10
10
  request_options: Dodopayments::RequestOptions::OrHash
11
11
  ).returns(StringIO)
12
12
  end
13
- def retrieve(payment_id, request_options: {})
13
+ def retrieve(
14
+ # Payment ID
15
+ payment_id,
16
+ request_options: {}
17
+ )
14
18
  end
15
19
 
16
20
  sig do
@@ -19,7 +23,11 @@ module Dodopayments
19
23
  request_options: Dodopayments::RequestOptions::OrHash
20
24
  ).returns(StringIO)
21
25
  end
22
- def retrieve_payout(payout_id, request_options: {})
26
+ def retrieve_payout(
27
+ # Payout ID
28
+ payout_id,
29
+ request_options: {}
30
+ )
23
31
  end
24
32
 
25
33
  sig do
@@ -28,7 +36,11 @@ module Dodopayments
28
36
  request_options: Dodopayments::RequestOptions::OrHash
29
37
  ).returns(StringIO)
30
38
  end
31
- def retrieve_refund(refund_id, request_options: {})
39
+ def retrieve_refund(
40
+ # Refund ID
41
+ refund_id,
42
+ request_options: {}
43
+ )
32
44
  end
33
45
 
34
46
  # @api private