dodopayments 1.52.4 → 1.53.2

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 (63) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +16 -0
  3. data/README.md +1 -1
  4. data/lib/dodopayments/models/customers/customer_wallet.rb +43 -0
  5. data/lib/dodopayments/models/customers/wallet_list_params.rb +16 -0
  6. data/lib/dodopayments/models/customers/wallet_list_response.rb +26 -0
  7. data/lib/dodopayments/models/customers/wallets/customer_wallet_transaction.rb +102 -0
  8. data/lib/dodopayments/models/customers/wallets/ledger_entry_create_params.rb +67 -0
  9. data/lib/dodopayments/models/customers/wallets/ledger_entry_list_params.rb +40 -0
  10. data/lib/dodopayments/models/license_activate_response.rb +87 -0
  11. data/lib/dodopayments/models/meter_aggregation.rb +0 -1
  12. data/lib/dodopayments/models/payment.rb +88 -4
  13. data/lib/dodopayments/models/refund.rb +9 -1
  14. data/lib/dodopayments/models/refund_list_response.rb +81 -0
  15. data/lib/dodopayments/models/subscription.rb +57 -1
  16. data/lib/dodopayments/models/subscription_charge_params.rb +32 -1
  17. data/lib/dodopayments/resources/customers/wallets/ledger_entries.rb +75 -0
  18. data/lib/dodopayments/resources/customers/wallets.rb +38 -0
  19. data/lib/dodopayments/resources/customers.rb +4 -0
  20. data/lib/dodopayments/resources/licenses.rb +2 -2
  21. data/lib/dodopayments/resources/refunds.rb +2 -2
  22. data/lib/dodopayments/resources/subscriptions.rb +3 -1
  23. data/lib/dodopayments/version.rb +1 -1
  24. data/lib/dodopayments.rb +10 -0
  25. data/rbi/dodopayments/models/customers/customer_wallet.rbi +66 -0
  26. data/rbi/dodopayments/models/customers/wallet_list_params.rbi +34 -0
  27. data/rbi/dodopayments/models/customers/wallet_list_response.rbi +48 -0
  28. data/rbi/dodopayments/models/customers/wallets/customer_wallet_transaction.rbi +173 -0
  29. data/rbi/dodopayments/models/customers/wallets/ledger_entry_create_params.rbi +119 -0
  30. data/rbi/dodopayments/models/customers/wallets/ledger_entry_list_params.rbi +71 -0
  31. data/rbi/dodopayments/models/license_activate_response.rbi +140 -0
  32. data/rbi/dodopayments/models/meter_aggregation.rbi +0 -5
  33. data/rbi/dodopayments/models/payment.rbi +112 -3
  34. data/rbi/dodopayments/models/refund.rbi +13 -0
  35. data/rbi/dodopayments/models/refund_list_response.rbi +104 -0
  36. data/rbi/dodopayments/models/subscription.rbi +78 -0
  37. data/rbi/dodopayments/models/subscription_charge_params.rbi +74 -0
  38. data/rbi/dodopayments/resources/customers/wallets/ledger_entries.rbi +67 -0
  39. data/rbi/dodopayments/resources/customers/wallets.rbi +32 -0
  40. data/rbi/dodopayments/resources/customers.rbi +3 -0
  41. data/rbi/dodopayments/resources/licenses.rbi +1 -1
  42. data/rbi/dodopayments/resources/refunds.rbi +1 -1
  43. data/rbi/dodopayments/resources/subscriptions.rbi +6 -0
  44. data/sig/dodopayments/models/customers/customer_wallet.rbs +44 -0
  45. data/sig/dodopayments/models/customers/wallet_list_params.rbs +17 -0
  46. data/sig/dodopayments/models/customers/wallet_list_response.rbs +27 -0
  47. data/sig/dodopayments/models/customers/wallets/customer_wallet_transaction.rbs +102 -0
  48. data/sig/dodopayments/models/customers/wallets/ledger_entry_create_params.rbs +61 -0
  49. data/sig/dodopayments/models/customers/wallets/ledger_entry_list_params.rbs +48 -0
  50. data/sig/dodopayments/models/license_activate_response.rbs +62 -0
  51. data/sig/dodopayments/models/meter_aggregation.rbs +1 -2
  52. data/sig/dodopayments/models/payment.rbs +66 -4
  53. data/sig/dodopayments/models/refund.rbs +5 -0
  54. data/sig/dodopayments/models/refund_list_response.rbs +60 -0
  55. data/sig/dodopayments/models/subscription.rbs +52 -0
  56. data/sig/dodopayments/models/subscription_charge_params.rbs +27 -0
  57. data/sig/dodopayments/resources/customers/wallets/ledger_entries.rbs +29 -0
  58. data/sig/dodopayments/resources/customers/wallets.rbs +16 -0
  59. data/sig/dodopayments/resources/customers.rbs +2 -0
  60. data/sig/dodopayments/resources/licenses.rbs +1 -1
  61. data/sig/dodopayments/resources/refunds.rbs +1 -1
  62. data/sig/dodopayments/resources/subscriptions.rbs +1 -0
  63. metadata +32 -2
