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.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +8 -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/payment.rb +78 -3
  12. data/lib/dodopayments/models/refund.rb +9 -1
  13. data/lib/dodopayments/models/refund_list_response.rb +81 -0
  14. data/lib/dodopayments/models/subscription_charge_params.rb +32 -1
  15. data/lib/dodopayments/resources/customers/wallets/ledger_entries.rb +75 -0
  16. data/lib/dodopayments/resources/customers/wallets.rb +38 -0
  17. data/lib/dodopayments/resources/customers.rb +4 -0
  18. data/lib/dodopayments/resources/licenses.rb +2 -2
  19. data/lib/dodopayments/resources/refunds.rb +2 -2
  20. data/lib/dodopayments/resources/subscriptions.rb +3 -1
  21. data/lib/dodopayments/version.rb +1 -1
  22. data/lib/dodopayments.rb +10 -0
  23. data/rbi/dodopayments/models/customers/customer_wallet.rbi +66 -0
  24. data/rbi/dodopayments/models/customers/wallet_list_params.rbi +34 -0
  25. data/rbi/dodopayments/models/customers/wallet_list_response.rbi +48 -0
  26. data/rbi/dodopayments/models/customers/wallets/customer_wallet_transaction.rbi +173 -0
  27. data/rbi/dodopayments/models/customers/wallets/ledger_entry_create_params.rbi +119 -0
  28. data/rbi/dodopayments/models/customers/wallets/ledger_entry_list_params.rbi +71 -0
  29. data/rbi/dodopayments/models/license_activate_response.rbi +140 -0
  30. data/rbi/dodopayments/models/payment.rbi +102 -3
  31. data/rbi/dodopayments/models/refund.rbi +13 -0
  32. data/rbi/dodopayments/models/refund_list_response.rbi +104 -0
  33. data/rbi/dodopayments/models/subscription_charge_params.rbi +74 -0
  34. data/rbi/dodopayments/resources/customers/wallets/ledger_entries.rbi +67 -0
  35. data/rbi/dodopayments/resources/customers/wallets.rbi +32 -0
  36. data/rbi/dodopayments/resources/customers.rbi +3 -0
  37. data/rbi/dodopayments/resources/licenses.rbi +1 -1
  38. data/rbi/dodopayments/resources/refunds.rbi +1 -1
  39. data/rbi/dodopayments/resources/subscriptions.rbi +6 -0
  40. data/sig/dodopayments/models/customers/customer_wallet.rbs +44 -0
  41. data/sig/dodopayments/models/customers/wallet_list_params.rbs +17 -0
  42. data/sig/dodopayments/models/customers/wallet_list_response.rbs +27 -0
  43. data/sig/dodopayments/models/customers/wallets/customer_wallet_transaction.rbs +102 -0
  44. data/sig/dodopayments/models/customers/wallets/ledger_entry_create_params.rbs +61 -0
  45. data/sig/dodopayments/models/customers/wallets/ledger_entry_list_params.rbs +48 -0
  46. data/sig/dodopayments/models/license_activate_response.rbs +62 -0
  47. data/sig/dodopayments/models/payment.rbs +61 -4
  48. data/sig/dodopayments/models/refund.rbs +5 -0
  49. data/sig/dodopayments/models/refund_list_response.rbs +60 -0
  50. data/sig/dodopayments/models/subscription_charge_params.rbs +27 -0
  51. data/sig/dodopayments/resources/customers/wallets/ledger_entries.rbs +29 -0
  52. data/sig/dodopayments/resources/customers/wallets.rbs +16 -0
  53. data/sig/dodopayments/resources/customers.rbs +2 -0
  54. data/sig/dodopayments/resources/licenses.rbs +1 -1
  55. data/sig/dodopayments/resources/refunds.rbs +1 -1
  56. data/sig/dodopayments/resources/subscriptions.rbs +1 -0
  57. metadata +32 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 90035c1d14b5aa55b3c8e33db01257b8f45bb2636259d2aca65d08f77a8303b2
