inttegro 8.1.0 → 9.1.0

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 (27) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +13 -0
  3. data/lib/inttegro/balance_transaction/allocation.rb +18 -0
  4. data/lib/inttegro/balance_transaction/allocation_base.rb +66 -0
  5. data/lib/inttegro/balance_transaction/allocation_base_type.rb +28 -0
  6. data/lib/inttegro/balance_transaction/allocation_status.rb +28 -0
  7. data/lib/inttegro/balance_transaction/available_amount.rb +34 -0
  8. data/lib/inttegro/balance_transaction/balance_transaction.rb +85 -31
  9. data/lib/inttegro/balance_transaction/payout_allocation.rb +74 -0
  10. data/lib/inttegro/balance_transaction/payout_allocation_payout.rb +35 -0
  11. data/lib/inttegro/balance_transaction/payout_allocation_type.rb +25 -0
  12. data/lib/inttegro/balance_transaction/pending_amount.rb +34 -0
  13. data/lib/inttegro/balance_transaction/questions.rb +2 -1
  14. data/lib/inttegro/balance_transaction/refund_allocation.rb +74 -0
  15. data/lib/inttegro/balance_transaction/refund_allocation_refund.rb +35 -0
  16. data/lib/inttegro/balance_transaction/refund_allocation_type.rb +25 -0
  17. data/lib/inttegro/balance_transaction/response.rb +2 -3
  18. data/lib/inttegro/balance_transaction/spent_amount.rb +34 -0
  19. data/lib/inttegro/balance_transaction/type.rb +4 -1
  20. data/lib/inttegro/customer/customer.rb +10 -0
  21. data/lib/inttegro/generated/enums.rb +4 -0
  22. data/lib/inttegro/generated/models.rb +10 -0
  23. data/lib/inttegro/payment/payment.rb +2 -3
  24. data/lib/inttegro/payout/balance_transaction.rb +42 -0
  25. data/lib/inttegro/payout/payout.rb +14 -3
  26. data/lib/inttegro/version.rb +1 -1
  27. metadata +16 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f8bc4f0b5a2c207f948dfa48b29deeccac6c66ee93dbcbc4dd0c9cea2f139fd7
4
- data.tar.gz: a4ea44719929147719cf297a3c59d0f33862c87650d50247afa752d0afe3b7b7
3
+ metadata.gz: 505bb0fb6560e58fc73e184b3bf9768d264d2788e0fd2cd1c782c73eb004e3eb
4
+ data.tar.gz: 843c5c156bde85253c0f94843f5de3731b864a3c37b5479130f6a1b7fe6541eb
5
5
  SHA512:
6
- metadata.gz: 36ceb907d2fce5b241b2773f4e77a4efaec24361bec49c27b1b853f1dd43a894db911394be30db76a756fd4ef3348f8dfbdb01000072cabddc95bdfa6542d4db
7
- data.tar.gz: 1d8e7b18fb1183c87f8dea4f62e5c3256d1413c7d8396cc9a7a699fea6f1a09b4a1cc30d3cf46806c4063bb1b954f56378643951164f9f442120f875d87e12e9
6
+ metadata.gz: 1a008265df9c387cd21da22d01c52a8c4bc7bfda2e3dbe5f7d703c7c593547f75daa5f98458a8b89cf99db99653d55f6d474780f979e31be5eef7114c0a87622
7
+ data.tar.gz: ca020602b0228107d07a475d380fa5d117f18def87ac131d97303b957f764d348bc85c286eadc3eaaff9228c9d31989e4969b2fc719bd5ddae0e02484ce2508f
data/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [9.1.0] - 2026-09-27
4
+
5
+ - Added the required application-scoped customer fingerprint to typed customer
6
+ responses for possible duplicate-record detection.
7
+
8
+ ## [9.0.0] - 2026-09-23
9
+
10
+ - Breaking: replaced payout `balance_transactions` ID strings with typed
11
+ contribution values containing the source transaction's original amount and
12
+ the exact amount allocated to the payout.
13
+ - Added complete payment balance-transaction allocation history together with
14
+ available, pending, and spent amount partitions.
15
+
3
16
  ## [8.1.0] - 2026-09-21
4
17
 
