inttegro 8.0.0 → 9.0.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 (90) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +15 -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 +66 -4
  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 +35 -0
  13. data/lib/inttegro/balance_transaction/refund_allocation.rb +74 -0
  14. data/lib/inttegro/balance_transaction/refund_allocation_refund.rb +35 -0
  15. data/lib/inttegro/balance_transaction/refund_allocation_type.rb +25 -0
  16. data/lib/inttegro/balance_transaction/response.rb +4 -1
  17. data/lib/inttegro/balance_transaction/spent_amount.rb +35 -0
  18. data/lib/inttegro/checkout/invoice_view.rb +8 -0
  19. data/lib/inttegro/checkout/order_line_item_group.rb +23 -0
  20. data/lib/inttegro/chime/send_request.rb +9 -0
  21. data/lib/inttegro/chime/send_request_cooldown.rb +35 -0
  22. data/lib/inttegro/chime/transport.rb +2 -1
  23. data/lib/inttegro/generated/enums.rb +16 -1
  24. data/lib/inttegro/generated/models.rb +36 -0
  25. data/lib/inttegro/generated/operations.rb +18 -3
  26. data/lib/inttegro/http_client.rb +1 -1
  27. data/lib/inttegro/order/create_existing_customer.rb +23 -0
  28. data/lib/inttegro/order/create_new_customer.rb +23 -0
  29. data/lib/inttegro/order/document_delivery_attempt.rb +7 -0
  30. data/lib/inttegro/order/document_delivery_channel_summary.rb +34 -0
  31. data/lib/inttegro/order/document_delivery_summary.rb +43 -0
  32. data/lib/inttegro/order/document_delivery_summary_channels.rb +36 -0
  33. data/lib/inttegro/order/invoice.rb +8 -0
  34. data/lib/inttegro/order/invoice_format.rb +3 -2
  35. data/lib/inttegro/order/line_item_group.rb +25 -0
  36. data/lib/inttegro/order/receipt_document_format.rb +35 -0
  37. data/lib/inttegro/order/update_request.rb +23 -0
  38. data/lib/inttegro/otp/initiate_request.rb +35 -8
  39. data/lib/inttegro/otp/purpose.rb +62 -0
  40. data/lib/inttegro/otp/transmission.rb +4 -4
  41. data/lib/inttegro/otp/transmission_status.rb +9 -0
  42. data/lib/inttegro/otp/verify_request.rb +2 -1
  43. data/lib/inttegro/payment/payment.rb +4 -1
  44. data/lib/inttegro/payout/balance_transaction.rb +42 -0
  45. data/lib/inttegro/payout/payout.rb +7 -3
  46. data/lib/inttegro/refund/line_item.rb +31 -1
  47. data/lib/inttegro/refund/order_fee_line_item.rb +43 -0
  48. data/lib/inttegro/refund/order_fee_line_item_fee.rb +34 -0
  49. data/lib/inttegro/{otp/transmission_sent_via.rb → refund/order_fee_line_item_type.rb} +7 -6
  50. data/lib/inttegro/refund/order_line_item.rb +20 -0
  51. data/lib/inttegro/refund/order_product_line_item.rb +50 -0
  52. data/lib/inttegro/refund/order_product_line_item_product.rb +34 -0
  53. data/lib/inttegro/refund/order_product_line_item_type.rb +25 -0
  54. data/lib/inttegro/refund/order_shipping_line_item.rb +43 -0
  55. data/lib/inttegro/refund/order_shipping_line_item_shipping.rb +34 -0
  56. data/lib/inttegro/refund/order_shipping_line_item_type.rb +25 -0
  57. data/lib/inttegro/refund/payment_method_settlement.rb +18 -0
  58. data/lib/inttegro/refund/refund.rb +18 -0
  59. data/lib/inttegro/resources/customers.rb +8 -0
  60. data/lib/inttegro/resources/financial_accounts.rb +12 -0
  61. data/lib/inttegro/resources/orders.rb +8 -0
  62. data/lib/inttegro/resources/payouts.rb +8 -0
  63. data/lib/inttegro/resources/products.rb +8 -0
  64. data/lib/inttegro/search/base.rb +17 -0
  65. data/lib/inttegro/search/facet.rb +34 -0
  66. data/lib/inttegro/search/facet_bucket.rb +34 -0
  67. data/lib/inttegro/search/facet_result.rb +35 -0
  68. data/lib/inttegro/search/filter.rb +42 -0
  69. data/lib/inttegro/search/filter_operator.rb +27 -0
  70. data/lib/inttegro/search/freshness.rb +43 -0
  71. data/lib/inttegro/search/freshness_state.rb +36 -0
  72. data/lib/inttegro/search/page.rb +104 -0
  73. data/lib/inttegro/search/request.rb +68 -0
  74. data/lib/inttegro/search/resource_freshness.rb +50 -0
  75. data/lib/inttegro/search/resource_freshness_state.rb +37 -0
  76. data/lib/inttegro/search/resource_reference.rb +35 -0
  77. data/lib/inttegro/search/resource_total.rb +43 -0
  78. data/lib/inttegro/search/resource_total_relation.rb +28 -0
  79. data/lib/inttegro/search/response.rb +28 -0
  80. data/lib/inttegro/search/result.rb +78 -0
  81. data/lib/inttegro/search/sort.rb +36 -0
  82. data/lib/inttegro/search/sort_direction.rb +27 -0
  83. data/lib/inttegro/search/sort_field.rb +30 -0
  84. data/lib/inttegro/search/total.rb +35 -0
  85. data/lib/inttegro/search/total_relation.rb +27 -0
  86. data/lib/inttegro/search/type.rb +36 -0
  87. data/lib/inttegro/telemetry.rb +1 -1
  88. data/lib/inttegro/version.rb +1 -1
  89. data/rbi/inttegro/generated.rbi +15 -0
  90. metadata +55 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2305c5215117569a70513f2a50edb305bac527c0818ee25cf2a1b27cd8ee15f1