4
- data.tar.gz: 17bb0b417c9f606ee48df9a06bec7ecf9b8d7b1985146d6c03190509aeddc775
3
+ metadata.gz: bb2f30302531705f194f8d09e1d5089cc9fe3fc8aea054da364ba62d46443711
4
+ data.tar.gz: 6adf25e6ee0b749862d00605d9df09e1264dd5bab4d7be103ae9007cc426a51a
5
5
  SHA512:
6
- metadata.gz: 193a65895d8e20cf1f818a6ea8f725a00a0bffefeaaf46def43ec2f1c64fb4662e1c845cda63e72fa4f4df6e4ecbd485fe4153ddc4c7ea6d4333380002300b6a
7
- data.tar.gz: 6a50f094b283c7d173271bba624b2cd95346f9519dc9f051d404e90852def09a57011afdb47f7765057cb915cf3197f8651e5109ea9cac8f09a85ab45791b4c6
6
+ metadata.gz: b5156a2dc8e2c6097bc665a6f1c8ba88e61df89ec439ec2c1e4b3e148260ef6f07e396d6f8ca49a8f388189a3d3532417dabbcc3511c9198742abd6e0101b11e
7
+ data.tar.gz: f438f2c43c49bb731a956491eb90da07f7576d2ae711c26fcdfa9a7647f2e8615104eb7a26e41e098cf1604e7bab472284703c3ac2762764145b07dfb8a347c7
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.53.2 (2025-09-13)
4
+
5
+ Full Changelog: [v1.52.5...v1.53.2](https://github.com/dodopayments/dodopayments-ruby/compare/v1.52.5...v1.53.2)
6
+
7
+ ### Features
8
+
9
+ * **api:** updated openapi spec to v1.53.2 with customer credits. ([c367cc9](https://github.com/dodopayments/dodopayments-ruby/commit/c367cc958324895dbb042f095a42a8db5f4dccee))
10
+
3
11
  ## 1.52.5 (2025-09-04)
4
12
 
5
13
  Full Changelog: [v1.52.4...v1.52.5](https://github.com/dodopayments/dodopayments-ruby/compare/v1.52.4...v1.52.5)
data/README.md CHANGED
@@ -17,7 +17,7 @@ To use this gem, install via Bundler by adding the following to your application
17
17
  <!-- x-release-please-start-version -->
18
18
 
19
19
  ```ruby
20
- gem "dodopayments", "~> 1.52.5"
20
+ gem "dodopayments", "~> 1.53.2"
21
21
  ```
22
22
 
23
23
  <!-- x-release-please-end -->
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ module Customers
6
+ class CustomerWallet < Dodopayments::Internal::Type::BaseModel
7
+ # @!attribute balance
8
+ #
9
+ # @return [Integer]
10
+ required :balance, Integer
11
+
12
+ # @!attribute created_at
13
+ #
14
+ # @return [Time]
15
+ required :created_at, Time
16
+
17
+ # @!attribute currency
18
+ #
19
+ # @return [Symbol, Dodopayments::Models::Currency]
20
+ required :currency, enum: -> { Dodopayments::Currency }
21
+
22
+ # @!attribute customer_id
23
+ #
24
+ # @return [String]
25
+ required :customer_id, String
26
+
27
+ # @!attribute updated_at
28
+ #
29
+ # @return [Time]
30
+ required :updated_at, Time
31
+
32
+ # @!method initialize(balance:, created_at:, currency:, customer_id:, updated_at:)
33
+ # @param balance [Integer]
34
+ # @param created_at [Time]
35
+ # @param currency [Symbol, Dodopayments::Models::Currency]
36
+ # @param customer_id [String]
37
+ # @param updated_at [Time]
38
+ end
39
+ end
40
+
41
+ CustomerWallet = Customers::CustomerWallet
42
+ end
43
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ module Customers
6
+ # @see Dodopayments::Resources::Customers::Wallets#list
7
+ class WalletListParams < Dodopayments::Internal::Type::BaseModel
8
+ extend Dodopayments::Internal::Type::RequestParameters::Converter
9
+ include Dodopayments::Internal::Type::RequestParameters
10
+
11
+ # @!method initialize(request_options: {})
12
+ # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ module Customers
6
+ # @see Dodopayments::Resources::Customers::Wallets#list
7
+ class WalletListResponse < Dodopayments::Internal::Type::BaseModel
8
+ # @!attribute items
9
+ #
10
+ # @return [Array<Dodopayments::Models::Customers::CustomerWallet>]
11
+ required :items, -> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::Customers::CustomerWallet] }
12
+
13
+ # @!attribute total_balance_usd
14
+ # Sum of all wallet balances converted to USD (in smallest unit)
15
+ #
16
+ # @return [Integer]
17
+ required :total_balance_usd, Integer
18
+
19
+ # @!method initialize(items:, total_balance_usd:)
20
+ # @param items [Array<Dodopayments::Models::Customers::CustomerWallet>]
21
+ #
22
+ # @param total_balance_usd [Integer] Sum of all wallet balances converted to USD (in smallest unit)
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,102 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ module Customers
6
+ module Wallets
7
+ # @see Dodopayments::Resources::Customers::Wallets::LedgerEntries#list
8
+ class CustomerWalletTransaction < Dodopayments::Internal::Type::BaseModel
9
+ # @!attribute id
10
+ #
11
+ # @return [String]
12
+ required :id, String
13
+
14
+ # @!attribute after_balance
15
+ #
16
+ # @return [Integer]
17
+ required :after_balance, Integer
18
+
19
+ # @!attribute amount
20
+ #
21
+ # @return [Integer]
22
+ required :amount, Integer
23
+
24
+ # @!attribute before_balance
25
+ #
26
+ # @return [Integer]
27
+ required :before_balance, Integer
28
+
29
+ # @!attribute business_id
30
+ #
31
+ # @return [String]
32
+ required :business_id, String
33
+
34
+ # @!attribute created_at
35
+ #
36
+ # @return [Time]
37
+ required :created_at, Time
38
+
39
+ # @!attribute currency
40
+ #
41
+ # @return [Symbol, Dodopayments::Models::Currency]
42
+ required :currency, enum: -> { Dodopayments::Currency }
43
+
44
+ # @!attribute customer_id
45
+ #
46
+ # @return [String]
47
+ required :customer_id, String
48
+
49
+ # @!attribute event_type
50
+ #
51
+ # @return [Symbol, Dodopayments::Models::Customers::Wallets::CustomerWalletTransaction::EventType]
52
+ required :event_type, enum: -> { Dodopayments::Customers::Wallets::CustomerWalletTransaction::EventType }
53
+
54
+ # @!attribute is_credit
55
+ #
56
+ # @return [Boolean]
57
+ required :is_credit, Dodopayments::Internal::Type::Boolean
58
+
59
+ # @!attribute reason
60
+ #
61
+ # @return [String, nil]
62
+ optional :reason, String, nil?: true
63
+
64
+ # @!attribute reference_object_id
65
+ #
66
+ # @return [String, nil]
67
+ optional :reference_object_id, String, nil?: true
68
+
69
+ # @!method initialize(id:, after_balance:, amount:, before_balance:, business_id:, created_at:, currency:, customer_id:, event_type:, is_credit:, reason: nil, reference_object_id: nil)
70
+ # @param id [String]
71
+ # @param after_balance [Integer]
72
+ # @param amount [Integer]
73
+ # @param before_balance [Integer]
74
+ # @param business_id [String]
75
+ # @param created_at [Time]
76
+ # @param currency [Symbol, Dodopayments::Models::Currency]
77
+ # @param customer_id [String]
78
+ # @param event_type [Symbol, Dodopayments::Models::Customers::Wallets::CustomerWalletTransaction::EventType]
79
+ # @param is_credit [Boolean]
80
+ # @param reason [String, nil]
81
+ # @param reference_object_id [String, nil]
82
+
83
+ # @see Dodopayments::Models::Customers::Wallets::CustomerWalletTransaction#event_type
84
+ module EventType
85
+ extend Dodopayments::Internal::Type::Enum
86
+
87
+ PAYMENT = :payment
88
+ PAYMENT_REVERSAL = :payment_reversal
89
+ REFUND = :refund
90
+ REFUND_REVERSAL = :refund_reversal
91
+ DISPUTE = :dispute
92
+ DISPUTE_REVERSAL = :dispute_reversal
93
+ MERCHANT_ADJUSTMENT = :merchant_adjustment
94
+
95
+ # @!method self.values
96
+ # @return [Array<Symbol>]
97
+ end
98
+ end
99
+ end
100
+ end
101
+ end
102
+ end
@@ -0,0 +1,67 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ module Customers
6
+ module Wallets
7
+ # @see Dodopayments::Resources::Customers::Wallets::LedgerEntries#create
8
+ class LedgerEntryCreateParams < Dodopayments::Internal::Type::BaseModel
9
+ extend Dodopayments::Internal::Type::RequestParameters::Converter
10
+ include Dodopayments::Internal::Type::RequestParameters
11
+
12
+ # @!attribute amount
13
+ #
14
+ # @return [Integer]
15
+ required :amount, Integer
16
+
17
+ # @!attribute currency
18
+ # Currency of the wallet to adjust
19
+ #
20
+ # @return [Symbol, Dodopayments::Models::Currency]
21
+ required :currency, enum: -> { Dodopayments::Currency }
22
+
23
+ # @!attribute entry_type
24
+ # Type of ledger entry - credit or debit
25
+ #
26
+ # @return [Symbol, Dodopayments::Models::Customers::Wallets::LedgerEntryCreateParams::EntryType]
27
+ required :entry_type, enum: -> { Dodopayments::Customers::Wallets::LedgerEntryCreateParams::EntryType }
28
+
29
+ # @!attribute idempotency_key
30
+ # Optional idempotency key to prevent duplicate entries
31
+ #
32
+ # @return [String, nil]
33
+ optional :idempotency_key, String, nil?: true
34
+
35
+ # @!attribute reason
36
+ #
37
+ # @return [String, nil]
38
+ optional :reason, String, nil?: true
39
+
40
+ # @!method initialize(amount:, currency:, entry_type:, idempotency_key: nil, reason: nil, request_options: {})
41
+ # @param amount [Integer]
42
+ #
43
+ # @param currency [Symbol, Dodopayments::Models::Currency] Currency of the wallet to adjust
44
+ #
45
+ # @param entry_type [Symbol, Dodopayments::Models::Customers::Wallets::LedgerEntryCreateParams::EntryType] Type of ledger entry - credit or debit
46
+ #
47
+ # @param idempotency_key [String, nil] Optional idempotency key to prevent duplicate entries
48
+ #
49
+ # @param reason [String, nil]
50
+ #
51
+ # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
52
+
53
+ # Type of ledger entry - credit or debit
54
+ module EntryType
55
+ extend Dodopayments::Internal::Type::Enum
56
+
57
+ CREDIT = :credit
58
+ DEBIT = :debit
59
+
60
+ # @!method self.values
61
+ # @return [Array<Symbol>]
62
+ end
63
+ end
64
+ end
65
+ end
66
+ end
67
+ end
@@ -0,0 +1,40 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ module Customers
6
+ module Wallets
7
+ # @see Dodopayments::Resources::Customers::Wallets::LedgerEntries#list
8
+ class LedgerEntryListParams < Dodopayments::Internal::Type::BaseModel
9
+ extend Dodopayments::Internal::Type::RequestParameters::Converter
10
+ include Dodopayments::Internal::Type::RequestParameters
11
+
12
+ # @!attribute currency
13
+ # Optional currency filter
14
+ #
15
+ # @return [Symbol, Dodopayments::Models::Currency, nil]
16
+ optional :currency, enum: -> { Dodopayments::Currency }
17
+
18
+ # @!attribute page_number
19
+ #
20
+ # @return [Integer, nil]
21
+ optional :page_number, Integer
22
+
23
+ # @!attribute page_size
24
+ #
25
+ # @return [Integer, nil]
26
+ optional :page_size, Integer
27
+
28
+ # @!method initialize(currency: nil, page_number: nil, page_size: nil, request_options: {})
29
+ # @param currency [Symbol, Dodopayments::Models::Currency] Optional currency filter
30
+ #
31
+ # @param page_number [Integer]
32
+ #
33
+ # @param page_size [Integer]
34
+ #
35
+ # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,87 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ # @see Dodopayments::Resources::Licenses#activate
6
+ class LicenseActivateResponse < Dodopayments::Internal::Type::BaseModel
7
+ # @!attribute id
8
+ # License key instance ID
9
+ #
10
+ # @return [String]
11
+ required :id, String
12
+
13
+ # @!attribute business_id
14
+ # Business ID
15
+ #
16
+ # @return [String]
17
+ required :business_id, String
18
+
19
+ # @!attribute created_at
20
+ # Creation timestamp
21
+ #
22
+ # @return [Time]
23
+ required :created_at, Time
24
+
25
+ # @!attribute customer
26
+ # Limited customer details associated with the license key.
27
+ #
28
+ # @return [Dodopayments::Models::CustomerLimitedDetails]
29
+ required :customer, -> { Dodopayments::CustomerLimitedDetails }
30
+
31
+ # @!attribute license_key_id
32
+ # Associated license key ID
33
+ #
34
+ # @return [String]
35
+ required :license_key_id, String
36
+
37
+ # @!attribute name
38
+ # Instance name
39
+ #
40
+ # @return [String]
41
+ required :name, String
42
+
43
+ # @!attribute product
44
+ # Related product info. Present if the license key is tied to a product.
45
+ #
46
+ # @return [Dodopayments::Models::LicenseActivateResponse::Product]
47
+ required :product, -> { Dodopayments::Models::LicenseActivateResponse::Product }
48
+
49
+ # @!method initialize(id:, business_id:, created_at:, customer:, license_key_id:, name:, product:)
50
+ # @param id [String] License key instance ID
51
+ #
52
+ # @param business_id [String] Business ID
53
+ #
54
+ # @param created_at [Time] Creation timestamp
55
+ #
56
+ # @param customer [Dodopayments::Models::CustomerLimitedDetails] Limited customer details associated with the license key.
57
+ #
58
+ # @param license_key_id [String] Associated license key ID
59
+ #
60
+ # @param name [String] Instance name
61
+ #
62
+ # @param product [Dodopayments::Models::LicenseActivateResponse::Product] Related product info. Present if the license key is tied to a product.
63
+
64
+ # @see Dodopayments::Models::LicenseActivateResponse#product
65
+ class Product < Dodopayments::Internal::Type::BaseModel
66
+ # @!attribute product_id
67
+ # Unique identifier for the product.
68
+ #
69
+ # @return [String]
70
+ required :product_id, String
71
+
72
+ # @!attribute name
73
+ # Name of the product, if set by the merchant.
74
+ #
75
+ # @return [String, nil]
76
+ optional :name, String, nil?: true
77
+
78
+ # @!method initialize(product_id:, name: nil)
79
+ # Related product info. Present if the license key is tied to a product.
80
+ #
81
+ # @param product_id [String] Unique identifier for the product.
82
+ #
83
+ # @param name [String, nil] Name of the product, if set by the merchant.
84
+ end
85
+ end
86
+ end
87
+ end
@@ -67,8 +67,8 @@ module Dodopayments
67
67
  # @!attribute refunds
68
68
  # List of refunds issued for this payment
69
69
  #
70
- # @return [Array<Dodopayments::Models::Refund>]
71
- required :refunds, -> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::Refund] }
70
+ # @return [Array<Dodopayments::Models::Payment::Refund>]
71
+ required :refunds, -> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::Payment::Refund] }
72
72
 