5
18
  - Added typed search across customers, financial accounts, orders, payouts, and
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+ # typed: strict
3
+
4
+ # Generated from openapi/commerce.yml by bin/generate-openapi-types. Do not edit.
5
+
6
+ require_relative "base"
7
+ require_relative "payout_allocation"
8
+ require_relative "refund_allocation"
9
+
10
+ module Inttegro
11
+ class BalanceTransaction
12
+ # A caller-safe allocation of part of a payment balance transaction to a refund or payout.
13
+ #
14
+ # @api public
15
+ # @return [Inttegro::BalanceTransaction::RefundAllocation, Inttegro::BalanceTransaction::PayoutAllocation]
16
+ Allocation = T.type_alias { T.any(Inttegro::BalanceTransaction::RefundAllocation, Inttegro::BalanceTransaction::PayoutAllocation) }
17
+ end
18
+ end
@@ -0,0 +1,66 @@
1
+ # frozen_string_literal: true
2
+ # typed: strict
3
+
4
+ # Generated from openapi/commerce.yml by bin/generate-openapi-types. Do not edit.
5
+
6
+ require_relative "base"
7
+ require_relative "allocation_base_type"
8
+ require_relative "allocation_status"
9
+
10
+ module Inttegro
11
+ class BalanceTransaction
12
+ # Typed representation of the allocation base object in the Inttegro API.
13
+ #
14
+ # This generated model is immutable. Construct it with `.new`, or decode a string-keyed API
15
+ # payload with `.from_hash`. `#serialize` produces a string-keyed hash using the original wire
16
+ # field names and serialized enum values.
17
+ #
18
+ # @api public
19
+ #
20
+ # @!attribute [r] completed_at
21
+ # When the allocated amount became permanently consumed. Present only when `status` is
22
+ # `completed`.
23
+ #
24
+ # Optional in the API payload; omitted values default to `nil`. Wire name: `completed_at`.
25
+ # @return [Time, nil]
26
+ #
27
+ # @!attribute [r] created_at
28
+ # When the amount first became unavailable for another refund or payout.
29
+ #
30
+ # Required in the API payload. Wire name: `created_at`.
31
+ # @return [Time]
32
+ #
33
+ # @!attribute [r] id
34
+ # Stable public allocation identifier for reconciliation and support.
35
+ #
36
+ # Required in the API payload. Wire name: `id`.
37
+ # @return [String]
38
+ #
39
+ # @!attribute [r] status
40
+ # Public effect of an allocation on the source payment balance transaction. Internal
41
+ # reservation and reconciliation states are not exposed.
42
+ #
43
+ # Required in the API payload. Wire name: `status`.
44
+ # @return [Inttegro::BalanceTransaction::AllocationStatus]
45
+ #
46
+ # @!attribute [r] type
47
+ # Value of the `type` field in the Inttegro API payload.
48
+ #
49
+ # Required in the API payload. Wire name: `type`.
50
+ # @return [Inttegro::BalanceTransaction::AllocationBaseType]
51
+ #
52
+ # @!attribute [r] updated_at
53
+ # When the public allocation status last changed.
54
+ #
55
+ # Required in the API payload. Wire name: `updated_at`.
56
+ # @return [Time]
57
+ class AllocationBase < T::Struct
58
+ const :completed_at, T.nilable(Time), default: nil
59
+ const :created_at, Time
60
+ const :id, String
61
+ const :status, Inttegro::BalanceTransaction::AllocationStatus
62
+ const :type, Inttegro::BalanceTransaction::AllocationBaseType
63
+ const :updated_at, Time
64
+ end
65
+ end
66
+ end
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+ # typed: strict
3
+
4
+ # Generated from openapi/commerce.yml by bin/generate-openapi-types. Do not edit.
5
+
6
+ require_relative "base"
7
+
8
+ module Inttegro
9
+ class BalanceTransaction
10
+ # String-backed values accepted by the Inttegro API for
11
+ # Inttegro::BalanceTransaction::AllocationBaseType.
12
+ #
13
+ # Use the constants below when constructing a request. `#serialize` returns the documented
14
+ # string wire value received from or sent to the API.
15
+ #
16
+ # @api public
17
+ class AllocationBaseType < T::Enum
18
+ enums do
19
+ # Serialized wire value: `payout`.
20
+ # @return [Inttegro::BalanceTransaction::AllocationBaseType]
21
+ PAYOUT = new("payout")
22
+ # Serialized wire value: `refund`.
23
+ # @return [Inttegro::BalanceTransaction::AllocationBaseType]
24
+ REFUND = new("refund")
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+ # typed: strict
3
+
4
+ # Generated from openapi/commerce.yml by bin/generate-openapi-types. Do not edit.
5
+
6
+ require_relative "base"
7
+
8
+ module Inttegro
9
+ class BalanceTransaction
10
+ # Public effect of an allocation on the source payment balance transaction. Internal
11
+ # reservation and reconciliation states are not exposed.
12
+ #
13
+ # Use the constants below when constructing a request. `#serialize` returns the documented
14
+ # string wire value received from or sent to the API.
15
+ #
16
+ # @api public
17
+ class AllocationStatus < T::Enum
18
+ enums do
19
+ # Serialized wire value: `pending`.
20
+ # @return [Inttegro::BalanceTransaction::AllocationStatus]
21
+ PENDING = new("pending")
22
+ # Serialized wire value: `completed`.
23
+ # @return [Inttegro::BalanceTransaction::AllocationStatus]
24
+ COMPLETED = new("completed")
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+ # typed: strict
3
+
4
+ # Generated from openapi/commerce.yml by bin/generate-openapi-types. Do not edit.
5
+
6
+ require_relative "base"
7
+
8
+ module Inttegro
9
+ class BalanceTransaction
10
+ # Amount still available for a refund or payout.
11
+ #
12
+ # This generated model is immutable. Construct it with `.new`, or decode a string-keyed API
13
+ # payload with `.from_hash`. `#serialize` produces a string-keyed hash using the original wire
14
+ # field names and serialized enum values.
15
+ #
16
+ # @api public
17
+ #
18
+ # @!attribute [r] currency
19
+ # Currency code as stored on the transaction
20
+ #
21
+ # Required in the API payload. Wire name: `currency`.
22
+ # @return [String]
23
+ #
24
+ # @!attribute [r] value
25
+ # Unsigned amount in the currency's smallest unit
26
+ #
27
+ # Required in the API payload. Wire name: `value`.
28
+ # @return [Integer]
29
+ class AvailableAmount < T::Struct
30
+ const :currency, String
31
+ const :value, Integer
32
+ end
33
+ end
34
+ end
@@ -4,14 +4,17 @@
4
4
  # Generated from openapi/commerce.yml by bin/generate-openapi-types. Do not edit.
5
5
 
6
6
  require_relative "base"
7
+ require_relative "allocation"
7
8
  require_relative "amount"
9
+ require_relative "available_amount"
8
10
  require_relative "payout_configuration"
11
+ require_relative "pending_amount"
12
+ require_relative "spent_amount"
9
13
  require_relative "type"
10
14
 
11
15
  module Inttegro
