dodopayments 1.52.5 → 1.53.3
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 +17 -0
- data/README.md +2 -2
- data/SECURITY.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/payment.rb +78 -3
- data/lib/dodopayments/models/refund.rb +9 -1
- data/lib/dodopayments/models/refund_list_response.rb +81 -0
- 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/payment.rbi +102 -3
- data/rbi/dodopayments/models/refund.rbi +13 -0
- data/rbi/dodopayments/models/refund_list_response.rbi +104 -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/payment.rbs +61 -4
- data/sig/dodopayments/models/refund.rbs +5 -0
- data/sig/dodopayments/models/refund_list_response.rbs +60 -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 +33 -3
@@ -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
|
@@ -0,0 +1,173 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module Dodopayments
|
4
|
+
module Models
|
5
|
+
module Customers
|
6
|
+
module Wallets
|
7
|
+
class CustomerWalletTransaction < Dodopayments::Internal::Type::BaseModel
|
8
|
+
OrHash =
|
9
|
+
T.type_alias do
|
10
|
+
T.any(
|
11
|
+
Dodopayments::Customers::Wallets::CustomerWalletTransaction,
|
12
|
+
Dodopayments::Internal::AnyHash
|
13
|
+
)
|
14
|
+
end
|
15
|
+
|
16
|
+
sig { returns(String) }
|
17
|
+
attr_accessor :id
|
18
|
+
|
19
|
+
sig { returns(Integer) }
|
20
|
+
attr_accessor :after_balance
|
21
|
+
|
22
|
+
sig { returns(Integer) }
|
23
|
+
attr_accessor :amount
|
24
|
+
|
25
|
+
sig { returns(Integer) }
|
26
|
+
attr_accessor :before_balance
|
27
|
+
|
28
|
+
sig { returns(String) }
|
29
|
+
attr_accessor :business_id
|
30
|
+
|
31
|
+
sig { returns(Time) }
|
32
|
+
attr_accessor :created_at
|
33
|
+
|
34
|
+
sig { returns(Dodopayments::Currency::TaggedSymbol) }
|
35
|
+
attr_accessor :currency
|
36
|
+
|
37
|
+
sig { returns(String) }
|
38
|
+
attr_accessor :customer_id
|
39
|
+
|
40
|
+
sig do
|
41
|
+
returns(
|
42
|
+
Dodopayments::Customers::Wallets::CustomerWalletTransaction::EventType::TaggedSymbol
|
43
|
+
)
|
44
|
+
end
|
45
|
+
attr_accessor :event_type
|
46
|
+
|
47
|
+
sig { returns(T::Boolean) }
|
48
|
+
attr_accessor :is_credit
|
49
|
+
|
50
|
+
sig { returns(T.nilable(String)) }
|
51
|
+
attr_accessor :reason
|
52
|
+
|
53
|
+
sig { returns(T.nilable(String)) }
|
54
|
+
attr_accessor :reference_object_id
|
55
|
+
|
56
|
+
sig do
|
57
|
+
params(
|
58
|
+
id: String,
|
59
|
+
after_balance: Integer,
|
60
|
+
amount: Integer,
|
61
|
+
before_balance: Integer,
|
62
|
+
business_id: String,
|
63
|
+
created_at: Time,
|
64
|
+
currency: Dodopayments::Currency::OrSymbol,
|
65
|
+
customer_id: String,
|
66
|
+
event_type:
|
67
|
+
Dodopayments::Customers::Wallets::CustomerWalletTransaction::EventType::OrSymbol,
|
68
|
+
is_credit: T::Boolean,
|
69
|
+
reason: T.nilable(String),
|
70
|
+
reference_object_id: T.nilable(String)
|
71
|
+
).returns(T.attached_class)
|
72
|
+
end
|
73
|
+
def self.new(
|
74
|
+
id:,
|
75
|
+
after_balance:,
|
76
|
+
amount:,
|
77
|
+
before_balance:,
|
78
|
+
business_id:,
|
79
|
+
created_at:,
|
80
|
+
currency:,
|
81
|
+
customer_id:,
|
82
|
+
event_type:,
|
83
|
+
is_credit:,
|
84
|
+
reason: nil,
|
85
|
+
reference_object_id: nil
|
86
|
+
)
|
87
|
+
end
|
88
|
+
|
89
|
+
sig do
|
90
|
+
override.returns(
|
91
|
+
{
|
92
|
+
id: String,
|
93
|
+
after_balance: Integer,
|
94
|
+
amount: Integer,
|
95
|
+
before_balance: Integer,
|
96
|
+
business_id: String,
|
97
|
+
created_at: Time,
|
98
|
+
currency: Dodopayments::Currency::TaggedSymbol,
|
99
|
+
customer_id: String,
|
100
|
+
event_type:
|
101
|
+
Dodopayments::Customers::Wallets::CustomerWalletTransaction::EventType::TaggedSymbol,
|
102
|
+
is_credit: T::Boolean,
|
103
|
+
reason: T.nilable(String),
|
104
|
+
reference_object_id: T.nilable(String)
|
105
|
+
}
|
106
|
+
)
|
107
|
+
end
|
108
|
+
def to_hash
|
109
|
+
end
|
110
|
+
|
111
|
+
module EventType
|
112
|
+
extend Dodopayments::Internal::Type::Enum
|
113
|
+
|
114
|
+
TaggedSymbol =
|
115
|
+
T.type_alias do
|
116
|
+
T.all(
|
117
|
+
Symbol,
|
118
|
+
Dodopayments::Customers::Wallets::CustomerWalletTransaction::EventType
|
119
|
+
)
|
120
|
+
end
|
121
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
122
|
+
|
123
|
+
PAYMENT =
|
124
|
+
T.let(
|
125
|
+
:payment,
|
126
|
+
Dodopayments::Customers::Wallets::CustomerWalletTransaction::EventType::TaggedSymbol
|
127
|
+
)
|
128
|
+
PAYMENT_REVERSAL =
|
129
|
+
T.let(
|
130
|
+
:payment_reversal,
|
131
|
+
Dodopayments::Customers::Wallets::CustomerWalletTransaction::EventType::TaggedSymbol
|
132
|
+
)
|
133
|
+
REFUND =
|
134
|
+
T.let(
|
135
|
+
:refund,
|
136
|
+
Dodopayments::Customers::Wallets::CustomerWalletTransaction::EventType::TaggedSymbol
|
137
|
+
)
|
138
|
+
REFUND_REVERSAL =
|
139
|
+
T.let(
|
140
|
+
:refund_reversal,
|
141
|
+
Dodopayments::Customers::Wallets::CustomerWalletTransaction::EventType::TaggedSymbol
|
142
|
+
)
|
143
|
+
DISPUTE =
|
144
|
+
T.let(
|
145
|
+
:dispute,
|
146
|
+
Dodopayments::Customers::Wallets::CustomerWalletTransaction::EventType::TaggedSymbol
|
147
|
+
)
|
148
|
+
DISPUTE_REVERSAL =
|
149
|
+
T.let(
|
150
|
+
:dispute_reversal,
|
151
|
+
Dodopayments::Customers::Wallets::CustomerWalletTransaction::EventType::TaggedSymbol
|
152
|
+
)
|
153
|
+
MERCHANT_ADJUSTMENT =
|
154
|
+
T.let(
|
155
|
+
:merchant_adjustment,
|
156
|
+
Dodopayments::Customers::Wallets::CustomerWalletTransaction::EventType::TaggedSymbol
|
157
|
+
)
|
158
|
+
|
159
|
+
sig do
|
160
|
+
override.returns(
|
161
|
+
T::Array[
|
162
|
+
Dodopayments::Customers::Wallets::CustomerWalletTransaction::EventType::TaggedSymbol
|
163
|
+
]
|
164
|
+
)
|
165
|
+
end
|
166
|
+
def self.values
|
167
|
+
end
|
168
|
+
end
|
169
|
+
end
|
170
|
+
end
|
171
|
+
end
|
172
|
+
end
|
173
|
+
end
|