73
73
  # @!attribute settlement_amount
74
74
  # The amount that will be credited to your Dodo balance after currency conversion
@@ -224,7 +224,7 @@ module Dodopayments
224
224
  #
225
225
  # @param payment_id [String] Unique identifier for the payment
226
226
  #
227
- # @param refunds [Array<Dodopayments::Models::Refund>] List of refunds issued for this payment
227
+ # @param refunds [Array<Dodopayments::Models::Payment::Refund>] List of refunds issued for this payment
228
228
  #
229
229
  # @param settlement_amount [Integer] The amount that will be credited to your Dodo balance after currency conversion
230
230
  #
@@ -266,6 +266,81 @@ module Dodopayments
266
266
  #
267
267
  # @param updated_at [Time, nil] Timestamp when the payment was last updated
268
268
 
269
+ class Refund < Dodopayments::Internal::Type::BaseModel
270
+ # @!attribute business_id
271
+ # The unique identifier of the business issuing the refund.
272
+ #
273
+ # @return [String]
274
+ required :business_id, String
275
+
276
+ # @!attribute created_at
277
+ # The timestamp of when the refund was created in UTC.
278
+ #
279
+ # @return [Time]
280
+ required :created_at, Time
281
+
282
+ # @!attribute is_partial
283
+ # If true the refund is a partial refund
284
+ #
285
+ # @return [Boolean]
286
+ required :is_partial, Dodopayments::Internal::Type::Boolean
287
+
288
+ # @!attribute payment_id
289
+ # The unique identifier of the payment associated with the refund.
290
+ #
291
+ # @return [String]
292
+ required :payment_id, String
293
+
294
+ # @!attribute refund_id
295
+ # The unique identifier of the refund.
296
+ #
297
+ # @return [String]
298
+ required :refund_id, String
299
+
300
+ # @!attribute status
301
+ # The current status of the refund.
302
+ #
303
+ # @return [Symbol, Dodopayments::Models::RefundStatus]
304
+ required :status, enum: -> { Dodopayments::RefundStatus }
305
+
306
+ # @!attribute amount
307
+ # The refunded amount.
308
+ #
309
+ # @return [Integer, nil]
310
+ optional :amount, Integer, nil?: true
311
+
312
+ # @!attribute currency
313
+ # The currency of the refund, represented as an ISO 4217 currency code.
314
+ #
315
+ # @return [Symbol, Dodopayments::Models::Currency, nil]
316
+ optional :currency, enum: -> { Dodopayments::Currency }, nil?: true
317
+
318
+ # @!attribute reason
319
+ # The reason provided for the refund, if any. Optional.
320
+ #
321
+ # @return [String, nil]
322
+ optional :reason, String, nil?: true
323
+
324
+ # @!method initialize(business_id:, created_at:, is_partial:, payment_id:, refund_id:, status:, amount: nil, currency: nil, reason: nil)
325
+ # @param business_id [String] The unique identifier of the business issuing the refund.
326
+ #
327
+ # @param created_at [Time] The timestamp of when the refund was created in UTC.
328
+ #
329
+ # @param is_partial [Boolean] If true the refund is a partial refund
330
+ #
331
+ # @param payment_id [String] The unique identifier of the payment associated with the refund.
332
+ #
333
+ # @param refund_id [String] The unique identifier of the refund.
334
+ #
335
+ # @param status [Symbol, Dodopayments::Models::RefundStatus] The current status of the refund.
336
+ #
337
+ # @param amount [Integer, nil] The refunded amount.
338
+ #
339
+ # @param currency [Symbol, Dodopayments::Models::Currency, nil] The currency of the refund, represented as an ISO 4217 currency code.
340
+ #
341
+ # @param reason [String, nil] The reason provided for the refund, if any. Optional.
342
+ end
343
+
269
344
  class ProductCart < Dodopayments::Internal::Type::BaseModel