12
- # Merchant balance entry caused by a payment or refund. `type` describes the semantic source,
13
- # not direction. A payment transaction contains `payment_id`; a refund transaction contains
14
- # `refund_id`. Exactly one matching reference is present.
16
+ # Merchant balance entry caused by a payment, refund, or payout. `type` is the discriminator
17
+ # and describes the semantic source rather than the direction.
15
18
  #
16
19
  # This generated model is immutable. Construct it with `.new`, or decode a string-keyed API
17
20
  # payload with `.from_hash`. `#serialize` produces a string-keyed hash using the original wire
@@ -25,18 +28,6 @@ module Inttegro
25
28
  # Required in the API payload. Wire name: `amount`.
26
29
  # @return [Inttegro::BalanceTransaction::Amount]
27
30
  #
28
- # @!attribute [r] available_at
29
- # Value of the `available_at` field in the Inttegro API payload.
30
- #
31
- # Optional in the API payload; omitted values default to `nil`. Wire name: `available_at`.
32
- # @return [Time, nil]
33
- #
34
- # @!attribute [r] claimed_at
35
- # Value of the `claimed_at` field in the Inttegro API payload.
36
- #
37
- # Optional in the API payload; omitted values default to `nil`. Wire name: `claimed_at`.
38
- # @return [Time, nil]
39
- #
40
31
  # @!attribute [r] created_at
41
32
  # Value of the `created_at` field in the Inttegro API payload.
42
33
  #
@@ -49,26 +40,58 @@ module Inttegro
49
40
  # Required in the API payload. Wire name: `id`.
50
41
  # @return [String]
51
42
  #
43
+ # @!attribute [r] type
44
+ # Value of the `type` field in the Inttegro API payload.
45
+ #
46
+ # Required in the API payload. Wire name: `type`.
47
+ # @return [Inttegro::BalanceTransaction::Type]
48
+ #
49
+ # @!attribute [r] allocations
50
+ # All current pending and completed allocations. Released allocations are omitted.
51
+ #
52
+ # Optional in the API payload; omitted values default to `nil`. Wire name: `allocations`.
53
+ # @return [Array<Inttegro::BalanceTransaction::Allocation>, nil]
54
+ #
55
+ # @!attribute [r] available_amount
56
+ # Amount still available for a refund or payout.
57
+ #
58
+ # Optional in the API payload; omitted values default to `nil`. Wire name: `available_amount`.
59
+ # @return [Inttegro::BalanceTransaction::AvailableAmount, nil]
60
+ #
61
+ # @!attribute [r] available_at
62
+ # Value of the `available_at` field in the Inttegro API payload.
63
+ #
64
+ # Optional in the API payload; omitted values default to `nil`. Wire name: `available_at`.
65
+ # @return [Time, nil]
66
+ #
67
+ # @!attribute [r] claimed_at
68
+ # Legacy whole-transaction payout claim timestamp. New integrations should inspect
69
+ # `allocations`.
70
+ #
71
+ # Optional in the API payload; omitted values default to `nil`. Wire name: `claimed_at`.
72
+ # @return [Time, nil]
73
+ #
52
74
  # @!attribute [r] order_id
53
75
  # Value of the `order_id` field in the Inttegro API payload.
54
76
  #
55
- # Required in the API payload. Wire name: `order_id`.
56
- # @return [String]
77
+ # Optional in the API payload; omitted values default to `nil`. Wire name: `order_id`.
78
+ # @return [String, nil]
57
79
  #
58
80
  # @!attribute [r] paid_at
59
- # Value of the `paid_at` field in the Inttegro API payload.
81
+ # Legacy whole-transaction payout completion timestamp. New integrations should inspect
82
+ # `allocations`.
60
83
  #
61
84
  # Optional in the API payload; omitted values default to `nil`. Wire name: `paid_at`.
62
85
  # @return [Time, nil]
63
86
  #
64
87
  # @!attribute [r] payment_id
65
- # Present when `type` is `payment`; omitted when `type` is `refund`.
88
+ # Value of the `payment_id` field in the Inttegro API payload.
66
89
  #
67
90
  # Optional in the API payload; omitted values default to `nil`. Wire name: `payment_id`.
68
91
  # @return [String, nil]
69
92
  #
70
93
  # @!attribute [r] payout_id
71
- # Value of the `payout_id` field in the Inttegro API payload.
94
+ # Payout that created this finalized debit.
72
95
  #
73
96
  # Optional in the API payload; omitted values default to `nil`. Wire name: `payout_id`.
74
97
  # @return [String, nil]
@@ -79,29 +102,60 @@ module Inttegro
79
102
  # Optional in the API payload; omitted values default to `nil`. Wire name: `payout_configuration`.
80
103
  # @return [Inttegro::BalanceTransaction::PayoutConfiguration, nil]
81
104
  #
105
+ # @!attribute [r] pending_amount
106
+ # Amount temporarily unavailable because a refund or payout is unresolved.
107
+ #
108
+ # Optional in the API payload; omitted values default to `nil`. Wire name: `pending_amount`.
109
+ # @return [Inttegro::BalanceTransaction::PendingAmount, nil]
110
+ #
111
+ # @!attribute [r] spent_amount
112
+ # Amount permanently consumed by completed refund and payout allocations.
113
+ #
114
+ # Optional in the API payload; omitted values default to `nil`. Wire name: `spent_amount`.
115
+ # @return [Inttegro::BalanceTransaction::SpentAmount, nil]
116
+ #
82
117
  # @!attribute [r] refund_id
83
- # Present when `type` is `refund`; omitted when `type` is `payment`.
118
+ # Value of the `refund_id` field in the Inttegro API payload.
84
119
  #
