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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +16 -0
- data/README.md +1 -1
- data/lib/dodopayments/models/customers/customer_wallet.rb +43 -0
- data/lib/dodopayments/models/customers/wallet_list_params.rb +16 -0
- data/lib/dodopayments/models/customers/wallet_list_response.rb +26 -0
- data/lib/dodopayments/models/customers/wallets/customer_wallet_transaction.rb +102 -0
- data/lib/dodopayments/models/customers/wallets/ledger_entry_create_params.rb +67 -0
- data/lib/dodopayments/models/customers/wallets/ledger_entry_list_params.rb +40 -0
- data/lib/dodopayments/models/license_activate_response.rb +87 -0
- data/lib/dodopayments/models/meter_aggregation.rb +0 -1
- data/lib/dodopayments/models/payment.rb +88 -4
- data/lib/dodopayments/models/refund.rb +9 -1
- data/lib/dodopayments/models/refund_list_response.rb +81 -0
- data/lib/dodopayments/models/subscription.rb +57 -1
- data/lib/dodopayments/models/subscription_charge_params.rb +32 -1
- data/lib/dodopayments/resources/customers/wallets/ledger_entries.rb +75 -0
- data/lib/dodopayments/resources/customers/wallets.rb +38 -0
- data/lib/dodopayments/resources/customers.rb +4 -0
- data/lib/dodopayments/resources/licenses.rb +2 -2
- data/lib/dodopayments/resources/refunds.rb +2 -2
- data/lib/dodopayments/resources/subscriptions.rb +3 -1
- data/lib/dodopayments/version.rb +1 -1
- data/lib/dodopayments.rb +10 -0
- data/rbi/dodopayments/models/customers/customer_wallet.rbi +66 -0
- data/rbi/dodopayments/models/customers/wallet_list_params.rbi +34 -0
- data/rbi/dodopayments/models/customers/wallet_list_response.rbi +48 -0
- data/rbi/dodopayments/models/customers/wallets/customer_wallet_transaction.rbi +173 -0
- data/rbi/dodopayments/models/customers/wallets/ledger_entry_create_params.rbi +119 -0
- data/rbi/dodopayments/models/customers/wallets/ledger_entry_list_params.rbi +71 -0
- data/rbi/dodopayments/models/license_activate_response.rbi +140 -0
- data/rbi/dodopayments/models/meter_aggregation.rbi +0 -5
- data/rbi/dodopayments/models/payment.rbi +112 -3
- data/rbi/dodopayments/models/refund.rbi +13 -0
- data/rbi/dodopayments/models/refund_list_response.rbi +104 -0
- data/rbi/dodopayments/models/subscription.rbi +78 -0
- data/rbi/dodopayments/models/subscription_charge_params.rbi +74 -0
- data/rbi/dodopayments/resources/customers/wallets/ledger_entries.rbi +67 -0
- data/rbi/dodopayments/resources/customers/wallets.rbi +32 -0
- data/rbi/dodopayments/resources/customers.rbi +3 -0
- data/rbi/dodopayments/resources/licenses.rbi +1 -1
- data/rbi/dodopayments/resources/refunds.rbi +1 -1
- data/rbi/dodopayments/resources/subscriptions.rbi +6 -0
- data/sig/dodopayments/models/customers/customer_wallet.rbs +44 -0
- data/sig/dodopayments/models/customers/wallet_list_params.rbs +17 -0
- data/sig/dodopayments/models/customers/wallet_list_response.rbs +27 -0
- data/sig/dodopayments/models/customers/wallets/customer_wallet_transaction.rbs +102 -0
- data/sig/dodopayments/models/customers/wallets/ledger_entry_create_params.rbs +61 -0
- data/sig/dodopayments/models/customers/wallets/ledger_entry_list_params.rbs +48 -0
- data/sig/dodopayments/models/license_activate_response.rbs +62 -0
- data/sig/dodopayments/models/meter_aggregation.rbs +1 -2
- data/sig/dodopayments/models/payment.rbs +66 -4
- data/sig/dodopayments/models/refund.rbs +5 -0
- data/sig/dodopayments/models/refund_list_response.rbs +60 -0
- data/sig/dodopayments/models/subscription.rbs +52 -0
- data/sig/dodopayments/models/subscription_charge_params.rbs +27 -0
- data/sig/dodopayments/resources/customers/wallets/ledger_entries.rbs +29 -0
- data/sig/dodopayments/resources/customers/wallets.rbs +16 -0
- data/sig/dodopayments/resources/customers.rbs +2 -0
- data/sig/dodopayments/resources/licenses.rbs +1 -1
- data/sig/dodopayments/resources/refunds.rbs +1 -1
- data/sig/dodopayments/resources/subscriptions.rbs +1 -0
- metadata +32 -2
@@ -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
|
@@ -22,6 +22,14 @@ module Dodopayments
|
|
22
22
|
# @return [Boolean, nil]
|
23
23
|
optional :adaptive_currency_fees_inclusive, Dodopayments::Internal::Type::Boolean, nil?: true
|
24
24
|
|
25
|
+
# @!attribute customer_balance_config
|
26
|
+
# Specify how customer balance is used for the payment
|
27
|
+
#
|
28
|
+
# @return [Dodopayments::Models::SubscriptionChargeParams::CustomerBalanceConfig, nil]
|
29
|
+
optional :customer_balance_config,
|
30
|
+
-> { Dodopayments::SubscriptionChargeParams::CustomerBalanceConfig },
|
31
|
+
nil?: true
|
32
|
+
|
25
33
|
# @!attribute metadata
|
26
34
|
# Metadata for the payment. If not passed, the metadata of the subscription will
|
27
35
|
# be taken
|
@@ -43,7 +51,7 @@ module Dodopayments
|
|
43
51
|
# @return [String, nil]
|
44
52
|
optional :product_description, String, nil?: true
|
45
53
|
|
46
|
-
# @!method initialize(product_price:, adaptive_currency_fees_inclusive: nil, metadata: nil, product_currency: nil, product_description: nil, request_options: {})
|
54
|
+
# @!method initialize(product_price:, adaptive_currency_fees_inclusive: nil, customer_balance_config: nil, metadata: nil, product_currency: nil, product_description: nil, request_options: {})
|
47
55
|
# Some parameter documentations has been truncated, see
|
48
56
|
# {Dodopayments::Models::SubscriptionChargeParams} for more details.
|
49
57
|
#
|
@@ -51,6 +59,8 @@ module Dodopayments
|
|
51
59
|
#
|
52
60
|
# @param adaptive_currency_fees_inclusive [Boolean, nil] Whether adaptive currency fees should be included in the product_price (true) or
|
53
61
|
#
|
62
|
+
# @param customer_balance_config [Dodopayments::Models::SubscriptionChargeParams::CustomerBalanceConfig, nil] Specify how customer balance is used for the payment
|
63
|
+
#
|
54
64
|
# @param metadata [Hash{Symbol=>String}, nil] Metadata for the payment. If not passed, the metadata of the subscription will b
|
55
65
|
#
|
56
66
|
# @param product_currency [Symbol, Dodopayments::Models::Currency, nil] Optional currency of the product price. If not specified, defaults to the curren
|
@@ -58,6 +68,27 @@ module Dodopayments
|
|
58
68
|
# @param product_description [String, nil] Optional product description override for billing and line items.
|
59
69
|
#
|
60
70
|
# @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
|
71
|
+
|
72
|
+
class CustomerBalanceConfig < Dodopayments::Internal::Type::BaseModel
|
73
|
+
# @!attribute allow_customer_credits_purchase
|
74
|
+
# Allows Customer Credit to be purchased to settle payments
|
75
|
+
#
|
76
|
+
# @return [Boolean, nil]
|
77
|
+
optional :allow_customer_credits_purchase, Dodopayments::Internal::Type::Boolean, nil?: true
|
78
|
+
|
79
|
+
# @!attribute allow_customer_credits_usage
|
80
|
+
# Allows Customer Credit Balance to be used to settle payments
|
81
|
+
#
|
82
|
+
# @return [Boolean, nil]
|
83
|
+
optional :allow_customer_credits_usage, Dodopayments::Internal::Type::Boolean, nil?: true
|
84
|
+
|
85
|
+
# @!method initialize(allow_customer_credits_purchase: nil, allow_customer_credits_usage: nil)
|
86
|
+
# Specify how customer balance is used for the payment
|
87
|
+
#
|
88
|
+
# @param allow_customer_credits_purchase [Boolean, nil] Allows Customer Credit to be purchased to settle payments
|
89
|
+
#
|
90
|
+
# @param allow_customer_credits_usage [Boolean, nil] Allows Customer Credit Balance to be used to settle payments
|
91
|
+
end
|
61
92
|
end
|
62
93
|
end
|
63
94
|
end
|
@@ -0,0 +1,75 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Dodopayments
|
4
|
+
module Resources
|
5
|
+
class Customers
|
6
|
+
class Wallets
|
7
|
+
class LedgerEntries
|
8
|
+
# @overload create(customer_id, amount:, currency:, entry_type:, idempotency_key: nil, reason: nil, request_options: {})
|
9
|
+
#
|
10
|
+
# @param customer_id [String] Customer ID
|
11
|
+
#
|
12
|
+
# @param amount [Integer]
|
13
|
+
#
|
14
|
+
# @param currency [Symbol, Dodopayments::Models::Currency] Currency of the wallet to adjust
|
15
|
+
#
|
16
|
+
# @param entry_type [Symbol, Dodopayments::Models::Customers::Wallets::LedgerEntryCreateParams::EntryType] Type of ledger entry - credit or debit
|
17
|
+
#
|
18
|
+
# @param idempotency_key [String, nil] Optional idempotency key to prevent duplicate entries
|
19
|
+
#
|
20
|
+
# @param reason [String, nil]
|
21
|
+
#
|
22
|
+
# @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
|
23
|
+
#
|
24
|
+
# @return [Dodopayments::Models::Customers::CustomerWallet]
|
25
|
+
#
|
26
|
+
# @see Dodopayments::Models::Customers::Wallets::LedgerEntryCreateParams
|
27
|
+
def create(customer_id, params)
|
28
|
+
parsed, options = Dodopayments::Customers::Wallets::LedgerEntryCreateParams.dump_request(params)
|
29
|
+
@client.request(
|
30
|
+
method: :post,
|
31
|
+
path: ["customers/%1$s/wallets/ledger-entries", customer_id],
|
32
|
+
body: parsed,
|
33
|
+
model: Dodopayments::Customers::CustomerWallet,
|
34
|
+
options: options
|
35
|
+
)
|
36
|
+
end
|
37
|
+
|
38
|
+
# @overload list(customer_id, currency: nil, page_number: nil, page_size: nil, request_options: {})
|
39
|
+
#
|
40
|
+
# @param customer_id [String] Customer ID
|
41
|
+
#
|
42
|
+
# @param currency [Symbol, Dodopayments::Models::Currency] Optional currency filter
|
43
|
+
#
|
44
|
+
# @param page_number [Integer]
|
45
|
+
#
|
46
|
+
# @param page_size [Integer]
|
47
|
+
#
|
48
|
+
# @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
|
49
|
+
#
|
50
|
+
# @return [Dodopayments::Internal::DefaultPageNumberPagination<Dodopayments::Models::Customers::Wallets::CustomerWalletTransaction>]
|
51
|
+
#
|
52
|
+
# @see Dodopayments::Models::Customers::Wallets::LedgerEntryListParams
|
53
|
+
def list(customer_id, params = {})
|
54
|
+
parsed, options = Dodopayments::Customers::Wallets::LedgerEntryListParams.dump_request(params)
|
55
|
+
@client.request(
|
56
|
+
method: :get,
|
57
|
+
path: ["customers/%1$s/wallets/ledger-entries", customer_id],
|
58
|
+
query: parsed,
|
59
|
+
page: Dodopayments::Internal::DefaultPageNumberPagination,
|
60
|
+
model: Dodopayments::Customers::Wallets::CustomerWalletTransaction,
|
61
|
+
options: options
|
62
|
+
)
|
63
|
+
end
|
64
|
+
|
65
|
+
# @api private
|
66
|
+
#
|
67
|
+
# @param client [Dodopayments::Client]
|
68
|
+
def initialize(client:)
|
69
|
+
@client = client
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Dodopayments
|
4
|
+
module Resources
|
5
|
+
class Customers
|
6
|
+
class Wallets
|
7
|
+
# @return [Dodopayments::Resources::Customers::Wallets::LedgerEntries]
|
8
|
+
attr_reader :ledger_entries
|
9
|
+
|
10
|
+
# @overload list(customer_id, request_options: {})
|
11
|
+
#
|
12
|
+
# @param customer_id [String] Customer ID
|
13
|
+
#
|
14
|
+
# @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
|
15
|
+
#
|
16
|
+
# @return [Dodopayments::Models::Customers::WalletListResponse]
|
17
|
+
#
|
18
|
+
# @see Dodopayments::Models::Customers::WalletListParams
|
19
|
+
def list(customer_id, params = {})
|
20
|
+
@client.request(
|
21
|
+
method: :get,
|
22
|
+
path: ["customers/%1$s/wallets", customer_id],
|
23
|
+
model: Dodopayments::Models::Customers::WalletListResponse,
|
24
|
+
options: params[:request_options]
|
25
|
+
)
|
26
|
+
end
|
27
|
+
|
28
|
+
# @api private
|
29
|
+
#
|
30
|
+
# @param client [Dodopayments::Client]
|
31
|
+
def initialize(client:)
|
32
|
+
@client = client
|
33
|
+
@ledger_entries = Dodopayments::Resources::Customers::Wallets::LedgerEntries.new(client: client)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -6,6 +6,9 @@ module Dodopayments
|
|
6
6
|
# @return [Dodopayments::Resources::Customers::CustomerPortal]
|
7
7
|
attr_reader :customer_portal
|
8
8
|
|
9
|
+
# @return [Dodopayments::Resources::Customers::Wallets]
|
10
|
+
attr_reader :wallets
|
11
|
+
|
9
12
|
# @overload create(email:, name:, phone_number: nil, request_options: {})
|
10
13
|
#
|
11
14
|
# @param email [String]
|
@@ -100,6 +103,7 @@ module Dodopayments
|
|
100
103
|
def initialize(client:)
|
101
104
|
@client = client
|
102
105
|
@customer_portal = Dodopayments::Resources::Customers::CustomerPortal.new(client: client)
|
106
|
+
@wallets = Dodopayments::Resources::Customers::Wallets.new(client: client)
|
103
107
|
end
|
104
108
|
end
|
105
109
|
end
|
@@ -9,7 +9,7 @@ module Dodopayments
|
|
9
9
|
# @param name [String]
|
10
10
|
# @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
|
11
11
|
#
|
12
|
-
# @return [Dodopayments::Models::
|
12
|
+
# @return [Dodopayments::Models::LicenseActivateResponse]
|
13
13
|
#
|
14
14
|
# @see Dodopayments::Models::LicenseActivateParams
|
15
15
|
def activate(params)
|
@@ -18,7 +18,7 @@ module Dodopayments
|
|
18
18
|
method: :post,
|
19
19
|
path: "licenses/activate",
|
20
20
|
body: parsed,
|
21
|
-
model: Dodopayments::
|
21
|
+
model: Dodopayments::Models::LicenseActivateResponse,
|
22
22
|
options: options
|
23
23
|
)
|
24
24
|
end
|
@@ -61,7 +61,7 @@ module Dodopayments
|
|
61
61
|
#
|
62
62
|
# @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
|
63
63
|
#
|
64
|
-
# @return [Dodopayments::Internal::DefaultPageNumberPagination<Dodopayments::Models::
|
64
|
+
# @return [Dodopayments::Internal::DefaultPageNumberPagination<Dodopayments::Models::RefundListResponse>]
|
65
65
|
#
|
66
66
|
# @see Dodopayments::Models::RefundListParams
|
67
67
|
def list(params = {})
|
@@ -71,7 +71,7 @@ module Dodopayments
|
|
71
71
|
path: "refunds",
|
72
72
|
query: parsed,
|
73
73
|
page: Dodopayments::Internal::DefaultPageNumberPagination,
|
74
|
-
model: Dodopayments::
|
74
|
+
model: Dodopayments::Models::RefundListResponse,
|
75
75
|
options: options
|
76
76
|
)
|
77
77
|
end
|
@@ -173,7 +173,7 @@ module Dodopayments
|
|
173
173
|
# Some parameter documentations has been truncated, see
|
174
174
|
# {Dodopayments::Models::SubscriptionChargeParams} for more details.
|
175
175
|
#
|
176
|
-
# @overload charge(subscription_id, product_price:, adaptive_currency_fees_inclusive: nil, metadata: nil, product_currency: nil, product_description: nil, request_options: {})
|
176
|
+
# @overload charge(subscription_id, product_price:, adaptive_currency_fees_inclusive: nil, customer_balance_config: nil, metadata: nil, product_currency: nil, product_description: nil, request_options: {})
|
177
177
|
#
|
178
178
|
# @param subscription_id [String] Subscription Id
|
179
179
|
#
|
@@ -181,6 +181,8 @@ module Dodopayments
|
|
181
181
|
#
|
182
182
|
# @param adaptive_currency_fees_inclusive [Boolean, nil] Whether adaptive currency fees should be included in the product_price (true) or
|
183
183
|
#
|
184
|
+
# @param customer_balance_config [Dodopayments::Models::SubscriptionChargeParams::CustomerBalanceConfig, nil] Specify how customer balance is used for the payment
|
185
|
+
#
|
184
186
|
# @param metadata [Hash{Symbol=>String}, nil] Metadata for the payment. If not passed, the metadata of the subscription will b
|
185
187
|
#
|
186
188
|
# @param product_currency [Symbol, Dodopayments::Models::Currency, nil] Optional currency of the product price. If not specified, defaults to the curren
|
data/lib/dodopayments/version.rb
CHANGED
data/lib/dodopayments.rb
CHANGED
@@ -91,6 +91,12 @@ require_relative "dodopayments/models/customer_portal_session"
|
|
91
91
|
require_relative "dodopayments/models/customer_request"
|
92
92
|
require_relative "dodopayments/models/customer_retrieve_params"
|
93
93
|
require_relative "dodopayments/models/customers/customer_portal_create_params"
|
94
|
+
require_relative "dodopayments/models/customers/customer_wallet"
|
95
|
+
require_relative "dodopayments/models/customers/wallet_list_params"
|
96
|
+
require_relative "dodopayments/models/customers/wallet_list_response"
|
97
|
+
require_relative "dodopayments/models/customers/wallets/customer_wallet_transaction"
|
98
|
+
require_relative "dodopayments/models/customers/wallets/ledger_entry_create_params"
|
99
|
+
require_relative "dodopayments/models/customers/wallets/ledger_entry_list_params"
|
94
100
|
require_relative "dodopayments/models/customer_update_params"
|
95
101
|
require_relative "dodopayments/models/discount"
|
96
102
|
require_relative "dodopayments/models/discount_create_params"
|
@@ -111,6 +117,7 @@ require_relative "dodopayments/models/intent_status"
|
|
111
117
|
require_relative "dodopayments/models/invoices/payment_retrieve_params"
|
112
118
|
require_relative "dodopayments/models/invoices/payment_retrieve_refund_params"
|
113
119
|
require_relative "dodopayments/models/license_activate_params"
|
120
|
+
require_relative "dodopayments/models/license_activate_response"
|
114
121
|
require_relative "dodopayments/models/license_deactivate_params"
|
115
122
|
require_relative "dodopayments/models/license_key_duration"
|
116
123
|
require_relative "dodopayments/models/license_key_instance"
|
@@ -161,6 +168,7 @@ require_relative "dodopayments/models/product_update_files_response"
|
|
161
168
|
require_relative "dodopayments/models/product_update_params"
|
162
169
|
require_relative "dodopayments/models/refund_create_params"
|
163
170
|
require_relative "dodopayments/models/refund_list_params"
|
171
|
+
require_relative "dodopayments/models/refund_list_response"
|
164
172
|
require_relative "dodopayments/models/refund_retrieve_params"
|
165
173
|
require_relative "dodopayments/models/refund_status"
|
166
174
|
require_relative "dodopayments/models/subscription_change_plan_params"
|
@@ -200,6 +208,8 @@ require_relative "dodopayments/resources/brands"
|
|
200
208
|
require_relative "dodopayments/resources/checkout_sessions"
|
201
209
|
require_relative "dodopayments/resources/customers"
|
202
210
|
require_relative "dodopayments/resources/customers/customer_portal"
|
211
|
+
require_relative "dodopayments/resources/customers/wallets"
|
212
|
+
require_relative "dodopayments/resources/customers/wallets/ledger_entries"
|
203
213
|
require_relative "dodopayments/resources/discounts"
|
204
214
|
require_relative "dodopayments/resources/disputes"
|
205
215
|
require_relative "dodopayments/resources/invoices"
|
@@ -0,0 +1,66 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module Dodopayments
|
4
|
+
module Models
|
5
|
+
CustomerWallet = Customers::CustomerWallet
|
6
|
+
|
7
|
+
module Customers
|
8
|
+
class CustomerWallet < Dodopayments::Internal::Type::BaseModel
|
9
|
+
OrHash =
|
10
|
+
T.type_alias do
|
11
|
+
T.any(
|
12
|
+
Dodopayments::Customers::CustomerWallet,
|
13
|
+
Dodopayments::Internal::AnyHash
|
14
|
+
)
|
15
|
+
end
|
16
|
+
|
17
|
+
sig { returns(Integer) }
|
18
|
+
attr_accessor :balance
|
19
|
+
|
20
|
+
sig { returns(Time) }
|
21
|
+
attr_accessor :created_at
|
22
|
+
|
23
|
+
sig { returns(Dodopayments::Currency::TaggedSymbol) }
|
24
|
+
attr_accessor :currency
|
25
|
+
|
26
|
+
sig { returns(String) }
|
27
|
+
attr_accessor :customer_id
|
28
|
+
|
29
|
+
sig { returns(Time) }
|
30
|
+
attr_accessor :updated_at
|
31
|
+
|
32
|
+
sig do
|
33
|
+
params(
|
34
|
+
balance: Integer,
|
35
|
+
created_at: Time,
|
36
|
+
currency: Dodopayments::Currency::OrSymbol,
|
37
|
+
customer_id: String,
|
38
|
+
updated_at: Time
|
39
|
+
).returns(T.attached_class)
|
40
|
+
end
|
41
|
+
def self.new(
|
42
|
+
balance:,
|
43
|
+
created_at:,
|
44
|
+
currency:,
|
45
|
+
customer_id:,
|
46
|
+
updated_at:
|
47
|
+
)
|
48
|
+
end
|
49
|
+
|
50
|
+
sig do
|
51
|
+
override.returns(
|
52
|
+
{
|
53
|
+
balance: Integer,
|
54
|
+
created_at: Time,
|
55
|
+
currency: Dodopayments::Currency::TaggedSymbol,
|
56
|
+
customer_id: String,
|
57
|
+
updated_at: Time
|
58
|
+
}
|
59
|
+
)
|
60
|
+
end
|
61
|
+
def to_hash
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module Dodopayments
|
4
|
+
module Models
|
5
|
+
module Customers
|
6
|
+
class WalletListParams < 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::Customers::WalletListParams,
|
14
|
+
Dodopayments::Internal::AnyHash
|
15
|
+
)
|
16
|
+
end
|
17
|
+
|
18
|
+
sig do
|
19
|
+
params(request_options: Dodopayments::RequestOptions::OrHash).returns(
|
20
|
+
T.attached_class
|
21
|
+
)
|
22
|
+
end
|
23
|
+
def self.new(request_options: {})
|
24
|
+
end
|
25
|
+
|
26
|
+
sig do
|
27
|
+
override.returns({ request_options: Dodopayments::RequestOptions })
|
28
|
+
end
|
29
|
+
def to_hash
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module Dodopayments
|
4
|
+
module Models
|
5
|
+
module Customers
|
6
|
+
class WalletListResponse < Dodopayments::Internal::Type::BaseModel
|
7
|
+
OrHash =
|
8
|
+
T.type_alias do
|
9
|
+
T.any(
|
10
|
+
Dodopayments::Models::Customers::WalletListResponse,
|
11
|
+
Dodopayments::Internal::AnyHash
|
12
|
+
)
|
13
|
+
end
|
14
|
+
|
15
|
+
sig { returns(T::Array[Dodopayments::Customers::CustomerWallet]) }
|
16
|
+
attr_accessor :items
|
17
|
+
|
18
|
+
# Sum of all wallet balances converted to USD (in smallest unit)
|
19
|
+
sig { returns(Integer) }
|
20
|
+
attr_accessor :total_balance_usd
|
21
|
+
|
22
|
+
sig do
|
23
|
+
params(
|
24
|
+
items: T::Array[Dodopayments::Customers::CustomerWallet::OrHash],
|
25
|
+
total_balance_usd: Integer
|
26
|
+
).returns(T.attached_class)
|
27
|
+
end
|
28
|
+
def self.new(
|
29
|
+
items:,
|
30
|
+
# Sum of all wallet balances converted to USD (in smallest unit)
|
31
|
+
total_balance_usd:
|
32
|
+
)
|
33
|
+
end
|
34
|
+
|
35
|
+
sig do
|
36
|
+
override.returns(
|
37
|
+
{
|
38
|
+
items: T::Array[Dodopayments::Customers::CustomerWallet],
|
39
|
+
total_balance_usd: Integer
|
40
|
+
}
|
41
|
+
)
|
42
|
+
end
|
43
|
+
def to_hash
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|