270
345
  # @!attribute product_id
271
346
  #
@@ -16,6 +16,12 @@ module Dodopayments
16
16
  # @return [Time]
17
17
  required :created_at, Time
18
18
 
19
+ # @!attribute customer
20
+ # Details about the customer for this refund (from the associated payment)
21
+ #
22
+ # @return [Dodopayments::Models::CustomerLimitedDetails]
23
+ required :customer, -> { Dodopayments::CustomerLimitedDetails }
24
+
19
25
  # @!attribute is_partial
20
26
  # If true the refund is a partial refund
21
27
  #
@@ -58,11 +64,13 @@ module Dodopayments
58
64
  # @return [String, nil]
59
65
  optional :reason, String, nil?: true
60
66
 
61
- # @!method initialize(business_id:, created_at:, is_partial:, payment_id:, refund_id:, status:, amount: nil, currency: nil, reason: nil)
67
+ # @!method initialize(business_id:, created_at:, customer:, is_partial:, payment_id:, refund_id:, status:, amount: nil, currency: nil, reason: nil)
62
68
  # @param business_id [String] The unique identifier of the business issuing the refund.
63
69
  #
64
70
  # @param created_at [Time] The timestamp of when the refund was created in UTC.
65
71
  #
72
+ # @param customer [Dodopayments::Models::CustomerLimitedDetails] Details about the customer for this refund (from the associated payment)
73
+ #
66
74
  # @param is_partial [Boolean] If true the refund is a partial refund