@@ -0,0 +1,102 @@
1
+ module Dodopayments
2
+ module Models
3
+ module Customers
4
+ module Wallets
5
+ type customer_wallet_transaction =
6
+ {
7
+ id: String,
8
+ after_balance: Integer,
9
+ amount: Integer,
10
+ before_balance: Integer,
11
+ business_id: String,
12
+ created_at: Time,
13
+ currency: Dodopayments::Models::currency,
14
+ customer_id: String,
15
+ event_type: Dodopayments::Models::Customers::Wallets::CustomerWalletTransaction::event_type,
16
+ is_credit: bool,
17
+ reason: String?,
18
+ reference_object_id: String?
19
+ }
20
+
21
+ class CustomerWalletTransaction < Dodopayments::Internal::Type::BaseModel
22
+ attr_accessor id: String
23
+
24
+ attr_accessor after_balance: Integer
25
+
26
+ attr_accessor amount: Integer
27
+
28
+ attr_accessor before_balance: Integer
29
+
30
+ attr_accessor business_id: String
31
+
32
+ attr_accessor created_at: Time
33
+
34
+ attr_accessor currency: Dodopayments::Models::currency
35
+
36
+ attr_accessor customer_id: String
37
+
38
+ attr_accessor event_type: Dodopayments::Models::Customers::Wallets::CustomerWalletTransaction::event_type
39
+
40
+ attr_accessor is_credit: bool
41
+
42
+ attr_accessor reason: String?
43
+
44
+ attr_accessor reference_object_id: String?
45
+
46
+ def initialize: (
47
+ id: String,
48
+ after_balance: Integer,
49
+ amount: Integer,
50
+ before_balance: Integer,
51
+ business_id: String,
52
+ created_at: Time,
53
+ currency: Dodopayments::Models::currency,
54
+ customer_id: String,
55
+ event_type: Dodopayments::Models::Customers::Wallets::CustomerWalletTransaction::event_type,
56
+ is_credit: bool,
57
+ ?reason: String?,
58
+ ?reference_object_id: String?
59
+ ) -> void
60
+
61
+ def to_hash: -> {
62
+ id: String,
63
+ after_balance: Integer,
64
+ amount: Integer,
65
+ before_balance: Integer,
66
+ business_id: String,
67
+ created_at: Time,
68
+ currency: Dodopayments::Models::currency,
69
+ customer_id: String,
70
+ event_type: Dodopayments::Models::Customers::Wallets::CustomerWalletTransaction::event_type,
71
+ is_credit: bool,
72
+ reason: String?,
73
+ reference_object_id: String?
74
+ }
75
+
76
+ type event_type =
77
+ :payment
78
+ | :payment_reversal
79
+ | :refund
80
+ | :refund_reversal
81
+ | :dispute
82
+ | :dispute_reversal
83
+ | :merchant_adjustment
84
+
85
+ module EventType
86
+ extend Dodopayments::Internal::Type::Enum
87
+
88
+ PAYMENT: :payment
89
+ PAYMENT_REVERSAL: :payment_reversal
90
+ REFUND: :refund
91
+ REFUND_REVERSAL: :refund_reversal
92
+ DISPUTE: :dispute
93
+ DISPUTE_REVERSAL: :dispute_reversal
94
+ MERCHANT_ADJUSTMENT: :merchant_adjustment
95
+
96
+ def self?.values: -> ::Array[Dodopayments::Models::Customers::Wallets::CustomerWalletTransaction::event_type]
97
+ end
98
+ end
99
+ end
100
+ end
101
+ end
102
+ end
@@ -0,0 +1,61 @@
1
+ module Dodopayments
2
+ module Models
3
+ module Customers
4
+ module Wallets
5
+ type ledger_entry_create_params =
6
+ {
7
+ amount: Integer,
8
+ currency: Dodopayments::Models::currency,
9
+ entry_type: Dodopayments::Models::Customers::Wallets::LedgerEntryCreateParams::entry_type,
10
+ idempotency_key: String?,
11
+ reason: String?
12
+ }
13
+ & Dodopayments::Internal::Type::request_parameters
14
+
15
+ class LedgerEntryCreateParams < Dodopayments::Internal::Type::BaseModel
16
+ extend Dodopayments::Internal::Type::RequestParameters::Converter
17
+ include Dodopayments::Internal::Type::RequestParameters
18
+
19
+ attr_accessor amount: Integer
20
+
21
+ attr_accessor currency: Dodopayments::Models::currency
22
+
23
+ attr_accessor entry_type: Dodopayments::Models::Customers::Wallets::LedgerEntryCreateParams::entry_type
24
+
25
+ attr_accessor idempotency_key: String?
26
+
27
+ attr_accessor reason: String?
28
+
29
+ def initialize: (
30
+ amount: Integer,
31
+ currency: Dodopayments::Models::currency,
32
+ entry_type: Dodopayments::Models::Customers::Wallets::LedgerEntryCreateParams::entry_type,
33
+ ?idempotency_key: String?,
34
+ ?reason: String?,
35
+ ?request_options: Dodopayments::request_opts
36
+ ) -> void
37
+
38
+ def to_hash: -> {
39
+ amount: Integer,
40
+ currency: Dodopayments::Models::currency,
41
+ entry_type: Dodopayments::Models::Customers::Wallets::LedgerEntryCreateParams::entry_type,
42
+ idempotency_key: String?,
43
+ reason: String?,
44
+ request_options: Dodopayments::RequestOptions
45
+ }
46
+
47
+ type entry_type = :credit | :debit
48
+
49
+ module EntryType
50
+ extend Dodopayments::Internal::Type::Enum
51
+
52
+ CREDIT: :credit
53
+ DEBIT: :debit
54
+
55
+ def self?.values: -> ::Array[Dodopayments::Models::Customers::Wallets::LedgerEntryCreateParams::entry_type]
56
+ end
57
+ end
58
+ end
59
+ end
60
+ end
61
+ end
@@ -0,0 +1,48 @@
1
+ module Dodopayments
2
+ module Models
3
+ module Customers
4
+ module Wallets
5
+ type ledger_entry_list_params =
6
+ {
7
+ currency: Dodopayments::Models::currency,
8
+ page_number: Integer,
9
+ page_size: Integer
10
+ }
11
+ & Dodopayments::Internal::Type::request_parameters
12
+
13
+ class LedgerEntryListParams < Dodopayments::Internal::Type::BaseModel
14
+ extend Dodopayments::Internal::Type::RequestParameters::Converter
15
+ include Dodopayments::Internal::Type::RequestParameters
16
+
17
+ attr_reader currency: Dodopayments::Models::currency?
18
+
19
+ def currency=: (
20
+ Dodopayments::Models::currency
21
+ ) -> Dodopayments::Models::currency
22
+
23
+ attr_reader page_number: Integer?
24
+
25
+ def page_number=: (Integer) -> Integer
26
+
27
+ attr_reader page_size: Integer?
28
+
29
+ def page_size=: (Integer) -> Integer
30
+
31
+ def initialize: (
32
+ ?currency: Dodopayments::Models::currency,
33
+ ?page_number: Integer,
34
+ ?page_size: Integer,
35
+ ?request_options: Dodopayments::request_opts
36
+ ) -> void
37
+
38
+ def to_hash: -> {
39
+ currency: Dodopayments::Models::currency,
40
+ page_number: Integer,
41
+ page_size: Integer,
42
+ request_options: Dodopayments::RequestOptions
43
+ }
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,62 @@
1
+ module Dodopayments
2
+ module Models
3
+ type license_activate_response =
4
+ {
5
+ id: String,
6
+ business_id: String,
7
+ created_at: Time,
8
+ customer: Dodopayments::CustomerLimitedDetails,
9
+ license_key_id: String,
10
+ name: String,
11
+ product: Dodopayments::Models::LicenseActivateResponse::Product
12
+ }
13
+
14
+ class LicenseActivateResponse < Dodopayments::Internal::Type::BaseModel
15
+ attr_accessor id: String
16
+
17
+ attr_accessor business_id: String
18
+
19
+ attr_accessor created_at: Time
20
+
21
+ attr_accessor customer: Dodopayments::CustomerLimitedDetails
22
+
23
+ attr_accessor license_key_id: String
24
+
25
+ attr_accessor name: String
26
+
27
+ attr_accessor product: Dodopayments::Models::LicenseActivateResponse::Product
28
+
29
+ def initialize: (
30
+ id: String,
31
+ business_id: String,
32
+ created_at: Time,
33
+ customer: Dodopayments::CustomerLimitedDetails,
34
+ license_key_id: String,
35
+ name: String,
36
+ product: Dodopayments::Models::LicenseActivateResponse::Product
37
+ ) -> void
38
+
39
+ def to_hash: -> {
40
+ id: String,
41
+ business_id: String,
42
+ created_at: Time,
43
+ customer: Dodopayments::CustomerLimitedDetails,
44
+ license_key_id: String,
45
+ name: String,
46
+ product: Dodopayments::Models::LicenseActivateResponse::Product
47
+ }
48
+
49
+ type product = { product_id: String, name: String? }
50
+
51
+ class Product < Dodopayments::Internal::Type::BaseModel
52
+ attr_accessor product_id: String
53
+
54
+ attr_accessor name: String?
55
+
56
+ def initialize: (product_id: String, ?name: String?) -> void
57
+
58
+ def to_hash: -> { product_id: String, name: String? }
59
+ end
60
+ end
61
+ end
62
+ 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
 