4
- data.tar.gz: c5696096aaec5c002b4639b5abeb2af8d0a53b9fc831389a47359afcf382bbcd
3
+ metadata.gz: 608a68da5f01abba8df499233779b428564f247ede7b80311b3af48168898519
4
+ data.tar.gz: 6eed899188c50ed6611cb0f6180dde027c53065ae5f9ea1ebe9613b36e04a725
5
5
  SHA512:
6
- metadata.gz: de19b8f9eec5d03f7aa1a9e3a4a10151470e5af3978daea2fa77ba31adb5981b4c9a51b0b4d8e74d18f6e04afcfe7f2ffca61e0794335400bb8ea33c9f443acf
7
- data.tar.gz: 7bfcbd510c93d0dcbb207b047a135ccc7af3177e351648340a28691eda9359436626654e37c7536a1e783f32e2b60c24e4eac868d6dfa8da85a67b8dc4af27d0
6
+ metadata.gz: b5624cef6cd5474eacb13dba6b2d8ec90b9600383b429c316d2d249a3d4fb97bb80c907890c2670af46f317f386bdd630c1b671f8698cd7ee68cefa8325aacde
7
+ data.tar.gz: a862487a146d0db29481f0593d77e872f45115d86920314e64f8250284985297fc8ba41a0e523a9548f5e04a62faf3b3a7ad40e3446558cb37d27e129cbe60bb
data/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [9.0.0] - 2026-09-23
4
+
5
+ - Breaking: replaced payout `balance_transactions` ID strings with typed
6
+ contribution values containing the source transaction's original amount and
7
+ the exact amount allocated to the payout.
8
+ - Added complete payment balance-transaction allocation history together with
9
+ available, pending, and spent amount partitions.
10
+
11
+ ## [8.1.0] - 2026-09-21
12
+
13
+ - Added typed search across customers, financial accounts, orders, payouts, and
14
+ products, including filters, facets, sorting, cursor pagination, totals, and
15
+ freshness metadata.
16
+ - Added typed verification purposes for OTP initiation requests.
17
+
3
18
  ## [8.0.0] - 2026-09-16
4
19
 
5
20
  - Breaking: replaced generic custom-data hashes with immutable Sorbet-typed
