BalanceTransaction
extends DomainValue
in package
A ledger entry that explains when and why money moved through an Inttegro balance.
This immutable value hydrates decoded API snake_case data into typed camelCase properties.
Use fromArray() for wire data; toArray(), array access, and JSON serialization expose the API
wire representation. Nullable properties correspond to optional API fields.
Tags
Table of Contents
Properties
- $allocations : array<int, PayoutAllocation|RefundAllocation>
- All pending and completed allocations; released entries are omitted.
- $amount : Amount
- Monetary amount in integer minor units and its currency.
- $availableAmount : Amount|null
- Amount still available. PHP type: `Amount|null`; wire field: `available_amount` (`object`).
- $availableAt : DateTimeImmutable|null
- Time at which the funds become available.
- $claimedAt : DateTimeImmutable|null
- Time at which the funds were claimed.
- $createdAt : DateTimeImmutable
- Time at which the value was created.
- $id : string
- Unique identifier for this balance transaction.
- $orderId : string|null
- Identifier of the related order.
- $paidAt : DateTimeImmutable|null
- Time at which payment completed.
- $paymentId : string|null
- Present when `type` is `payment`; omitted when `type` is `refund`.
- $payoutConfiguration : PayoutConfiguration|null
- Payout Configuration value for this balance transaction.
- $payoutId : string|null
- Payout source for a payout debit, or the legacy whole-payment claim.
- $pendingAmount : Amount|null
- Amount reserved by unresolved work. PHP type: `Amount|null`; wire field: `pending_amount` (`object`).
- $refundId : string|null
- Present when `type` is `refund`; omitted when `type` is `payment`.
- $spentAmount : Amount|null
- Permanently consumed amount. PHP type: `Amount|null`; wire field: `spent_amount` (`object`).
- $type : string
- Semantic source or cause of the transaction, not its direction.
Methods
- __construct() : mixed
- Hydrates a BalanceTransaction from decoded Inttegro API data.
- fromArray() : static
- Creates a BalanceTransaction from its decoded API wire representation.
- jsonSerialize() : array<string, mixed>
- Returns the same API wire object as `toArray()` for `json_encode()`.
- offsetExists() : bool
- Reports whether a non-null property exists for a PHP or API field name.
- offsetGet() : mixed
- Reads a typed property through PHP `ArrayAccess`.
- offsetSet() : void
- Rejects mutation because domain values are immutable.
- offsetUnset() : void
- Rejects unsetting because domain values are immutable.
- toArray() : array<string, mixed>
- Converts typed properties back to the API's wire representation.
Properties
$allocations read-only
All pending and completed allocations; released entries are omitted.
public
array<int, PayoutAllocation|RefundAllocation>
$allocations
PHP type: list<PayoutAllocation|RefundAllocation>; wire field: allocations (array).
$amount read-only
Monetary amount in integer minor units and its currency.
public
Amount
$amount
Required response field. PHP type: \Inttegro\BalanceTransaction\Amount; wire field:
amount (object).
$availableAmount read-only
Amount still available. PHP type: `Amount|null`; wire field: `available_amount` (`object`).
public
Amount|null
$availableAmount
$availableAt read-only
Time at which the funds become available.
public
DateTimeImmutable|null
$availableAt
Optional response field. PHP type: DateTimeImmutable|null; wire field: available_at
(ISO-8601 string with UTC offset).
The SDK parses the offset-bearing timestamp into an immutable PHP date-time value.
$claimedAt read-only
Time at which the funds were claimed.
public
DateTimeImmutable|null
$claimedAt
Optional response field. PHP type: DateTimeImmutable|null; wire field: claimed_at
(ISO-8601 string with UTC offset).
The SDK parses the offset-bearing timestamp into an immutable PHP date-time value.
$createdAt read-only
Time at which the value was created.
public
DateTimeImmutable
$createdAt
Required response field. PHP type: DateTimeImmutable; wire field: created_at (ISO-8601 string with UTC offset).
The SDK parses the offset-bearing timestamp into an immutable PHP date-time value.
$id read-only
Unique identifier for this balance transaction.
public
string
$id
Required response field. PHP type: string; wire field: id (string).
$orderId read-only
Identifier of the related order.
public
string|null
$orderId
Optional for payout debits. PHP type: string|null; wire field: order_id (string).
$paidAt read-only
Time at which payment completed.
public
DateTimeImmutable|null
$paidAt
Optional response field. PHP type: DateTimeImmutable|null; wire field: paid_at (ISO-8601 string with UTC offset).
The SDK parses the offset-bearing timestamp into an immutable PHP date-time value.
$paymentId read-only
Present when `type` is `payment`; omitted when `type` is `refund`.
public
string|null
$paymentId
Optional response field. PHP type: string|null; wire field: payment_id (string).
$payoutConfiguration read-only
Payout Configuration value for this balance transaction.
public
PayoutConfiguration|null
$payoutConfiguration
Optional response field. PHP type: \Inttegro\Payment\PayoutConfiguration|null; wire field:
payout_configuration (object).
$payoutId read-only
Payout source for a payout debit, or the legacy whole-payment claim.
public
string|null
$payoutId
Optional response field. PHP type: string|null; wire field: payout_id (string).
$pendingAmount read-only
Amount reserved by unresolved work. PHP type: `Amount|null`; wire field: `pending_amount` (`object`).
public
Amount|null
$pendingAmount
$refundId read-only
Present when `type` is `refund`; omitted when `type` is `payment`.
public
string|null
$refundId
Optional response field. PHP type: string|null; wire field: refund_id (string).
$spentAmount read-only
Permanently consumed amount. PHP type: `Amount|null`; wire field: `spent_amount` (`object`).
public
Amount|null
$spentAmount
$type read-only
Semantic source or cause of the transaction, not its direction.
public
string
$type
Required response field. PHP type: string; wire field: type (string).
Compare against Type cases by using their ->value strings.
Methods
__construct()
Hydrates a BalanceTransaction from decoded Inttegro API data.
public
__construct(array<string, mixed> $data) : mixed
Parameters
- $data : array<string, mixed>
-
Wire object keyed by
snake_caseAPI field names.
fromArray()
Creates a BalanceTransaction from its decoded API wire representation.
public
static fromArray(array<string, mixed> $data) : static
Parameters
- $data : array<string, mixed>
-
Wire object keyed by
snake_caseAPI field names.
Return values
static —A typed, immutable BalanceTransaction value.
jsonSerialize()
Returns the same API wire object as `toArray()` for `json_encode()`.
public
jsonSerialize() : array<string, mixed>
Return values
array<string, mixed>offsetExists()
Reports whether a non-null property exists for a PHP or API field name.
public
offsetExists(mixed $offset) : bool
Both paymentId and payment_id address the same typed property.
Parameters
- $offset : mixed
-
PHP
camelCaseor wiresnake_casefield name.
Return values
booloffsetGet()
Reads a typed property through PHP `ArrayAccess`.
public
offsetGet(mixed $offset) : mixed
Parameters
- $offset : mixed
-
PHP
camelCaseor wiresnake_casefield name.
Return values
mixed —The PHP-native property value.
offsetSet()
Rejects mutation because domain values are immutable.
public
offsetSet(mixed $offset, mixed $value) : void
Parameters
- $offset : mixed
-
Ignored field name.
- $value : mixed
-
Ignored replacement value.
Tags
offsetUnset()
Rejects unsetting because domain values are immutable.
public
offsetUnset(mixed $offset) : void
Parameters
- $offset : mixed
-
Ignored field name.
Tags
toArray()
Converts typed properties back to the API's wire representation.
public
toArray() : array<string, mixed>
Property names become snake_case. Nested values, arrays, backed enums, and timestamps are
normalized recursively so the result is safe to pass to json_encode().
Return values
array<string, mixed> —The recursively normalized API object.