dodopayments 1.52.5 → 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 +8 -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/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 +32 -2
@@ -0,0 +1,119 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module Dodopayments
|
4
|
+
module Models
|
5
|
+
module Customers
|
6
|
+
module Wallets
|
7
|
+
class LedgerEntryCreateParams < Dodopayments::Internal::Type::BaseModel
|
8
|
+
extend Dodopayments::Internal::Type::RequestParameters::Converter
|
9
|
+
include Dodopayments::Internal::Type::RequestParameters
|
10
|
+
|
11
|
+
OrHash =
|
12
|
+
T.type_alias do
|
13
|
+
T.any(
|
14
|
+
Dodopayments::Customers::Wallets::LedgerEntryCreateParams,
|
15
|
+
Dodopayments::Internal::AnyHash
|
16
|
+
)
|
17
|
+
end
|
18
|
+
|
19
|
+
sig { returns(Integer) }
|
20
|
+
attr_accessor :amount
|
21
|
+
|
22
|
+
# Currency of the wallet to adjust
|
23
|
+
sig { returns(Dodopayments::Currency::OrSymbol) }
|
24
|
+
attr_accessor :currency
|
25
|
+
|
26
|
+
# Type of ledger entry - credit or debit
|
27
|
+
sig do
|
28
|
+
returns(
|
29
|
+
Dodopayments::Customers::Wallets::LedgerEntryCreateParams::EntryType::OrSymbol
|
30
|
+
)
|
31
|
+
end
|
32
|
+
attr_accessor :entry_type
|
33
|
+
|
34
|
+
# Optional idempotency key to prevent duplicate entries
|
35
|
+
sig { returns(T.nilable(String)) }
|
36
|
+
attr_accessor :idempotency_key
|
37
|
+
|
38
|
+
sig { returns(T.nilable(String)) }
|
39
|
+
attr_accessor :reason
|
40
|
+
|
41
|
+
sig do
|
42
|
+
params(
|
43
|
+
amount: Integer,
|
44
|
+
currency: Dodopayments::Currency::OrSymbol,
|
45
|
+
entry_type:
|
46
|
+
Dodopayments::Customers::Wallets::LedgerEntryCreateParams::EntryType::OrSymbol,
|
47
|
+
idempotency_key: T.nilable(String),
|
48
|
+
reason: T.nilable(String),
|
49
|
+
request_options: Dodopayments::RequestOptions::OrHash
|
50
|
+
).returns(T.attached_class)
|
51
|
+
end
|
52
|
+
def self.new(
|
53
|
+
amount:,
|
54
|
+
# Currency of the wallet to adjust
|
55
|
+
currency:,
|
56
|
+
# Type of ledger entry - credit or debit
|
57
|
+
entry_type:,
|
58
|
+
# Optional idempotency key to prevent duplicate entries
|
59
|
+
idempotency_key: nil,
|
60
|
+
reason: nil,
|
61
|
+
request_options: {}
|
62
|
+
)
|
63
|
+
end
|
64
|
+
|
65
|
+
sig do
|
66
|
+
override.returns(
|
67
|
+
{
|
68
|
+
amount: Integer,
|
69
|
+
currency: Dodopayments::Currency::OrSymbol,
|
70
|
+
entry_type:
|
71
|
+
Dodopayments::Customers::Wallets::LedgerEntryCreateParams::EntryType::OrSymbol,
|
72
|
+
idempotency_key: T.nilable(String),
|
73
|
+
reason: T.nilable(String),
|
74
|
+
request_options: Dodopayments::RequestOptions
|
75
|
+
}
|
76
|
+
)
|
77
|
+
end
|
78
|
+
def to_hash
|
79
|
+
end
|
80
|
+
|
81
|
+
# Type of ledger entry - credit or debit
|
82
|
+
module EntryType
|
83
|
+
extend Dodopayments::Internal::Type::Enum
|
84
|
+
|
85
|
+
TaggedSymbol =
|
86
|
+
T.type_alias do
|
87
|
+
T.all(
|
88
|
+
Symbol,
|
89
|
+
Dodopayments::Customers::Wallets::LedgerEntryCreateParams::EntryType
|
90
|
+
)
|
91
|
+
end
|
92
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
93
|
+
|
94
|
+
CREDIT =
|
95
|
+
T.let(
|
96
|
+
:credit,
|
97
|
+
Dodopayments::Customers::Wallets::LedgerEntryCreateParams::EntryType::TaggedSymbol
|
98
|
+
)
|
99
|
+
DEBIT =
|
100
|
+
T.let(
|
101
|
+
:debit,
|
102
|
+
Dodopayments::Customers::Wallets::LedgerEntryCreateParams::EntryType::TaggedSymbol
|
103
|
+
)
|
104
|
+
|
105
|
+
sig do
|
106
|
+
override.returns(
|
107
|
+
T::Array[
|
108
|
+
Dodopayments::Customers::Wallets::LedgerEntryCreateParams::EntryType::TaggedSymbol
|
109
|
+
]
|
110
|
+
)
|
111
|
+
end
|
112
|
+
def self.values
|
113
|
+
end
|
114
|
+
end
|
115
|
+
end
|
116
|
+
end
|
117
|
+
end
|
118
|
+
end
|
119
|
+
end
|
@@ -0,0 +1,71 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module Dodopayments
|
4
|
+
module Models
|
5
|
+
module Customers
|
6
|
+
module Wallets
|
7
|
+
class LedgerEntryListParams < Dodopayments::Internal::Type::BaseModel
|
8
|
+
extend Dodopayments::Internal::Type::RequestParameters::Converter
|
9
|
+
include Dodopayments::Internal::Type::RequestParameters
|
10
|
+
|
11
|
+
OrHash =
|
12
|
+
T.type_alias do
|
13
|
+
T.any(
|
14
|
+
Dodopayments::Customers::Wallets::LedgerEntryListParams,
|
15
|
+
Dodopayments::Internal::AnyHash
|
16
|
+
)
|
17
|
+
end
|
18
|
+
|
19
|
+
# Optional currency filter
|
20
|
+
sig { returns(T.nilable(Dodopayments::Currency::OrSymbol)) }
|
21
|
+
attr_reader :currency
|
22
|
+
|
23
|
+
sig { params(currency: Dodopayments::Currency::OrSymbol).void }
|
24
|
+
attr_writer :currency
|
25
|
+
|
26
|
+
sig { returns(T.nilable(Integer)) }
|
27
|
+
attr_reader :page_number
|
28
|
+
|
29
|
+
sig { params(page_number: Integer).void }
|
30
|
+
attr_writer :page_number
|
31
|
+
|
32
|
+
sig { returns(T.nilable(Integer)) }
|
33
|
+
attr_reader :page_size
|
34
|
+
|
35
|
+
sig { params(page_size: Integer).void }
|
36
|
+
attr_writer :page_size
|
37
|
+
|
38
|
+
sig do
|
39
|
+
params(
|
40
|
+
currency: Dodopayments::Currency::OrSymbol,
|
41
|
+
page_number: Integer,
|
42
|
+
page_size: Integer,
|
43
|
+
request_options: Dodopayments::RequestOptions::OrHash
|
44
|
+
).returns(T.attached_class)
|
45
|
+
end
|
46
|
+
def self.new(
|
47
|
+
# Optional currency filter
|
48
|
+
currency: nil,
|
49
|
+
page_number: nil,
|
50
|
+
page_size: nil,
|
51
|
+
request_options: {}
|
52
|
+
)
|
53
|
+
end
|
54
|
+
|
55
|
+
sig do
|
56
|
+
override.returns(
|
57
|
+
{
|
58
|
+
currency: Dodopayments::Currency::OrSymbol,
|
59
|
+
page_number: Integer,
|
60
|
+
page_size: Integer,
|
61
|
+
request_options: Dodopayments::RequestOptions
|
62
|
+
}
|
63
|
+
)
|
64
|
+
end
|
65
|
+
def to_hash
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
@@ -0,0 +1,140 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module Dodopayments
|
4
|
+
module Models
|
5
|
+
class LicenseActivateResponse < Dodopayments::Internal::Type::BaseModel
|
6
|
+
OrHash =
|
7
|
+
T.type_alias do
|
8
|
+
T.any(
|
9
|
+
Dodopayments::Models::LicenseActivateResponse,
|
10
|
+
Dodopayments::Internal::AnyHash
|
11
|
+
)
|
12
|
+
end
|
13
|
+
|
14
|
+
# License key instance ID
|
15
|
+
sig { returns(String) }
|
16
|
+
attr_accessor :id
|
17
|
+
|
18
|
+
# Business ID
|
19
|
+
sig { returns(String) }
|
20
|
+
attr_accessor :business_id
|
21
|
+
|
22
|
+
# Creation timestamp
|
23
|
+
sig { returns(Time) }
|
24
|
+
attr_accessor :created_at
|
25
|
+
|
26
|
+
# Limited customer details associated with the license key.
|
27
|
+
sig { returns(Dodopayments::CustomerLimitedDetails) }
|
28
|
+
attr_reader :customer
|
29
|
+
|
30
|
+
sig do
|
31
|
+
params(customer: Dodopayments::CustomerLimitedDetails::OrHash).void
|
32
|
+
end
|
33
|
+
attr_writer :customer
|
34
|
+
|
35
|
+
# Associated license key ID
|
36
|
+
sig { returns(String) }
|
37
|
+
attr_accessor :license_key_id
|
38
|
+
|
39
|
+
# Instance name
|
40
|
+
sig { returns(String) }
|
41
|
+
attr_accessor :name
|
42
|
+
|
43
|
+
# Related product info. Present if the license key is tied to a product.
|
44
|
+
sig { returns(Dodopayments::Models::LicenseActivateResponse::Product) }
|
45
|
+
attr_reader :product
|
46
|
+
|
47
|
+
sig do
|
48
|
+
params(
|
49
|
+
product:
|
50
|
+
Dodopayments::Models::LicenseActivateResponse::Product::OrHash
|
51
|
+
).void
|
52
|
+
end
|
53
|
+
attr_writer :product
|
54
|
+
|
55
|
+
sig do
|
56
|
+
params(
|
57
|
+
id: String,
|
58
|
+
business_id: String,
|
59
|
+
created_at: Time,
|
60
|
+
customer: Dodopayments::CustomerLimitedDetails::OrHash,
|
61
|
+
license_key_id: String,
|
62
|
+
name: String,
|
63
|
+
product:
|
64
|
+
Dodopayments::Models::LicenseActivateResponse::Product::OrHash
|
65
|
+
).returns(T.attached_class)
|
66
|
+
end
|
67
|
+
def self.new(
|
68
|
+
# License key instance ID
|
69
|
+
id:,
|
70
|
+
# Business ID
|
71
|
+
business_id:,
|
72
|
+
# Creation timestamp
|
73
|
+
created_at:,
|
74
|
+
# Limited customer details associated with the license key.
|
75
|
+
customer:,
|
76
|
+
# Associated license key ID
|
77
|
+
license_key_id:,
|
78
|
+
# Instance name
|
79
|
+
name:,
|
80
|
+
# Related product info. Present if the license key is tied to a product.
|
81
|
+
product:
|
82
|
+
)
|
83
|
+
end
|
84
|
+
|
85
|
+
sig do
|
86
|
+
override.returns(
|
87
|
+
{
|
88
|
+
id: String,
|
89
|
+
business_id: String,
|
90
|
+
created_at: Time,
|
91
|
+
customer: Dodopayments::CustomerLimitedDetails,
|
92
|
+
license_key_id: String,
|
93
|
+
name: String,
|
94
|
+
product: Dodopayments::Models::LicenseActivateResponse::Product
|
95
|
+
}
|
96
|
+
)
|
97
|
+
end
|
98
|
+
def to_hash
|
99
|
+
end
|
100
|
+
|
101
|
+
class Product < Dodopayments::Internal::Type::BaseModel
|
102
|
+
OrHash =
|
103
|
+
T.type_alias do
|
104
|
+
T.any(
|
105
|
+
Dodopayments::Models::LicenseActivateResponse::Product,
|
106
|
+
Dodopayments::Internal::AnyHash
|
107
|
+
)
|
108
|
+
end
|
109
|
+
|
110
|
+
# Unique identifier for the product.
|
111
|
+
sig { returns(String) }
|
112
|
+
attr_accessor :product_id
|
113
|
+
|
114
|
+
# Name of the product, if set by the merchant.
|
115
|
+
sig { returns(T.nilable(String)) }
|
116
|
+
attr_accessor :name
|
117
|
+
|
118
|
+
# Related product info. Present if the license key is tied to a product.
|
119
|
+
sig do
|
120
|
+
params(product_id: String, name: T.nilable(String)).returns(
|
121
|
+
T.attached_class
|
122
|
+
)
|
123
|
+
end
|
124
|
+
def self.new(
|
125
|
+
# Unique identifier for the product.
|
126
|
+
product_id:,
|
127
|
+
# Name of the product, if set by the merchant.
|
128
|
+
name: nil
|
129
|
+
)
|
130
|
+
end
|
131
|
+
|
132
|
+
sig do
|
133
|
+
override.returns({ product_id: String, name: T.nilable(String) })
|
134
|
+
end
|
135
|
+
def to_hash
|
136
|
+
end
|
137
|
+
end
|
138
|
+
end
|
139
|
+
end
|
140
|
+
end
|
@@ -57,7 +57,7 @@ module Dodopayments
|
|
57
57
|
attr_accessor :payment_id
|
58
58
|
|
59
59
|
# List of refunds issued for this payment
|
60
|
-
sig { returns(T::Array[Dodopayments::Refund]) }
|
60
|
+
sig { returns(T::Array[Dodopayments::Payment::Refund]) }
|
61
61
|
attr_accessor :refunds
|
62
62
|
|
63
63
|
# The amount that will be credited to your Dodo balance after currency conversion
|
@@ -160,7 +160,7 @@ module Dodopayments
|
|
160
160
|
disputes: T::Array[Dodopayments::Dispute::OrHash],
|
161
161
|
metadata: T::Hash[Symbol, String],
|
162
162
|
payment_id: String,
|
163
|
-
refunds: T::Array[Dodopayments::Refund::OrHash],
|
163
|
+
refunds: T::Array[Dodopayments::Payment::Refund::OrHash],
|
164
164
|
settlement_amount: Integer,
|
165
165
|
settlement_currency: Dodopayments::Currency::OrSymbol,
|
166
166
|
total_amount: Integer,
|
@@ -271,7 +271,7 @@ module Dodopayments
|
|
271
271
|
disputes: T::Array[Dodopayments::Dispute],
|
272
272
|
metadata: T::Hash[Symbol, String],
|
273
273
|
payment_id: String,
|
274
|
-
refunds: T::Array[Dodopayments::Refund],
|
274
|
+
refunds: T::Array[Dodopayments::Payment::Refund],
|
275
275
|
settlement_amount: Integer,
|
276
276
|
settlement_currency: Dodopayments::Currency::TaggedSymbol,
|
277
277
|
total_amount: Integer,
|
@@ -300,6 +300,105 @@ module Dodopayments
|
|
300
300
|
def to_hash
|
301
301
|
end
|
302
302
|
|
303
|
+
class Refund < Dodopayments::Internal::Type::BaseModel
|
304
|
+
OrHash =
|
305
|
+
T.type_alias do
|
306
|
+
T.any(
|
307
|
+
Dodopayments::Payment::Refund,
|
308
|
+
Dodopayments::Internal::AnyHash
|
309
|
+
)
|
310
|
+
end
|
311
|
+
|
312
|
+
# The unique identifier of the business issuing the refund.
|
313
|
+
sig { returns(String) }
|
314
|
+
attr_accessor :business_id
|
315
|
+
|
316
|
+
# The timestamp of when the refund was created in UTC.
|
317
|
+
sig { returns(Time) }
|
318
|
+
attr_accessor :created_at
|
319
|
+
|
320
|
+
# If true the refund is a partial refund
|
321
|
+
sig { returns(T::Boolean) }
|
322
|
+
attr_accessor :is_partial
|
323
|
+
|
324
|
+
# The unique identifier of the payment associated with the refund.
|
325
|
+
sig { returns(String) }
|
326
|
+
attr_accessor :payment_id
|
327
|
+
|
328
|
+
# The unique identifier of the refund.
|
329
|
+
sig { returns(String) }
|
330
|
+
attr_accessor :refund_id
|
331
|
+
|
332
|
+
# The current status of the refund.
|
333
|
+
sig { returns(Dodopayments::RefundStatus::TaggedSymbol) }
|
334
|
+
attr_accessor :status
|
335
|
+
|
336
|
+
# The refunded amount.
|
337
|
+
sig { returns(T.nilable(Integer)) }
|
338
|
+
attr_accessor :amount
|
339
|
+
|
340
|
+
# The currency of the refund, represented as an ISO 4217 currency code.
|
341
|
+
sig { returns(T.nilable(Dodopayments::Currency::TaggedSymbol)) }
|
342
|
+
attr_accessor :currency
|
343
|
+
|
344
|
+
# The reason provided for the refund, if any. Optional.
|
345
|
+
sig { returns(T.nilable(String)) }
|
346
|
+
attr_accessor :reason
|
347
|
+
|
348
|
+
sig do
|
349
|
+
params(
|
350
|
+
business_id: String,
|
351
|
+
created_at: Time,
|
352
|
+
is_partial: T::Boolean,
|
353
|
+
payment_id: String,
|
354
|
+
refund_id: String,
|
355
|
+
status: Dodopayments::RefundStatus::OrSymbol,
|
356
|
+
amount: T.nilable(Integer),
|
357
|
+
currency: T.nilable(Dodopayments::Currency::OrSymbol),
|
358
|
+
reason: T.nilable(String)
|
359
|
+
).returns(T.attached_class)
|
360
|
+
end
|
361
|
+
def self.new(
|
362
|
+
# The unique identifier of the business issuing the refund.
|
363
|
+
business_id:,
|
364
|
+
# The timestamp of when the refund was created in UTC.
|
365
|
+
created_at:,
|
366
|
+
# If true the refund is a partial refund
|
367
|
+
is_partial:,
|
368
|
+
# The unique identifier of the payment associated with the refund.
|
369
|
+
payment_id:,
|
370
|
+
# The unique identifier of the refund.
|
371
|
+
refund_id:,
|
372
|
+
# The current status of the refund.
|
373
|
+
status:,
|
374
|
+
# The refunded amount.
|
375
|
+
amount: nil,
|
376
|
+
# The currency of the refund, represented as an ISO 4217 currency code.
|
377
|
+
currency: nil,
|
378
|
+
# The reason provided for the refund, if any. Optional.
|
379
|
+
reason: nil
|
380
|
+
)
|
381
|
+
end
|
382
|
+
|
383
|
+
sig do
|
384
|
+
override.returns(
|
385
|
+
{
|
386
|
+
business_id: String,
|
387
|
+
created_at: Time,
|
388
|
+
is_partial: T::Boolean,
|
389
|
+
payment_id: String,
|
390
|
+
refund_id: String,
|
391
|
+
status: Dodopayments::RefundStatus::TaggedSymbol,
|
392
|
+
amount: T.nilable(Integer),
|
393
|
+
currency: T.nilable(Dodopayments::Currency::TaggedSymbol),
|
394
|
+
reason: T.nilable(String)
|
395
|
+
}
|
396
|
+
)
|
397
|
+
end
|
398
|
+
def to_hash
|
399
|
+
end
|
400
|
+
end
|
401
|
+
|
303
402
|
class ProductCart < Dodopayments::Internal::Type::BaseModel
|
304
403
|
OrHash =
|
305
404
|
T.type_alias do
|
@@ -16,6 +16,15 @@ module Dodopayments
|
|
16
16
|
sig { returns(Time) }
|
17
17
|
attr_accessor :created_at
|
18
18
|
|
19
|
+
# Details about the customer for this refund (from the associated payment)
|
20
|
+
sig { returns(Dodopayments::CustomerLimitedDetails) }
|
21
|
+
attr_reader :customer
|
22
|
+
|
23
|
+
sig do
|
24
|
+
params(customer: Dodopayments::CustomerLimitedDetails::OrHash).void
|
25
|
+
end
|
26
|
+
attr_writer :customer
|
27
|
+
|
19
28
|
# If true the refund is a partial refund
|
20
29
|
sig { returns(T::Boolean) }
|
21
30
|
attr_accessor :is_partial
|
@@ -48,6 +57,7 @@ module Dodopayments
|
|
48
57
|
params(
|
49
58
|
business_id: String,
|
50
59
|
created_at: Time,
|
60
|
+
customer: Dodopayments::CustomerLimitedDetails::OrHash,
|
51
61
|
is_partial: T::Boolean,
|
52
62
|
payment_id: String,
|
53
63
|
refund_id: String,
|
@@ -62,6 +72,8 @@ module Dodopayments
|
|
62
72
|
business_id:,
|
63
73
|
# The timestamp of when the refund was created in UTC.
|
64
74
|
created_at:,
|
75
|
+
# Details about the customer for this refund (from the associated payment)
|
76
|
+
customer:,
|
65
77
|
# If true the refund is a partial refund
|
66
78
|
is_partial:,
|
67
79
|
# The unique identifier of the payment associated with the refund.
|
@@ -84,6 +96,7 @@ module Dodopayments
|
|
84
96
|
{
|
85
97
|
business_id: String,
|
86
98
|
created_at: Time,
|
99
|
+
customer: Dodopayments::CustomerLimitedDetails,
|
87
100
|
is_partial: T::Boolean,
|
88
101
|
payment_id: String,
|
89
102
|
refund_id: String,
|
@@ -0,0 +1,104 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module Dodopayments
|
4
|
+
module Models
|
5
|
+
class RefundListResponse < Dodopayments::Internal::Type::BaseModel
|
6
|
+
OrHash =
|
7
|
+
T.type_alias do
|
8
|
+
T.any(
|
9
|
+
Dodopayments::Models::RefundListResponse,
|
10
|
+
Dodopayments::Internal::AnyHash
|
11
|
+
)
|
12
|
+
end
|
13
|
+
|
14
|
+
# The unique identifier of the business issuing the refund.
|
15
|
+
sig { returns(String) }
|
16
|
+
attr_accessor :business_id
|
17
|
+
|
18
|
+
# The timestamp of when the refund was created in UTC.
|
19
|
+
sig { returns(Time) }
|
20
|
+
attr_accessor :created_at
|
21
|
+
|
22
|
+
# If true the refund is a partial refund
|
23
|
+
sig { returns(T::Boolean) }
|
24
|
+
attr_accessor :is_partial
|
25
|
+
|
26
|
+
# The unique identifier of the payment associated with the refund.
|
27
|
+
sig { returns(String) }
|
28
|
+
attr_accessor :payment_id
|
29
|
+
|
30
|
+
# The unique identifier of the refund.
|
31
|
+
sig { returns(String) }
|
32
|
+
attr_accessor :refund_id
|
33
|
+
|
34
|
+
# The current status of the refund.
|
35
|
+
sig { returns(Dodopayments::RefundStatus::TaggedSymbol) }
|
36
|
+
attr_accessor :status
|
37
|
+
|
38
|
+
# The refunded amount.
|
39
|
+
sig { returns(T.nilable(Integer)) }
|
40
|
+
attr_accessor :amount
|
41
|
+
|
42
|
+
# The currency of the refund, represented as an ISO 4217 currency code.
|
43
|
+
sig { returns(T.nilable(Dodopayments::Currency::TaggedSymbol)) }
|
44
|
+
attr_accessor :currency
|
45
|
+
|
46
|
+
# The reason provided for the refund, if any. Optional.
|
47
|
+
sig { returns(T.nilable(String)) }
|
48
|
+
attr_accessor :reason
|
49
|
+
|
50
|
+
sig do
|
51
|
+
params(
|
52
|
+
business_id: String,
|
53
|
+
created_at: Time,
|
54
|
+
is_partial: T::Boolean,
|
55
|
+
payment_id: String,
|
56
|
+
refund_id: String,
|
57
|
+
status: Dodopayments::RefundStatus::OrSymbol,
|
58
|
+
amount: T.nilable(Integer),
|
59
|
+
currency: T.nilable(Dodopayments::Currency::OrSymbol),
|
60
|
+
reason: T.nilable(String)
|
61
|
+
).returns(T.attached_class)
|
62
|
+
end
|
63
|
+
def self.new(
|
64
|
+
# The unique identifier of the business issuing the refund.
|
65
|
+
business_id:,
|
66
|
+
# The timestamp of when the refund was created in UTC.
|
67
|
+
created_at:,
|
68
|
+
# If true the refund is a partial refund
|
69
|
+
is_partial:,
|
70
|
+
# The unique identifier of the payment associated with the refund.
|
71
|
+
payment_id:,
|
72
|
+
# The unique identifier of the refund.
|
73
|
+
refund_id:,
|
74
|
+
# The current status of the refund.
|
75
|
+
status:,
|
76
|
+
# The refunded amount.
|
77
|
+
amount: nil,
|
78
|
+
# The currency of the refund, represented as an ISO 4217 currency code.
|
79
|
+
currency: nil,
|
80
|
+
# The reason provided for the refund, if any. Optional.
|
81
|
+
reason: nil
|
82
|
+
)
|
83
|
+
end
|
84
|
+
|
85
|
+
sig do
|
86
|
+
override.returns(
|
87
|
+
{
|
88
|
+
business_id: String,
|
89
|
+
created_at: Time,
|
90
|
+
is_partial: T::Boolean,
|
91
|
+
payment_id: String,
|
92
|
+
refund_id: String,
|
93
|
+
status: Dodopayments::RefundStatus::TaggedSymbol,
|
94
|
+
amount: T.nilable(Integer),
|
95
|
+
currency: T.nilable(Dodopayments::Currency::TaggedSymbol),
|
96
|
+
reason: T.nilable(String)
|
97
|
+
}
|
98
|
+
)
|
99
|
+
end
|
100
|
+
def to_hash
|
101
|
+
end
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|