85
120
  # Optional in the API payload; omitted values default to `nil`. Wire name: `refund_id`.
86
121
  # @return [String, nil]
87
- #
88
- # @!attribute [r] type
89
- # Semantic source or cause of the transaction, not its direction.
90
- #
91
- # Required in the API payload. Wire name: `type`.
92
- # @return [Inttegro::BalanceTransaction::Type]
93
122
  class BalanceTransaction
94
123
  const :amount, Inttegro::BalanceTransaction::Amount
95
- const :available_at, T.nilable(Time), default: nil
96
- const :claimed_at, T.nilable(Time), default: nil
97
124
  const :created_at, Time
98
125
  const :id, String
99
- const :order_id, String
126
+ const :type, Inttegro::BalanceTransaction::Type
127
+ const :allocations, T.nilable(T::Array[Inttegro::BalanceTransaction::Allocation]), default: nil
128
+ const :available_amount, T.nilable(Inttegro::BalanceTransaction::AvailableAmount), default: nil
129
+ const :available_at, T.nilable(Time), default: nil
130
+ const :claimed_at, T.nilable(Time), default: nil
131
+ const :order_id, T.nilable(String), default: nil
100
132
  const :paid_at, T.nilable(Time), default: nil
101
133
  const :payment_id, T.nilable(String), default: nil
102
134
  const :payout_id, T.nilable(String), default: nil
103
135
  const :payout_configuration, T.nilable(Inttegro::BalanceTransaction::PayoutConfiguration), default: nil
136
+ const :pending_amount, T.nilable(Inttegro::BalanceTransaction::PendingAmount), default: nil
137
+ const :spent_amount, T.nilable(Inttegro::BalanceTransaction::SpentAmount), default: nil
104
138
  const :refund_id, T.nilable(String), default: nil
105
- const :type, Inttegro::BalanceTransaction::Type
139
+
140
+ extend T::Sig
141
+
142
+ sig { params(hash: T::Hash[String, Object], strict: T::Boolean).returns(T.attached_class) }
143
+ def self.from_hash(hash, strict = false)
144
+ data = hash.dup
145
+ if (allocations_value = data["allocations"]).is_a?(Array)
146
+ data["allocations"] = allocations_value.map do |item|
147
+ next item unless item.is_a?(Hash)
148
+ case item["type"]
149
+ when "payout"
150
+ Inttegro::BalanceTransaction::PayoutAllocation.from_hash(item)
151
+ when "refund"
152
+ Inttegro::BalanceTransaction::RefundAllocation.from_hash(item)
153
+ else
154
+ item
155
+ end
156
+ end
157
+ end
158
+ super(data, strict)
159
+ end
106
160
  end
107
161
  end