@@ -12,7 +12,7 @@ module Dodopayments
12
12
  disputes: ::Array[Dodopayments::Dispute],
13
13
  metadata: ::Hash[Symbol, String],
14
14
  payment_id: String,
15
- refunds: ::Array[Dodopayments::Refund],
15
+ refunds: ::Array[Dodopayments::Payment::Refund],
16
16
  settlement_amount: Integer,
17
17
  settlement_currency: Dodopayments::Models::currency,
18
18
  total_amount: Integer,
@@ -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?,
@@ -55,7 +56,7 @@ module Dodopayments
55
56
 
56
57
  attr_accessor payment_id: String
57
58
 
58
- attr_accessor refunds: ::Array[Dodopayments::Refund]
59
+ attr_accessor refunds: ::Array[Dodopayments::Payment::Refund]
59
60
 
60
61
  attr_accessor settlement_amount: Integer
61
62
 
@@ -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?
@@ -106,7 +109,7 @@ module Dodopayments
106
109
  disputes: ::Array[Dodopayments::Dispute],
107
110
  metadata: ::Hash[Symbol, String],
108
111
  payment_id: String,
109
- refunds: ::Array[Dodopayments::Refund],
112
+ refunds: ::Array[Dodopayments::Payment::Refund],
110
113
  settlement_amount: Integer,