@@ -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. Present only when `type` is `payment`.
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,21 @@
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
16
  # Merchant balance entry caused by a payment or refund. `type` describes the semantic source,
13
17
  # not direction. A payment transaction contains `payment_id`; a refund transaction contains
14
- # `refund_id`. Exactly one matching reference is present.
18
+ # `refund_id`. Exactly one matching reference is present. Payment transactions also expose
19
+ # their complete current allocation state and disjoint available, pending, and spent amounts.
20
+ # Allocation fields are omitted from refund transactions because refund transactions are
21
+ # consumers rather than sources.
15
22
  #
16
23
  # This generated model is immutable. Construct it with `.new`, or decode a string-keyed API
17
24
  # payload with `.from_hash`. `#serialize` produces a string-keyed hash using the original wire
@@ -25,6 +32,19 @@ module Inttegro
25
32
  # Required in the API payload. Wire name: `amount`.
26
33
  # @return [Inttegro::BalanceTransaction::Amount]
27
34
  #
35
+ # @!attribute [r] allocations
36
+ # All current pending and completed allocations of this payment transaction. Released
37
+ # allocations are omitted. Present only when `type` is `payment`.
38
+ #
39
+ # Optional in the API payload; omitted values default to `nil`. Wire name: `allocations`.
40
+ # @return [Array<Inttegro::BalanceTransaction::Allocation>, nil]
41
+ #
42
+ # @!attribute [r] available_amount
43
+ # Amount still available for a refund or payout. Present only when `type` is `payment`.
44
+ #
45
+ # Optional in the API payload; omitted values default to `nil`. Wire name: `available_amount`.
46
+ # @return [Inttegro::BalanceTransaction::AvailableAmount, nil]
47
+ #
28
48
  # @!attribute [r] available_at
29
49
  # Value of the `available_at` field in the Inttegro API payload.
30
50
  #
@@ -32,7 +52,8 @@ module Inttegro
32
52
  # @return [Time, nil]
33
53
  #
34
54
  # @!attribute [r] claimed_at
35
- # Value of the `claimed_at` field in the Inttegro API payload.
55
+ # Legacy whole-transaction payout claim timestamp. New integrations should inspect
56
+ # `allocations`.
36
57
  #
37
58
  # Optional in the API payload; omitted values default to `nil`. Wire name: `claimed_at`.
38
59
  # @return [Time, nil]
@@ -56,11 +77,19 @@ module Inttegro
56
77
  # @return [String]
57
78
  #
58
79
  # @!attribute [r] paid_at
59
- # Value of the `paid_at` field in the Inttegro API payload.
80
+ # Legacy whole-transaction payout completion timestamp. New integrations should inspect
81
+ # `allocations`.
60
82
  #
61
83
  # Optional in the API payload; omitted values default to `nil`. Wire name: `paid_at`.
62
84
  # @return [Time, nil]
63
85
  #
86
+ # @!attribute [r] pending_amount
87
+ # Amount temporarily unavailable because a refund or payout is unresolved. Present only when
88
+ # `type` is `payment`.
89
+ #
90
+ # Optional in the API payload; omitted values default to `nil`. Wire name: `pending_amount`.
91
+ # @return [Inttegro::BalanceTransaction::PendingAmount, nil]
92
+ #
64
93
  # @!attribute [r] payment_id
65
94
  # Present when `type` is `payment`; omitted when `type` is `refund`.
66
95
  #
@@ -68,7 +97,8 @@ module Inttegro
68
97
  # @return [String, nil]
69
98
  #
70
99
  # @!attribute [r] payout_id
71
- # Value of the `payout_id` field in the Inttegro API payload.
100
+ # Legacy payout owning the whole transaction remainder. New integrations should inspect
101
+ # `allocations` because one transaction can participate in many payouts.
72
102
  #
73
103
  # Optional in the API payload; omitted values default to `nil`. Wire name: `payout_id`.
74
104
  # @return [String, nil]
@@ -85,6 +115,13 @@ module Inttegro
85
115
  # Optional in the API payload; omitted values default to `nil`. Wire name: `refund_id`.
86
116
  # @return [String, nil]
87
117
  #