@@ -0,0 +1,74 @@
1
+ # frozen_string_literal: true
2
+ # typed: strict
3
+
4
+ # Generated from openapi/commerce.yml by bin/generate-openapi-types. Do not edit.
5
+
6
+ require_relative "base"
7
+ require_relative "allocation_status"
8
+ require_relative "payout_allocation_payout"
9
+ require_relative "payout_allocation_type"
10
+
11
+ module Inttegro
12
+ class BalanceTransaction
13
+ # Typed representation of the payout allocation object in the Inttegro API.
14
+ #
15
+ # This generated model is immutable. Construct it with `.new`, or decode a string-keyed API
16
+ # payload with `.from_hash`. `#serialize` produces a string-keyed hash using the original wire
17
+ # field names and serialized enum values.
18
+ #
19
+ # @api public
20
+ #
21
+ # @!attribute [r] completed_at
22
+ # When the allocated amount became permanently consumed. Present only when `status` is
23
+ # `completed`.
24
+ #
25
+ # Optional in the API payload; omitted values default to `nil`. Wire name: `completed_at`.
26
+ # @return [Time, nil]
27
+ #
28
+ # @!attribute [r] created_at
29
+ # When the amount first became unavailable for another refund or payout.
30
+ #
31
+ # Required in the API payload. Wire name: `created_at`.
32
+ # @return [Time]
33
+ #
34
+ # @!attribute [r] id
35
+ # Stable public allocation identifier for reconciliation and support.
36
+ #
37
+ # Required in the API payload. Wire name: `id`.
38
+ # @return [String]
39
+ #
40
+ # @!attribute [r] status
41
+ # Public effect of an allocation on the source payment balance transaction. Internal
42
+ # reservation and reconciliation states are not exposed.
43
+ #
44
+ # Required in the API payload. Wire name: `status`.
45
+ # @return [Inttegro::BalanceTransaction::AllocationStatus]
46
+ #
47
+ # @!attribute [r] type
48
+ # Value of the `type` field in the Inttegro API payload.
49
+ #
50
+ # Required in the API payload. Wire name: `type`.
51
+ # @return [Inttegro::BalanceTransaction::PayoutAllocationType]
52
+ #
53
+ # @!attribute [r] updated_at
54
+ # When the public allocation status last changed.
55
+ #
56
+ # Required in the API payload. Wire name: `updated_at`.
57
+ # @return [Time]
58
+ #
59
+ # @!attribute [r] payout
60
+ # Value of the `payout` field in the Inttegro API payload.
61
+ #
62
+ # Required in the API payload. Wire name: `payout`.
63
+ # @return [Inttegro::BalanceTransaction::PayoutAllocationPayout]
64
+ class PayoutAllocation < T::Struct
65
+ const :completed_at, T.nilable(Time), default: nil
66
+ const :created_at, Time
67
+ const :id, String
68
+ const :status, Inttegro::BalanceTransaction::AllocationStatus
69
+ const :type, Inttegro::BalanceTransaction::PayoutAllocationType
70
+ const :updated_at, Time
71
+ const :payout, Inttegro::BalanceTransaction::PayoutAllocationPayout
72
+ end
73
+ end
74
+ end
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+ # typed: strict
3
+
4
+ # Generated from openapi/commerce.yml by bin/generate-openapi-types. Do not edit.
5
+
6
+ require_relative "base"
7
+ require_relative "amount"
8
+
9
+ module Inttegro
10
+ class BalanceTransaction
11
+ # Typed representation of the payout allocation payout object in the Inttegro API.
12
+ #
13
+ # This generated model is immutable. Construct it with `.new`, or decode a string-keyed API
14
+ # payload with `.from_hash`. `#serialize` produces a string-keyed hash using the original wire
15
+ # field names and serialized enum values.
16
+ #
17
+ # @api public
18
+ #
19
+ # @!attribute [r] amount
20
+ # Value of the `amount` field in the Inttegro API payload.
21
+ #
22
+ # Required in the API payload. Wire name: `amount`.
23
+ # @return [Inttegro::BalanceTransaction::Amount]
24
+ #
25
+ # @!attribute [r] id
26
+ # Value of the `id` field in the Inttegro API payload.
27
+ #
28
+ # Required in the API payload. Wire name: `id`.
29
+ # @return [String]
30
+ class PayoutAllocationPayout < T::Struct
31
+ const :amount, Inttegro::BalanceTransaction::Amount
32
+ const :id, String
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+ # typed: strict
3
+
4
+ # Generated from openapi/commerce.yml by bin/generate-openapi-types. Do not edit.
5
+
6
+ require_relative "base"
7
+
8
+ module Inttegro
9
+ class BalanceTransaction
10
+ # String-backed values accepted by the Inttegro API for
11
+ # Inttegro::BalanceTransaction::PayoutAllocationType.
12
+ #
13
+ # Use the constants below when constructing a request. `#serialize` returns the documented
14
+ # string wire value received from or sent to the API.
15
+ #
16
+ # @api public
17
+ class PayoutAllocationType < T::Enum
18
+ enums do
19
+ # Serialized wire value: `payout`.
20
+ # @return [Inttegro::BalanceTransaction::PayoutAllocationType]
21
+ PAYOUT = new("payout")
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+ # typed: strict
3
+
4
+ # Generated from openapi/commerce.yml by bin/generate-openapi-types. Do not edit.
5
+
6
+ require_relative "base"
7
+
8
+ module Inttegro
9
+ class BalanceTransaction
10
+ # Amount temporarily unavailable because a refund or payout is unresolved.
11
+ #
12
+ # This generated model is immutable. Construct it with `.new`, or decode a string-keyed API
13
+ # payload with `.from_hash`. `#serialize` produces a string-keyed hash using the original wire
14
+ # field names and serialized enum values.
15
+ #
16
+ # @api public
17
+ #
18
+ # @!attribute [r] currency
19
+ # Currency code as stored on the transaction
20
+ #
21
+ # Required in the API payload. Wire name: `currency`.
22
+ # @return [String]
23
+ #
24
+ # @!attribute [r] value
25
+ # Unsigned amount in the currency's smallest unit
26
+ #
27
+ # Required in the API payload. Wire name: `value`.
28
+ # @return [Integer]
29
+ class PendingAmount < T::Struct
30
+ const :currency, String
31
+ const :value, Integer
32
+ end
33
+ end
34
+ end
@@ -42,7 +42,8 @@ module Inttegro
42
42
  #
43
43
  # @return [Boolean] whether the transaction satisfies the local identity checks
44
44
  def valid?
45
- !id.empty? && !order_id.empty? && valid_source?
45
+ order = order_id
46
+ !id.empty? && !order.nil? && !order.empty? && valid_source?
46
47
  end
47
48
  end
48
49
  end