111
114
  settlement_currency: Dodopayments::Models::currency,
112
115
  total_amount: Integer,
@@ -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?,
@@ -139,7 +143,7 @@ module Dodopayments
139
143
  disputes: ::Array[Dodopayments::Dispute],
140
144
  metadata: ::Hash[Symbol, String],
141
145
  payment_id: String,
142
- refunds: ::Array[Dodopayments::Refund],
146
+ refunds: ::Array[Dodopayments::Payment::Refund],
143
147
  settlement_amount: Integer,
144
148
  settlement_currency: Dodopayments::Models::currency,
145
149
  total_amount: Integer,
@@ -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?,
@@ -161,6 +166,63 @@ module Dodopayments
161
166
  updated_at: Time?
162
167
  }
163
168
 
169
+ type refund =
170
+ {
171
+ business_id: String,
172
+ created_at: Time,
173
+ is_partial: bool,
174
+ payment_id: String,
175
+ refund_id: String,
176
+ status: Dodopayments::Models::refund_status,
177
+ amount: Integer?,
178
+ currency: Dodopayments::Models::currency?,
179
+ reason: String?
180
+ }
181
+
182
+ class Refund < Dodopayments::Internal::Type::BaseModel
183
+ attr_accessor business_id: String
184
+
185
+ attr_accessor created_at: Time
186
+
187
+ attr_accessor is_partial: bool
188
+
189
+ attr_accessor payment_id: String
190
+
191
+ attr_accessor refund_id: String
192
+
193
+ attr_accessor status: Dodopayments::Models::refund_status
194
+
195
+ attr_accessor amount: Integer?
196
+
197
+ attr_accessor currency: Dodopayments::Models::currency?
198
+
199
+ attr_accessor reason: String?
200
+
201
+ def initialize: (
202
+ business_id: String,
203
+ created_at: Time,
204
+ is_partial: bool,
205
+ payment_id: String,
206
+ refund_id: String,
207
+ status: Dodopayments::Models::refund_status,
208
+ ?amount: Integer?,
209
+ ?currency: Dodopayments::Models::currency?,
210
+ ?reason: String?
211
+ ) -> void
212
+
213
+ def to_hash: -> {
214
+ business_id: String,
215
+ created_at: Time,
216
+ is_partial: bool,
217
+ payment_id: String,
218
+ refund_id: String,
219
+ status: Dodopayments::Models::refund_status,
220
+ amount: Integer?,
221
+ currency: Dodopayments::Models::currency?,
222
+ reason: String?
223
+ }
224
+ end
225
+
164
226
  type product_cart = { product_id: String, quantity: Integer }