118
+ # @!attribute [r] spent_amount
119
+ # Amount permanently consumed by completed refunds and payouts. Present only when `type` is
120
+ # `payment`.
121
+ #
122
+ # Optional in the API payload; omitted values default to `nil`. Wire name: `spent_amount`.
123
+ # @return [Inttegro::BalanceTransaction::SpentAmount, nil]
124
+ #
88
125
  # @!attribute [r] type
89
126
  # Semantic source or cause of the transaction, not its direction.
90
127
  #
@@ -92,16 +129,41 @@ module Inttegro
92
129
  # @return [Inttegro::BalanceTransaction::Type]
93
130
  class BalanceTransaction
94
131
  const :amount, Inttegro::BalanceTransaction::Amount
132
+ const :allocations, T.nilable(T::Array[Inttegro::BalanceTransaction::Allocation]), default: nil
133
+ const :available_amount, T.nilable(Inttegro::BalanceTransaction::AvailableAmount), default: nil
95
134
  const :available_at, T.nilable(Time), default: nil
96
135
  const :claimed_at, T.nilable(Time), default: nil
97
136
  const :created_at, Time
98
137
  const :id, String
99
138
  const :order_id, String
100
139
  const :paid_at, T.nilable(Time), default: nil
140
+ const :pending_amount, T.nilable(Inttegro::BalanceTransaction::PendingAmount), default: nil
101
141
  const :payment_id, T.nilable(String), default: nil
102
142
  const :payout_id, T.nilable(String), default: nil
103
143
  const :payout_configuration, T.nilable(Inttegro::BalanceTransaction::PayoutConfiguration), default: nil
104
144
  const :refund_id, T.nilable(String), default: nil
145
+ const :spent_amount, T.nilable(Inttegro::BalanceTransaction::SpentAmount), default: nil
105
146
  const :type, Inttegro::BalanceTransaction::Type
147
+
148
+ extend T::Sig
149
+
150
+ sig { params(hash: T::Hash[String, Object], strict: T::Boolean).returns(T.attached_class) }
151
+ def self.from_hash(hash, strict = false)
152
+ data = hash.dup
153
+ if (allocations_value = data["allocations"]).is_a?(Array)
154
+ data["allocations"] = allocations_value.map do |item|
155
+ next item unless item.is_a?(Hash)
156
+ case item["type"]
157
+ when "payout"
158
+ Inttegro::BalanceTransaction::PayoutAllocation.from_hash(item)
159
+ when "refund"
160
+ Inttegro::BalanceTransaction::RefundAllocation.from_hash(item)
161
+ else
162
+ item
163
+ end
164
+ end
165
+ end
166
+ super(data, strict)
167
+ end
106
168
  end
107
169
  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,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
+
8
+ module Inttegro
9
+ class BalanceTransaction
10
+ # Amount temporarily unavailable because a refund or payout is unresolved. Present only when
11
+ # `type` is `payment`.
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] currency
20
+ # Currency code as stored on the transaction
21
+ #
22
+ # Required in the API payload. Wire name: `currency`.
23
+ # @return [String]
24
+ #
25
+ # @!attribute [r] value
26
+ # Unsigned amount in the currency's smallest unit
27
+ #
28
+ # Required in the API payload. Wire name: `value`.
29
+ # @return [Integer]
30
+ class PendingAmount < T::Struct
31
+ const :currency, String
32
+ const :value, Integer
33
+ end
34
+ end
35
+ 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
@@ -19,7 +19,10 @@ module Inttegro
19
19
  # @!attribute [r] transaction
20
20
  # Merchant balance entry caused by a payment or refund. `type` describes the semantic source,
21
21
  # not direction. A payment transaction contains `payment_id`; a refund transaction contains
22
- # `refund_id`. Exactly one matching reference is present.
22
+ # `refund_id`. Exactly one matching reference is present. Payment transactions also expose
23
+ # their complete current allocation state and disjoint available, pending, and spent amounts.
24
+ # Allocation fields are omitted from refund transactions because refund transactions are
25
+ # consumers rather than sources.
23
26
  #
24
27
  # Required in the API payload. Wire name: `transaction`.
25
28
  # @return [Inttegro::BalanceTransaction]