@@ -0,0 +1,74 @@
1
+ # frozen_string_literal: true
2
+ # typed: strict
3
+
4
+ # Generated from openapi/commerce.yml by bin/generate-openapi-types. Do not edit.
5
+
6
+ require_relative "base"
7
+ require_relative "allocation_status"
8
+ require_relative "refund_allocation_refund"
9
+ require_relative "refund_allocation_type"
10
+
11
+ module Inttegro
12
+ class BalanceTransaction
13
+ # Typed representation of the refund allocation object in the Inttegro API.
14
+ #
15
+ # This generated model is immutable. Construct it with `.new`, or decode a string-keyed API
16
+ # payload with `.from_hash`. `#serialize` produces a string-keyed hash using the original wire
17
+ # field names and serialized enum values.
18
+ #
19
+ # @api public
20
+ #
21
+ # @!attribute [r] completed_at
22
+ # When the allocated amount became permanently consumed. Present only when `status` is
23
+ # `completed`.
24
+ #
25
+ # Optional in the API payload; omitted values default to `nil`. Wire name: `completed_at`.
26
+ # @return [Time, nil]
27
+ #
28
+ # @!attribute [r] created_at
29
+ # When the amount first became unavailable for another refund or payout.
30
+ #
31
+ # Required in the API payload. Wire name: `created_at`.
32
+ # @return [Time]
33
+ #
34
+ # @!attribute [r] id
35
+ # Stable public allocation identifier for reconciliation and support.
36
+ #
37
+ # Required in the API payload. Wire name: `id`.
38
+ # @return [String]
39
+ #
40
+ # @!attribute [r] status
41
+ # Public effect of an allocation on the source payment balance transaction. Internal
42
+ # reservation and reconciliation states are not exposed.
43
+ #
44
+ # Required in the API payload. Wire name: `status`.
45
+ # @return [Inttegro::BalanceTransaction::AllocationStatus]
46
+ #
47
+ # @!attribute [r] type
48
+ # Value of the `type` field in the Inttegro API payload.
49
+ #
50
+ # Required in the API payload. Wire name: `type`.
51
+ # @return [Inttegro::BalanceTransaction::RefundAllocationType]
52
+ #
53
+ # @!attribute [r] updated_at
54
+ # When the public allocation status last changed.
55
+ #
56
+ # Required in the API payload. Wire name: `updated_at`.
57
+ # @return [Time]
58
+ #
59
+ # @!attribute [r] refund
60
+ # Value of the `refund` field in the Inttegro API payload.
61
+ #
62
+ # Required in the API payload. Wire name: `refund`.
63
+ # @return [Inttegro::BalanceTransaction::RefundAllocationRefund]
64
+ class RefundAllocation < T::Struct
65
+ const :completed_at, T.nilable(Time), default: nil
66
+ const :created_at, Time
67
+ const :id, String
68
+ const :status, Inttegro::BalanceTransaction::AllocationStatus
69
+ const :type, Inttegro::BalanceTransaction::RefundAllocationType
70
+ const :updated_at, Time
71
+ const :refund, Inttegro::BalanceTransaction::RefundAllocationRefund
72
+ end
73
+ end
74
+ end
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+ # typed: strict
3
+
4
+ # Generated from openapi/commerce.yml by bin/generate-openapi-types. Do not edit.
5
+
6
+ require_relative "base"
7
+ require_relative "amount"
8
+
9
+ module Inttegro
10
+ class BalanceTransaction
11
+ # Typed representation of the refund allocation refund object in the Inttegro API.
12
+ #
13
+ # This generated model is immutable. Construct it with `.new`, or decode a string-keyed API
14
+ # payload with `.from_hash`. `#serialize` produces a string-keyed hash using the original wire
15
+ # field names and serialized enum values.
16
+ #
17
+ # @api public
18
+ #
19
+ # @!attribute [r] amount
20
+ # Value of the `amount` field in the Inttegro API payload.
21
+ #
22
+ # Required in the API payload. Wire name: `amount`.
23
+ # @return [Inttegro::BalanceTransaction::Amount]
24
+ #
25
+ # @!attribute [r] id
26
+ # Value of the `id` field in the Inttegro API payload.
27
+ #
28
+ # Required in the API payload. Wire name: `id`.
29
+ # @return [String]
30
+ class RefundAllocationRefund < T::Struct
31
+ const :amount, Inttegro::BalanceTransaction::Amount
32
+ const :id, String
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+ # typed: strict
3
+
4
+ # Generated from openapi/commerce.yml by bin/generate-openapi-types. Do not edit.
5
+
6
+ require_relative "base"
7
+
8
+ module Inttegro
9
+ class BalanceTransaction
10
+ # String-backed values accepted by the Inttegro API for
11
+ # Inttegro::BalanceTransaction::RefundAllocationType.
12
+ #
13
+ # Use the constants below when constructing a request. `#serialize` returns the documented
14
+ # string wire value received from or sent to the API.
15
+ #
16
+ # @api public
17
+ class RefundAllocationType < T::Enum
18
+ enums do
19
+ # Serialized wire value: `refund`.
20
+ # @return [Inttegro::BalanceTransaction::RefundAllocationType]
21
+ REFUND = new("refund")
22
+ end
23
+ end
24
+ end
25
+ end
@@ -17,9 +17,8 @@ module Inttegro
17
17
  # @api public
18
18
  #
19
19
  # @!attribute [r] transaction
20
- # Merchant balance entry caused by a payment or refund. `type` describes the semantic source,
21
- # not direction. A payment transaction contains `payment_id`; a refund transaction contains
22
- # `refund_id`. Exactly one matching reference is present.
20
+ # Merchant balance entry caused by a payment, refund, or payout. `type` is the discriminator
21
+ # and describes the semantic source rather than the direction.
23
22
  #
24
23
  # Required in the API payload. Wire name: `transaction`.
25
24
  # @return [Inttegro::BalanceTransaction]
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+ # typed: strict
3
+
4
+ # Generated from openapi/commerce.yml by bin/generate-openapi-types. Do not edit.
5
+
6
+ require_relative "base"
7
+
8
+ module Inttegro
9
+ class BalanceTransaction
10
+ # Amount permanently consumed by completed refund and payout allocations.
11
+ #
12
+ # This generated model is immutable. Construct it with `.new`, or decode a string-keyed API
13
+ # payload with `.from_hash`. `#serialize` produces a string-keyed hash using the original wire
14
+ # field names and serialized enum values.
15
+ #
16
+ # @api public
17
+ #
18
+ # @!attribute [r] currency
19
+ # Currency code as stored on the transaction
20
+ #
21
+ # Required in the API payload. Wire name: `currency`.
22
+ # @return [String]
23
+ #
24
+ # @!attribute [r] value
25
+ # Unsigned amount in the currency's smallest unit
26
+ #
27
+ # Required in the API payload. Wire name: `value`.
28
+ # @return [Integer]
29
+ class SpentAmount < T::Struct
30
+ const :currency, String
31
+ const :value, Integer
32
+ end
33
+ end
34
+ end
@@ -7,7 +7,7 @@ require_relative "base"
7
7
 
8
8
  module Inttegro
9
9
  class BalanceTransaction
10
- # Semantic source or cause of the transaction, not its direction.
10
+ # String-backed values accepted by the Inttegro API for Inttegro::BalanceTransaction::Type.
11
11
  #
12
12
  # Use the constants below when constructing a request. `#serialize` returns the documented
13
13
  # string wire value received from or sent to the API.