67
75
  #
68
76
  # @param payment_id [String] The unique identifier of the payment associated with the refund.
@@ -0,0 +1,81 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ # @see Dodopayments::Resources::Refunds#list
6
+ class RefundListResponse < Dodopayments::Internal::Type::BaseModel
7
+ # @!attribute business_id
8
+ # The unique identifier of the business issuing the refund.
9
+ #
10
+ # @return [String]
11
+ required :business_id, String
12
+
13
+ # @!attribute created_at
14
+ # The timestamp of when the refund was created in UTC.
15
+ #
16
+ # @return [Time]
17
+ required :created_at, Time
18
+
19
+ # @!attribute is_partial
20
+ # If true the refund is a partial refund
21
+ #
22
+ # @return [Boolean]
23
+ required :is_partial, Dodopayments::Internal::Type::Boolean
24
+
25
+ # @!attribute payment_id
26
+ # The unique identifier of the payment associated with the refund.
27
+ #
28
+ # @return [String]
29
+ required :payment_id, String
30
+
31
+ # @!attribute refund_id
32
+ # The unique identifier of the refund.
33
+ #
34
+ # @return [String]
35
+ required :refund_id, String
36
+
37
+ # @!attribute status
38
+ # The current status of the refund.
39
+ #
40
+ # @return [Symbol, Dodopayments::Models::RefundStatus]
41
+ required :status, enum: -> { Dodopayments::RefundStatus }
42
+
43
+ # @!attribute amount
44
+ # The refunded amount.
45
+ #
46
+ # @return [Integer, nil]
47
+ optional :amount, Integer, nil?: true
48
+
49
+ # @!attribute currency
50
+ # The currency of the refund, represented as an ISO 4217 currency code.
51
+ #
52
+ # @return [Symbol, Dodopayments::Models::Currency, nil]
53
+ optional :currency, enum: -> { Dodopayments::Currency }, nil?: true
54
+
55
+ # @!attribute reason
56
+ # The reason provided for the refund, if any. Optional.
57
+ #
58
+ # @return [String, nil]
59
+ optional :reason, String, nil?: true
60
+
61
+ # @!method initialize(business_id:, created_at:, is_partial:, payment_id:, refund_id:, status:, amount: nil, currency: nil, reason: nil)
62
+ # @param business_id [String] The unique identifier of the business issuing the refund.
63
+ #
64
+ # @param created_at [Time] The timestamp of when the refund was created in UTC.
65
+ #
66
+ # @param is_partial [Boolean] If true the refund is a partial refund
67
+ #
68
+ # @param payment_id [String] The unique identifier of the payment associated with the refund.
69
+ #
70
+ # @param refund_id [String] The unique identifier of the refund.
71
+ #
72
+ # @param status [Symbol, Dodopayments::Models::RefundStatus] The current status of the refund.
73
+ #
74
+ # @param amount [Integer, nil] The refunded amount.
75
+ #
76
+ # @param currency [Symbol, Dodopayments::Models::Currency, nil] The currency of the refund, represented as an ISO 4217 currency code.
77
+ #
78
+ # @param reason [String, nil] The reason provided for the refund, if any. Optional.
79
+ end
80
+ end
81
+ end