dodopayments 1.52.4 → 1.52.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f8b3375383dfb63c0a529779a6560ff9d2a06b4ee263eab32ef541a378c966d8
4
- data.tar.gz: 8e20558f9600b21c48a0d8723693fc424b6ecacb65bb978c97c795cd3a38114c
3
+ metadata.gz: 90035c1d14b5aa55b3c8e33db01257b8f45bb2636259d2aca65d08f77a8303b2
4
+ data.tar.gz: 17bb0b417c9f606ee48df9a06bec7ecf9b8d7b1985146d6c03190509aeddc775
5
5
  SHA512:
6
- metadata.gz: ea75a705c5089e059f612eb7e2eea38a39ac2581fa81d00c36132d6e0046a3f4886144ff995b0d32ce667c79d1b73e226bf3b225e6165c08c9a10976d994a9cc
7
- data.tar.gz: 657b089c1f4a37dbd0c704f1331f5b6b2b49c8ab003138562b81143a9753be721f9a491ffe0dab3d0361ab457e3c7ab0ba239edf5964cc02cb5876009941e90c
6
+ metadata.gz: 193a65895d8e20cf1f818a6ea8f725a00a0bffefeaaf46def43ec2f1c64fb4662e1c845cda63e72fa4f4df6e4ecbd485fe4153ddc4c7ea6d4333380002300b6a
7
+ data.tar.gz: 6a50f094b283c7d173271bba624b2cd95346f9519dc9f051d404e90852def09a57011afdb47f7765057cb915cf3197f8651e5109ea9cac8f09a85ab45791b4c6
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.52.5 (2025-09-04)
4
+
5
+ Full Changelog: [v1.52.4...v1.52.5](https://github.com/dodopayments/dodopayments-ruby/compare/v1.52.4...v1.52.5)
6
+
7
+ ### Features
8
+
9
+ * **api:** updated openapi spec to v1.52.4 ([49331b8](https://github.com/dodopayments/dodopayments-ruby/commit/49331b8c97f7995f20e6428fb6d0e2f8f567273e))
10
+
3
11
  ## 1.52.4 (2025-09-03)
4
12
 
5
13
  Full Changelog: [v1.51.1...v1.52.4](https://github.com/dodopayments/dodopayments-ruby/compare/v1.51.1...v1.52.4)
data/README.md CHANGED
@@ -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.52.4"
20
+ gem "dodopayments", "~> 1.52.5"
21
21
  ```
22
22
 
23
23
  <!-- x-release-please-end -->
@@ -28,7 +28,6 @@ module Dodopayments
28
28
 
29
29
  COUNT = :count
30
30
  SUM = :sum
31
- UNIQUE_COUNT = :unique_count
32
31
  MAX = :max
33
32
  LAST = :last
34
33
 
@@ -117,6 +117,13 @@ module Dodopayments
117
117
  # @return [String, nil]
118
118
  optional :card_type, String, nil?: true
119
119
 
120
+ # @!attribute checkout_session_id
121
+ # If payment is made using a checkout session, this field is set to the id of the
122
+ # session.
123
+ #
124
+ # @return [String, nil]
125
+ optional :checkout_session_id, String, nil?: true
126
+
120
127
  # @!attribute discount_id
121
128
  # The discount id if discount is applied
122
129
  #
@@ -193,7 +200,7 @@ module Dodopayments
193
200
  # @return [Time, nil]
194
201
  optional :updated_at, Time, nil?: true
195
202
 
196
- # @!method initialize(billing:, brand_id:, business_id:, created_at:, currency:, customer:, digital_products_delivered:, disputes:, metadata:, payment_id:, refunds:, settlement_amount:, settlement_currency:, total_amount:, card_issuing_country: nil, card_last_four: nil, card_network: nil, card_type: nil, discount_id: nil, error_code: nil, error_message: nil, payment_link: nil, payment_method: nil, payment_method_type: nil, product_cart: nil, settlement_tax: nil, status: nil, subscription_id: nil, tax: nil, updated_at: nil)
203
+ # @!method initialize(billing:, brand_id:, business_id:, created_at:, currency:, customer:, digital_products_delivered:, disputes:, metadata:, payment_id:, refunds:, settlement_amount:, settlement_currency:, total_amount:, card_issuing_country: nil, card_last_four: nil, card_network: nil, card_type: nil, checkout_session_id: nil, discount_id: nil, error_code: nil, error_message: nil, payment_link: nil, payment_method: nil, payment_method_type: nil, product_cart: nil, settlement_tax: nil, status: nil, subscription_id: nil, tax: nil, updated_at: nil)
197
204
  # Some parameter documentations has been truncated, see
198
205
  # {Dodopayments::Models::Payment} for more details.
199
206
  #
@@ -233,6 +240,8 @@ module Dodopayments
233
240
  #
234
241
  # @param card_type [String, nil] The type of card DEBIT or CREDIT
235
242
  #
243
+ # @param checkout_session_id [String, nil] If payment is made using a checkout session,
244
+ #
236
245
  # @param discount_id [String, nil] The discount id if discount is applied
237
246
  #
238
247
  # @param error_code [String, nil] An error code if the payment failed
@@ -46,6 +46,12 @@ module Dodopayments
46
46
  # @return [Hash{Symbol=>String}]
47
47
  required :metadata, Dodopayments::Internal::Type::HashOf[String]
48
48
 
49
+ # @!attribute meters
50
+ # Meters associated with this subscription (for usage-based billing)
51
+ #
52
+ # @return [Array<Dodopayments::Models::Subscription::Meter>]
53
+ required :meters, -> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::Subscription::Meter] }
54
+
49
55
  # @!attribute next_billing_date
50
56
  # Timestamp of the next scheduled billing. Indicates the end of current billing
51
57
  # period
@@ -156,7 +162,7 @@ module Dodopayments
156
162
  # @return [Time, nil]
157
163
  optional :expires_at, Time, nil?: true
158
164
 
159
- # @!method initialize(addons:, billing:, cancel_at_next_billing_date:, created_at:, currency:, customer:, metadata:, next_billing_date:, on_demand:, payment_frequency_count:, payment_frequency_interval:, previous_billing_date:, product_id:, quantity:, recurring_pre_tax_amount:, status:, subscription_id:, subscription_period_count:, subscription_period_interval:, tax_inclusive:, trial_period_days:, cancelled_at: nil, discount_cycles_remaining: nil, discount_id: nil, expires_at: nil)
165
+ # @!method initialize(addons:, billing:, cancel_at_next_billing_date:, created_at:, currency:, customer:, metadata:, meters:, next_billing_date:, on_demand:, payment_frequency_count:, payment_frequency_interval:, previous_billing_date:, product_id:, quantity:, recurring_pre_tax_amount:, status:, subscription_id:, subscription_period_count:, subscription_period_interval:, tax_inclusive:, trial_period_days:, cancelled_at: nil, discount_cycles_remaining: nil, discount_id: nil, expires_at: nil)
160
166
  # Some parameter documentations has been truncated, see
161
167
  # {Dodopayments::Models::Subscription} for more details.
162
168
  #
@@ -176,6 +182,8 @@ module Dodopayments
176
182
  #
177
183
  # @param metadata [Hash{Symbol=>String}] Additional custom data associated with the subscription
178
184
  #
185
+ # @param meters [Array<Dodopayments::Models::Subscription::Meter>] Meters associated with this subscription (for usage-based billing)
186
+ #
179
187
  # @param next_billing_date [Time] Timestamp of the next scheduled billing. Indicates the end of current billing pe
180
188
  #
181
189
  # @param on_demand [Boolean] Wether the subscription is on-demand or not
@@ -211,6 +219,54 @@ module Dodopayments
211
219
  # @param discount_id [String, nil] The discount id if discount is applied
212
220
  #
213
221
  # @param expires_at [Time, nil] Timestamp when the subscription will expire
222
+
223
+ class Meter < Dodopayments::Internal::Type::BaseModel
224
+ # @!attribute currency
225
+ #
226
+ # @return [Symbol, Dodopayments::Models::Currency]
227
+ required :currency, enum: -> { Dodopayments::Currency }
228
+
229
+ # @!attribute free_threshold
230
+ #
231
+ # @return [Integer]
232
+ required :free_threshold, Integer
233
+
234
+ # @!attribute measurement_unit
235
+ #
236
+ # @return [String]
237
+ required :measurement_unit, String
238
+
239
+ # @!attribute meter_id
240
+ #
241
+ # @return [String]
242
+ required :meter_id, String
243
+
244
+ # @!attribute name
245
+ #
246
+ # @return [String]
247
+ required :name, String
248
+
249
+ # @!attribute price_per_unit
250
+ #
251
+ # @return [String]
252
+ required :price_per_unit, String
253
+
254
+ # @!attribute description
255
+ #
256
+ # @return [String, nil]
257
+ optional :description, String, nil?: true
258
+
259
+ # @!method initialize(currency:, free_threshold:, measurement_unit:, meter_id:, name:, price_per_unit:, description: nil)
260
+ # Response struct representing usage-based meter cart details for a subscription
261
+ #
262
+ # @param currency [Symbol, Dodopayments::Models::Currency]
263
+ # @param free_threshold [Integer]
264
+ # @param measurement_unit [String]
265
+ # @param meter_id [String]
266
+ # @param name [String]
267
+ # @param price_per_unit [String]
268
+ # @param description [String, nil]
269
+ end
214
270
  end
215
271
  end
216
272
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dodopayments
4
- VERSION = "1.52.4"
4
+ VERSION = "1.52.5"
5
5
  end
@@ -52,11 +52,6 @@ module Dodopayments
52
52
  COUNT =
53
53
  T.let(:count, Dodopayments::MeterAggregation::Type::TaggedSymbol)
54
54
  SUM = T.let(:sum, Dodopayments::MeterAggregation::Type::TaggedSymbol)
55
- UNIQUE_COUNT =
56
- T.let(
57
- :unique_count,
58
- Dodopayments::MeterAggregation::Type::TaggedSymbol
59
- )
60
55
  MAX = T.let(:max, Dodopayments::MeterAggregation::Type::TaggedSymbol)
61
56
  LAST = T.let(:last, Dodopayments::MeterAggregation::Type::TaggedSymbol)
62
57
 
@@ -93,6 +93,11 @@ module Dodopayments
93
93
  sig { returns(T.nilable(String)) }
94
94
  attr_accessor :card_type
95
95
 
96
+ # If payment is made using a checkout session, this field is set to the id of the
97
+ # session.
98
+ sig { returns(T.nilable(String)) }
99
+ attr_accessor :checkout_session_id
100
+
96
101
  # The discount id if discount is applied
97
102
  sig { returns(T.nilable(String)) }
98
103
  attr_accessor :discount_id
@@ -163,6 +168,7 @@ module Dodopayments
163
168
  card_last_four: T.nilable(String),
164
169
  card_network: T.nilable(String),
165
170
  card_type: T.nilable(String),
171
+ checkout_session_id: T.nilable(String),
166
172
  discount_id: T.nilable(String),
167
173
  error_code: T.nilable(String),
168
174
  error_message: T.nilable(String),
@@ -220,6 +226,9 @@ module Dodopayments
220
226
  card_network: nil,
221
227
  # The type of card DEBIT or CREDIT
222
228
  card_type: nil,
229
+ # If payment is made using a checkout session, this field is set to the id of the
230
+ # session.
231
+ checkout_session_id: nil,
223
232
  # The discount id if discount is applied
224
233
  discount_id: nil,
225
234
  # An error code if the payment failed
@@ -271,6 +280,7 @@ module Dodopayments
271
280
  card_last_four: T.nilable(String),
272
281
  card_network: T.nilable(String),
273
282
  card_type: T.nilable(String),
283
+ checkout_session_id: T.nilable(String),
274
284
  discount_id: T.nilable(String),
275
285
  error_code: T.nilable(String),
276
286
  error_message: T.nilable(String),
@@ -44,6 +44,10 @@ module Dodopayments
44
44
  sig { returns(T::Hash[Symbol, String]) }
45
45
  attr_accessor :metadata
46
46
 
47
+ # Meters associated with this subscription (for usage-based billing)
48
+ sig { returns(T::Array[Dodopayments::Subscription::Meter]) }
49
+ attr_accessor :meters
50
+
47
51
  # Timestamp of the next scheduled billing. Indicates the end of current billing
48
52
  # period
49
53
  sig { returns(Time) }
@@ -128,6 +132,7 @@ module Dodopayments
128
132
  currency: Dodopayments::Currency::OrSymbol,
129
133
  customer: Dodopayments::CustomerLimitedDetails::OrHash,
130
134
  metadata: T::Hash[Symbol, String],
135
+ meters: T::Array[Dodopayments::Subscription::Meter::OrHash],
131
136
  next_billing_date: Time,
132
137
  on_demand: T::Boolean,
133
138
  payment_frequency_count: Integer,
@@ -163,6 +168,8 @@ module Dodopayments
163
168
  customer:,
164
169
  # Additional custom data associated with the subscription
165
170
  metadata:,
171
+ # Meters associated with this subscription (for usage-based billing)
172
+ meters:,
166
173
  # Timestamp of the next scheduled billing. Indicates the end of current billing
167
174
  # period
168
175
  next_billing_date:,
@@ -214,6 +221,7 @@ module Dodopayments
214
221
  currency: Dodopayments::Currency::TaggedSymbol,
215
222
  customer: Dodopayments::CustomerLimitedDetails,
216
223
  metadata: T::Hash[Symbol, String],
224
+ meters: T::Array[Dodopayments::Subscription::Meter],
217
225
  next_billing_date: Time,
218
226
  on_demand: T::Boolean,
219
227
  payment_frequency_count: Integer,
@@ -239,6 +247,76 @@ module Dodopayments
239
247
  end
240
248
  def to_hash
241
249
  end
250
+
251
+ class Meter < Dodopayments::Internal::Type::BaseModel
252
+ OrHash =
253
+ T.type_alias do
254
+ T.any(
255
+ Dodopayments::Subscription::Meter,
256
+ Dodopayments::Internal::AnyHash
257
+ )
258
+ end
259
+
260
+ sig { returns(Dodopayments::Currency::TaggedSymbol) }
261
+ attr_accessor :currency
262
+
263
+ sig { returns(Integer) }
264
+ attr_accessor :free_threshold
265
+
266
+ sig { returns(String) }
267
+ attr_accessor :measurement_unit
268
+
269
+ sig { returns(String) }
270
+ attr_accessor :meter_id
271
+
272
+ sig { returns(String) }
273
+ attr_accessor :name
274
+
275
+ sig { returns(String) }
276
+ attr_accessor :price_per_unit
277
+
278
+ sig { returns(T.nilable(String)) }
279
+ attr_accessor :description
280
+
281
+ # Response struct representing usage-based meter cart details for a subscription
282
+ sig do
283
+ params(
284
+ currency: Dodopayments::Currency::OrSymbol,
285
+ free_threshold: Integer,
286
+ measurement_unit: String,
287
+ meter_id: String,
288
+ name: String,
289
+ price_per_unit: String,
290
+ description: T.nilable(String)
291
+ ).returns(T.attached_class)
292
+ end
293
+ def self.new(
294
+ currency:,
295
+ free_threshold:,
296
+ measurement_unit:,
297
+ meter_id:,
298
+ name:,
299
+ price_per_unit:,
300
+ description: nil
301
+ )
302
+ end
303
+
304
+ sig do
305
+ override.returns(
306
+ {
307
+ currency: Dodopayments::Currency::TaggedSymbol,
308
+ free_threshold: Integer,
309
+ measurement_unit: String,
310
+ meter_id: String,
311
+ name: String,
312
+ price_per_unit: String,
313
+ description: T.nilable(String)
314
+ }
315
+ )
316
+ end
317
+ def to_hash
318
+ end
319
+ end
242
320
  end
243
321
  end
244
322
  end
@@ -18,14 +18,13 @@ module Dodopayments
18
18
  key: String?
19
19
  }
20
20
 
21
- type type_ = :count | :sum | :unique_count | :max | :last
21
+ type type_ = :count | :sum | :max | :last
22
22
 
23
23
  module Type
24
24
  extend Dodopayments::Internal::Type::Enum
25
25
 
26
26
  COUNT: :count
27
27
  SUM: :sum
28
- UNIQUE_COUNT: :unique_count
29
28
  MAX: :max
30
29
  LAST: :last
31
30
 
@@ -20,6 +20,7 @@ module Dodopayments
20
20
  card_last_four: String?,
21
21
  card_network: String?,
22
22
  card_type: String?,
23
+ checkout_session_id: String?,
23
24
  discount_id: String?,
24
25
  error_code: String?,
25
26
  error_message: String?,
@@ -71,6 +72,8 @@ module Dodopayments
71
72
 
72
73
  attr_accessor card_type: String?
73
74
 
75
+ attr_accessor checkout_session_id: String?
76
+
74
77
  attr_accessor discount_id: String?
75
78
 
76
79
  attr_accessor error_code: String?
@@ -114,6 +117,7 @@ module Dodopayments
114
117
  ?card_last_four: String?,
115
118
  ?card_network: String?,
116
119
  ?card_type: String?,
120
+ ?checkout_session_id: String?,
117
121
  ?discount_id: String?,
118
122
  ?error_code: String?,
119
123
  ?error_message: String?,
@@ -147,6 +151,7 @@ module Dodopayments
147
151
  card_last_four: String?,
148
152
  card_network: String?,
149
153
  card_type: String?,
154
+ checkout_session_id: String?,
150
155
  discount_id: String?,
151
156
  error_code: String?,
152
157
  error_message: String?,
@@ -9,6 +9,7 @@ module Dodopayments
9
9
  currency: Dodopayments::Models::currency,
10
10
  customer: Dodopayments::CustomerLimitedDetails,
11
11
  metadata: ::Hash[Symbol, String],
12
+ meters: ::Array[Dodopayments::Subscription::Meter],
12
13
  next_billing_date: Time,
13
14
  on_demand: bool,
14
15
  payment_frequency_count: Integer,
@@ -44,6 +45,8 @@ module Dodopayments
44
45
 
45
46
  attr_accessor metadata: ::Hash[Symbol, String]
46
47
 
48
+ attr_accessor meters: ::Array[Dodopayments::Subscription::Meter]
49
+
47
50
  attr_accessor next_billing_date: Time
48
51
 
49
52
  attr_accessor on_demand: bool
@@ -88,6 +91,7 @@ module Dodopayments
88
91
  currency: Dodopayments::Models::currency,
89
92
  customer: Dodopayments::CustomerLimitedDetails,
90
93
  metadata: ::Hash[Symbol, String],
94
+ meters: ::Array[Dodopayments::Subscription::Meter],
91
95
  next_billing_date: Time,
92
96
  on_demand: bool,
93
97
  payment_frequency_count: Integer,
@@ -116,6 +120,7 @@ module Dodopayments
116
120
  currency: Dodopayments::Models::currency,
117
121
  customer: Dodopayments::CustomerLimitedDetails,
118
122
  metadata: ::Hash[Symbol, String],
123
+ meters: ::Array[Dodopayments::Subscription::Meter],
119
124
  next_billing_date: Time,
120
125
  on_demand: bool,
121
126
  payment_frequency_count: Integer,
@@ -135,6 +140,53 @@ module Dodopayments
135
140
  discount_id: String?,
136
141
  expires_at: Time?
137
142
  }
143
+
144
+ type meter =
145
+ {
146
+ currency: Dodopayments::Models::currency,
147
+ free_threshold: Integer,
148
+ measurement_unit: String,
149
+ meter_id: String,
150
+ name: String,
151
+ price_per_unit: String,
152
+ description: String?
153
+ }
154
+
155
+ class Meter < Dodopayments::Internal::Type::BaseModel
156
+ attr_accessor currency: Dodopayments::Models::currency
157
+
158
+ attr_accessor free_threshold: Integer
159
+
160
+ attr_accessor measurement_unit: String
161
+
162
+ attr_accessor meter_id: String
163
+
164
+ attr_accessor name: String
165
+
166
+ attr_accessor price_per_unit: String
167
+
168
+ attr_accessor description: String?
169
+
170
+ def initialize: (
171
+ currency: Dodopayments::Models::currency,
172
+ free_threshold: Integer,
173
+ measurement_unit: String,
174
+ meter_id: String,
175
+ name: String,
176
+ price_per_unit: String,
177
+ ?description: String?
178
+ ) -> void
179
+
180
+ def to_hash: -> {
181
+ currency: Dodopayments::Models::currency,
182
+ free_threshold: Integer,
183
+ measurement_unit: String,
184
+ meter_id: String,
185
+ name: String,
186
+ price_per_unit: String,
187
+ description: String?
188
+ }
189
+ end
138
190
  end
139
191
  end
140
192
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dodopayments
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.52.4
4
+ version: 1.52.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dodo Payments
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-09-03 00:00:00.000000000 Z
11
+ date: 2025-09-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: connection_pool