@@ -21,6 +21,9 @@ module Inttegro
21
21
  # Serialized wire value: `refund`.
22
22
  # @return [Inttegro::BalanceTransaction::Type]
23
23
  REFUND = new("refund")
24
+ # Serialized wire value: `payout`.
25
+ # @return [Inttegro::BalanceTransaction::Type]
26
+ PAYOUT = new("payout")
24
27
  end
25
28
  end
26
29
  end
@@ -48,6 +48,15 @@ module Inttegro
48
48
  # Optional in the API payload; omitted values default to `nil`. Wire name: `email_address`.
49
49
  # @return [String, nil]
50
50
  #
51
+ # @!attribute [r] fingerprint
52
+ # Application-scoped value for spotting possible duplicate customer records. Matching nonempty
53
+ # fingerprints within the same application indicate that the records likely belong to the same
54
+ # buyer. Compare fingerprints only within that application, and continue to use each customer
55
+ # ID for API operations.
56
+ #
57
+ # Required in the API payload. Wire name: `fingerprint`.
58
+ # @return [String]
59
+ #
51
60
  # @!attribute [r] guest
52
61
  # Value of the `guest` field in the Inttegro API payload.
53
62
  #
@@ -107,6 +116,7 @@ module Inttegro
107
116
  const :created_at, Time
108
117
  const :custom_data, T.nilable(Inttegro::CustomData), default: nil
109
118
  const :email_address, T.nilable(String), default: nil
119
+ const :fingerprint, String
110
120
  const :guest, T::Boolean
111
121
  const :id, String
112
122
  const :name, String
@@ -7,6 +7,10 @@ require_relative "../app/credential_owner"
7
7
  require_relative "../app/management_role"
8
8
  require_relative "../app/relationship_kind"
9
9
  require_relative "../app/relationship_status"
10
+ require_relative "../balance_transaction/allocation_base_type"
11
+ require_relative "../balance_transaction/allocation_status"
12
+ require_relative "../balance_transaction/payout_allocation_type"
13
+ require_relative "../balance_transaction/refund_allocation_type"
10
14
  require_relative "../balance_transaction/type"
11
15
  require_relative "../bank_account/type"
12
16
  require_relative "../checkout/invoice_view_status"
@@ -48,9 +48,18 @@ require_relative "../balance/currency_snapshot"
48
48
  require_relative "../balance/snapshot"
49
49
  require_relative "../balance/snapshot_response"
50
50
  require_relative "../balance_transaction/amount"
51
+ require_relative "../balance_transaction/refund_allocation_refund"
52
+ require_relative "../balance_transaction/refund_allocation"
53
+ require_relative "../balance_transaction/payout_allocation_payout"
54
+ require_relative "../balance_transaction/payout_allocation"
55
+ require_relative "../balance_transaction/allocation"
56
+ require_relative "../balance_transaction/available_amount"
51
57
  require_relative "../balance_transaction/payout_configuration_destination"
52
58
  require_relative "../balance_transaction/payout_configuration"
59
+ require_relative "../balance_transaction/pending_amount"
60
+ require_relative "../balance_transaction/spent_amount"
53
61
  require_relative "../balance_transaction/balance_transaction"
62
+ require_relative "../balance_transaction/allocation_base"
54
63
  require_relative "../balance_transaction/page"
55
64
  require_relative "../balance_transaction/page_response"
56
65
  require_relative "../balance_transaction/response"
@@ -469,6 +478,7 @@ require_relative "../payment_method/page_request"
469
478
  require_relative "../payment_method/page_response"
470
479
  require_relative "../payment_method/tokenize_base"
471
480
  require_relative "../payment/result"
481
+ require_relative "../payout/balance_transaction"
472
482
  require_relative "../payout/error"
473
483
  require_relative "../payout/payout"
474
484
  require_relative "../payout/page"
@@ -49,9 +49,8 @@ module Inttegro
49
49
  # @return [Inttegro::Money::Amount]
50
50
  #
51
51
  # @!attribute [r] balance_transaction
52
- # Merchant balance entry caused by a payment or refund. `type` describes the semantic source,
53
- # not direction. A payment transaction contains `payment_id`; a refund transaction contains
54
- # `refund_id`. Exactly one matching reference is present.
52
+ # Merchant balance entry caused by a payment, refund, or payout. `type` is the discriminator
53
+ # and describes the semantic source rather than the direction.
55
54
  #
56
55
  # Optional in the API payload; omitted values default to `nil`. Wire name: `balance_transaction`.
57
56
  # @return [Inttegro::BalanceTransaction, nil]
@@ -0,0 +1,42 @@
1
+ # frozen_string_literal: true
2
+ # typed: strict
3
+
4
+ # Generated from openapi/commerce.yml by bin/generate-openapi-types. Do not edit.
5
+
6
+ require_relative "base"
7
+ require_relative "../money/amount"
8
+
9
+ module Inttegro
10
+ class Payout
11
+ # A sparse view of one balance transaction's contribution to a payout.
12
+ #
13
+ # This generated model is immutable. Construct it with `.new`, or decode a string-keyed API
14
+ # payload with `.from_hash`. `#serialize` produces a string-keyed hash using the original wire
15
+ # field names and serialized enum values.
16
+ #
17
+ # @api public
18
+ #
19
+ # @!attribute [r] allocated_amount
20
+ # Value of the `allocated_amount` field in the Inttegro API payload.
21
+ #
22
+ # Required in the API payload. Wire name: `allocated_amount`.
23
+ # @return [Inttegro::Money::Amount]
24
+ #
25
+ # @!attribute [r] amount
26
+ # Value of the `amount` field in the Inttegro API payload.
27
+ #
28
+ # Required in the API payload. Wire name: `amount`.
29
+ # @return [Inttegro::Money::Amount]
30
+ #
31
+ # @!attribute [r] id
32
+ # Unique balance transaction identifier.
33
+ #
34
+ # Required in the API payload. Wire name: `id`.
35
+ # @return [String]
36
+ class BalanceTransaction < T::Struct
37
+ const :allocated_amount, Inttegro::Money::Amount
38
+ const :amount, Inttegro::Money::Amount
39
+ const :id, String
40
+ end
41
+ end
42
+ end
@@ -6,6 +6,7 @@
6
6
  require_relative "base"
