Refund
extends DomainValue
in package
A refund request and its amount, reason, affected line items, lifecycle state, and related balance transaction.
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
- $canceledAt : DateTimeImmutable|null
- Omitted unless the refund was canceled before processing began.
- $cancelReason : string|null
- Omitted unless a reason was supplied when the refund was canceled.
- $createdAt : DateTimeImmutable
- Time at which the value was created.
- $customData : CustomData|null
- Merchant-defined string values attached to a resource. SDKs expose this as a semantic collection rather than a raw map.
- $failedAt : DateTimeImmutable|null
- Omitted unless processing failed.
- $failure : Failure|null
- Sanitized terminal failure information. Wire field: `failure`.
- $id : string
- Unique identifier for this refund.
- $lineItems : array<int, LineItem>
- One or more immutable line-level refund allocations.
- $orderAmount : Amount|null
- Total amount of the originating order captured when the refund was created.
- $orderId : string
- Identifier of the related order.
- $processingAt : DateTimeImmutable|null
- Omitted until processing starts.
- $reason : GenericValue
- Reason value for this refund.
- $reasonDetails : string|null
- Reason Details value for this refund.
- $reference : string|null
- Reference value for this refund.
- $settlement : OfflineSettlement|PaymentMethodSettlement
- Immutable destination selected by its required type discriminator. Wire field: `settlement`.
- $status : string
- Current lifecycle state.
- $succeededAt : DateTimeImmutable|null
- Omitted unless processing succeeded.
- $total : Amount
- Total number of matching values.
Methods
- __construct() : mixed
- Hydrates a Refund from decoded Inttegro API data.
- fromArray() : static
- Creates a Refund 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
$canceledAt read-only
Omitted unless the refund was canceled before processing began.
public
DateTimeImmutable|null
$canceledAt
Optional response field. PHP type: DateTimeImmutable|null; wire field: canceled_at
(ISO-8601 string with UTC offset).
The SDK parses the offset-bearing timestamp into an immutable PHP date-time value.
$cancelReason read-only
Omitted unless a reason was supplied when the refund was canceled.
public
string|null
$cancelReason
Optional response field. PHP type: string|null; wire field: cancel_reason (string).
$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.
$customData read-only
Merchant-defined string values attached to a resource. SDKs expose this as a semantic collection rather than a raw map.
public
CustomData|null
$customData
Optional response field. PHP type: \Inttegro\CustomData|null; wire field: custom_data
(object).
$failedAt read-only
Omitted unless processing failed.
public
DateTimeImmutable|null
$failedAt
Optional response field. PHP type: DateTimeImmutable|null; wire field: failed_at
(ISO-8601 string with UTC offset).
The SDK parses the offset-bearing timestamp into an immutable PHP date-time value.
$failure read-only
Sanitized terminal failure information. Wire field: `failure`.
public
Failure|null
$failure
$id read-only
Unique identifier for this refund.
public
string
$id
Required response field. PHP type: string; wire field: id (string).
$lineItems read-only
One or more immutable line-level refund allocations.
public
array<int, LineItem>
$lineItems
Required response field. PHP type: list<\Inttegro\Refund\LineItem>; wire field:
line_items (array<object>).
When the field is absent, the SDK exposes an empty collection.
$orderAmount read-only
Total amount of the originating order captured when the refund was created.
public
Amount|null
$orderAmount
Optional response field. PHP type: Amount|null; wire field: order_amount (object).
$orderId read-only
Identifier of the related order.
public
string
$orderId
Required response field. PHP type: string; wire field: order_id (string).
$processingAt read-only
Omitted until processing starts.
public
DateTimeImmutable|null
$processingAt
Optional response field. PHP type: DateTimeImmutable|null; wire field: processing_at
(ISO-8601 string with UTC offset).
The SDK parses the offset-bearing timestamp into an immutable PHP date-time value.
$reason read-only
Reason value for this refund.
public
GenericValue
$reason
Required response field. PHP type: \Inttegro\GenericValue; wire field: reason (string).
Compare against Reason cases by using their ->value strings.
$reasonDetails read-only
Reason Details value for this refund.
public
string|null
$reasonDetails
Optional response field. PHP type: string|null; wire field: reason_details (string).
$reference read-only
Reference value for this refund.
public
string|null
$reference
Optional response field. PHP type: string|null; wire field: reference (string).
$settlement read-only
Immutable destination selected by its required type discriminator. Wire field: `settlement`.
public
OfflineSettlement|PaymentMethodSettlement
$settlement
$status read-only
Current lifecycle state.
public
string
$status
Required response field. PHP type: string; wire field: status (string).
Compare against Status cases by using their ->value strings.
$succeededAt read-only
Omitted unless processing succeeded.
public
DateTimeImmutable|null
$succeededAt
Optional response field. PHP type: DateTimeImmutable|null; wire field: succeeded_at
(ISO-8601 string with UTC offset).
The SDK parses the offset-bearing timestamp into an immutable PHP date-time value.
$total read-only
Total number of matching values.
public
Amount
$total
Required response field. PHP type: Amount; wire field: total (object).
Methods
__construct()
Hydrates a Refund 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 Refund 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 Refund 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.