165
227
 
166
228
  class ProductCart < Dodopayments::Internal::Type::BaseModel
@@ -4,6 +4,7 @@ module Dodopayments
4
4
  {
5
5
  business_id: String,
6
6
  created_at: Time,
7
+ customer: Dodopayments::CustomerLimitedDetails,
7
8
  is_partial: bool,
8
9
  payment_id: String,
9
10
  refund_id: String,
@@ -18,6 +19,8 @@ module Dodopayments
18
19
 
19
20
  attr_accessor created_at: Time
20
21
 
22
+ attr_accessor customer: Dodopayments::CustomerLimitedDetails
23
+
21
24
  attr_accessor is_partial: bool
22
25
 
23
26
  attr_accessor payment_id: String
@@ -35,6 +38,7 @@ module Dodopayments
35
38
  def initialize: (
36
39
  business_id: String,
37
40
  created_at: Time,
41
+ customer: Dodopayments::CustomerLimitedDetails,
38
42
  is_partial: bool,
39
43
  payment_id: String,
40
44
  refund_id: String,
@@ -47,6 +51,7 @@ module Dodopayments
47
51
  def to_hash: -> {
48
52
  business_id: String,
49
53
  created_at: Time,
54
+ customer: Dodopayments::CustomerLimitedDetails,
50
55
  is_partial: bool,
51
56
  payment_id: String,
52
57
  refund_id: String,
@@ -0,0 +1,60 @@
1
+ module Dodopayments
2
+ module Models
3
+ type refund_list_response =
4
+ {
5
+ business_id: String,
6
+ created_at: Time,
7
+ is_partial: bool,
8
+ payment_id: String,
9
+ refund_id: String,
10
+ status: Dodopayments::Models::refund_status,
11
+ amount: Integer?,
12
+ currency: Dodopayments::Models::currency?,
13
+ reason: String?
14
+ }
15
+
16
+ class RefundListResponse < Dodopayments::Internal::Type::BaseModel
17
+ attr_accessor business_id: String
18
+
19
+ attr_accessor created_at: Time
20
+
21
+ attr_accessor is_partial: bool
22
+
23
+ attr_accessor payment_id: String
24
+
25
+ attr_accessor refund_id: String
26
+
27
+ attr_accessor status: Dodopayments::Models::refund_status
28
+
29
+ attr_accessor amount: Integer?
30
+
31
+ attr_accessor currency: Dodopayments::Models::currency?
32
+
33
+ attr_accessor reason: String?
34
+
35
+ def initialize: (
36
+ business_id: String,
37
+ created_at: Time,
38
+ is_partial: bool,
39
+ payment_id: String,
40
+ refund_id: String,
41
+ status: Dodopayments::Models::refund_status,
42
+ ?amount: Integer?,
43
+ ?currency: Dodopayments::Models::currency?,
44
+ ?reason: String?
45
+ ) -> void
46
+
47
+ def to_hash: -> {
48
+ business_id: String,
49
+ created_at: Time,
50
+ is_partial: bool,
51
+ payment_id: String,
52
+ refund_id: String,
53
+ status: Dodopayments::Models::refund_status,
54
+ amount: Integer?,
55
+ currency: Dodopayments::Models::currency?,
56
+ reason: String?
57
+ }
58
+ end
59
+ end
60
+ end
@@ -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
@@ -4,6 +4,7 @@ module Dodopayments
4
4
  {
5
5
  product_price: Integer,
6
6
  adaptive_currency_fees_inclusive: bool?,
7
+ customer_balance_config: Dodopayments::SubscriptionChargeParams::CustomerBalanceConfig?,
7
8
  metadata: ::Hash[Symbol, String]?,
8
9
  product_currency: Dodopayments::Models::currency?,
9
10
  product_description: String?
@@ -18,6 +19,8 @@ module Dodopayments
18
19
 
19
20
  attr_accessor adaptive_currency_fees_inclusive: bool?
20
21
 
22
+ attr_accessor customer_balance_config: Dodopayments::SubscriptionChargeParams::CustomerBalanceConfig?
23
+
21
24
  attr_accessor metadata: ::Hash[Symbol, String]?
22
25
 
23
26
  attr_accessor product_currency: Dodopayments::Models::currency?
@@ -27,6 +30,7 @@ module Dodopayments
27
30
  def initialize: (
28
31
  product_price: Integer,
29
32
  ?adaptive_currency_fees_inclusive: bool?,
33
+ ?customer_balance_config: Dodopayments::SubscriptionChargeParams::CustomerBalanceConfig?,
30
34
  ?metadata: ::Hash[Symbol, String]?,
31
35
  ?product_currency: Dodopayments::Models::currency?,
32
36
  ?product_description: String?,
@@ -36,11 +40,34 @@ module Dodopayments
36
40
  def to_hash: -> {
37
41
  product_price: Integer,
38
42
  adaptive_currency_fees_inclusive: bool?,
43
+ customer_balance_config: Dodopayments::SubscriptionChargeParams::CustomerBalanceConfig?,
39
44
  metadata: ::Hash[Symbol, String]?,
40
45
  product_currency: Dodopayments::Models::currency?,
41
46
  product_description: String?,
42
47
  request_options: Dodopayments::RequestOptions
43
48
  }
49
+
50
+ type customer_balance_config =
51
+ {
52
+ allow_customer_credits_purchase: bool?,
53
+ allow_customer_credits_usage: bool?
54
+ }
55
+
56
+ class CustomerBalanceConfig < Dodopayments::Internal::Type::BaseModel
57
+ attr_accessor allow_customer_credits_purchase: bool?
58
+
59
+ attr_accessor allow_customer_credits_usage: bool?
60
+
61
+ def initialize: (
62
+ ?allow_customer_credits_purchase: bool?,
63
+ ?allow_customer_credits_usage: bool?
64
+ ) -> void
65
+
66
+ def to_hash: -> {
67
+ allow_customer_credits_purchase: bool?,
68
+ allow_customer_credits_usage: bool?
69
+ }
70
+ end
44
71
  end
45
72
  end
46
73
  end
@@ -0,0 +1,29 @@
1
+ module Dodopayments
2
+ module Resources
3
+ class Customers
4
+ class Wallets
5
+ class LedgerEntries
6
+ def create: (
7
+ String customer_id,
8
+ amount: Integer,
9
+ currency: Dodopayments::Models::currency,
10
+ entry_type: Dodopayments::Models::Customers::Wallets::LedgerEntryCreateParams::entry_type,
11
+ ?idempotency_key: String?,
12
+ ?reason: String?,
13
+ ?request_options: Dodopayments::request_opts
14
+ ) -> Dodopayments::Customers::CustomerWallet
15
+
16
+ def list: (
17
+ String customer_id,
18
+ ?currency: Dodopayments::Models::currency,
19
+ ?page_number: Integer,
20
+ ?page_size: Integer,
21
+ ?request_options: Dodopayments::request_opts
22
+ ) -> Dodopayments::Internal::DefaultPageNumberPagination[Dodopayments::Customers::Wallets::CustomerWalletTransaction]
23
+
24
+ def initialize: (client: Dodopayments::Client) -> void
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end