7
7
  require_relative "../custom_data"
8
8
  require_relative "../money/amount"
9
+ require_relative "balance_transaction"
9
10
  require_relative "error"
10
11
  require_relative "status"
11
12
 
@@ -25,10 +26,19 @@ module Inttegro
25
26
  # @return [Inttegro::Money::Amount, nil]
26
27
  #
27
28
  # @!attribute [r] balance_transactions
28
- # Balance transaction IDs linked to this payout
29
+ # Balance transactions that contributed to this payout. Each item includes the source
30
+ # transaction's original amount and the exact portion allocated to this payout. The difference
31
+ # between those two amounts is not necessarily still available because refunds or other
32
+ # payouts may also consume the source.
29
33
  #
30
34
  # Optional in the API payload; omitted values default to `nil`. Wire name: `balance_transactions`.
31
- # @return [Array<String>, nil]
35
+ # @return [Array<Inttegro::Payout::BalanceTransaction>, nil]
36
+ #
37
+ # @!attribute [r] balance_transaction_id
38
+ # Immutable debit balance transaction created when this payout succeeds.
39
+ #
40
+ # Optional in the API payload; omitted values default to `nil`. Wire name: `balance_transaction_id`.
41
+ # @return [String, nil]
32
42
  #
33
43
  # @!attribute [r] canceled_at
34
44
  # When the payout was canceled
@@ -152,7 +162,8 @@ module Inttegro
152
162
  # @return [Time, nil]
153
163
  class Payout
154
164
  const :amount, T.nilable(Inttegro::Money::Amount), default: nil
155
- const :balance_transactions, T.nilable(T::Array[String]), default: nil
165
+ const :balance_transactions, T.nilable(T::Array[Inttegro::Payout::BalanceTransaction]), default: nil
166
+ const :balance_transaction_id, T.nilable(String), default: nil
156
167
  const :canceled_at, T.nilable(Time), default: nil
157
168
  const :custom_data, T.nilable(Inttegro::CustomData), default: nil
158
169
  const :destination_id, String
@@ -2,5 +2,5 @@
2
2
  # typed: strict
3
3
 
4
4
  module Inttegro
5
- VERSION = "8.1.0"
5
+ VERSION = "9.1.0"
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inttegro
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.1.0
4
+ version: 9.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Inttegro Engineering
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-09-21 00:00:00.000000000 Z
11
+ date: 2026-09-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sorbet-runtime
@@ -106,17 +106,30 @@ files:
106
106
  - lib/inttegro/balance/snapshot.rb
107
107
  - lib/inttegro/balance/snapshot_response.rb
108
108
  - lib/inttegro/balance/value.rb
109
+ - lib/inttegro/balance_transaction/allocation.rb
110
+ - lib/inttegro/balance_transaction/allocation_base.rb
111
+ - lib/inttegro/balance_transaction/allocation_base_type.rb
112
+ - lib/inttegro/balance_transaction/allocation_status.rb
109
113
  - lib/inttegro/balance_transaction/amount.rb
114
+ - lib/inttegro/balance_transaction/available_amount.rb
110
115
  - lib/inttegro/balance_transaction/balance_transaction.rb
111
116
  - lib/inttegro/balance_transaction/base.rb
112
117
  - lib/inttegro/balance_transaction/lookup_request.rb
113
118
  - lib/inttegro/balance_transaction/page.rb
114
119
  - lib/inttegro/balance_transaction/page_request.rb
115
120
  - lib/inttegro/balance_transaction/page_response.rb
121
+ - lib/inttegro/balance_transaction/payout_allocation.rb
122
+ - lib/inttegro/balance_transaction/payout_allocation_payout.rb
123
+ - lib/inttegro/balance_transaction/payout_allocation_type.rb
116
124
  - lib/inttegro/balance_transaction/payout_configuration.rb
117
125
  - lib/inttegro/balance_transaction/payout_configuration_destination.rb
126
+ - lib/inttegro/balance_transaction/pending_amount.rb
118
127
  - lib/inttegro/balance_transaction/questions.rb
128
+ - lib/inttegro/balance_transaction/refund_allocation.rb
129
+ - lib/inttegro/balance_transaction/refund_allocation_refund.rb
130
+ - lib/inttegro/balance_transaction/refund_allocation_type.rb
119
131
  - lib/inttegro/balance_transaction/response.rb
132
+ - lib/inttegro/balance_transaction/spent_amount.rb
120
133
  - lib/inttegro/balance_transaction/type.rb
121
134
  - lib/inttegro/bank_account/base.rb
122
135
  - lib/inttegro/bank_account/created.rb
@@ -533,6 +546,7 @@ files:
533
546
  - lib/inttegro/payment_method/update_request_owner_address.rb
534
547
  - lib/inttegro/payment_method/update_response.rb
535
548
  - lib/inttegro/payment_method/verification.rb
549
+ - lib/inttegro/payout/balance_transaction.rb
536
550
  - lib/inttegro/payout/base.rb
537
551
  - lib/inttegro/payout/cancel_request.rb
538
552
  - lib/inttegro/payout/destinations.rb