# Transaction Result Reference

`TransactionResultCallback` delivers the outcome of `initSale` and `initRefund`. It is invoked once per operation, right before the SDK's Activity closes. The contract does not throw exceptions to the integrator — failures are reflected in the result value and message.

## Result fields

| Field | Type | Description |
| :--- | :--- | :--- |
| `result` | `String?` | Short standardized result code. |
| `resultMessage` | `String?` | Human-readable description of the outcome. |
| `payload` | `Any?` | Operation-specific data. Cast it to the type for the operation. |

## Result codes

| Code | Meaning |
| :--- | :--- |
| `"00"` | Transaction approved. |
| `"1-*"` | Terminal error (POS). |
| `"33-*"` | Host error — a payment-service (SEP) HTTP error or an issuer decline. |

Treat `"00"` as approval and any other value as a non-approval, showing `resultMessage` when available. Older terminals may still return the legacy `"4-*"` prefix for host errors — treat `"4-*"` and `"33-*"` as equivalent. For the full error catalog, see [Error codes reference](/en/getnet-toolbox/sdk-white-label/reference-sdk/error-codes); for how to react to each failure, see [Troubleshooting](https://docs.globalgetnet.com/en/products/in-store-payments/getnet-toolbox?doc=sdk-wl-troubleshooting).

## Payload by operation

Cast `payload` to the type that matches the operation. Accessing fields without the cast can raise a `ClassCastException`.

### Payments — `IPaymentResponse`

Returned by `initSale` (credit, debit, voucher, Pix). Key fields:

| Field | Type | Description |
| :--- | :--- | :--- |
| `paymentId` | `String?` | Unique transaction identifier. Store it to enable a direct refund. |
| `orderId` | `String?` | Order identifier. |
| `amount` | `String?` | Transaction amount. |
| `currency` | `String?` | Currency. |
| `status` | `String?` | Transaction status. |
| `paymentMethod` | `String?` | Payment method used. |
| `authorizationCode` | `String?` | Authorization code. |
| `authorizedAt` | `String?` | Authorization date and time. |
| `acquirer` | `String?` | Acquirer. |
| `transactionId` / `acquirerTransactionId` | `String?` | Transaction identifiers. |
| `reasonCode` / `reasonMessage` | `String?` | Reason code and message. |
| `emv` | `String?` | EMV data. |

### Refunds — `ICancelPaymentResponse`

Returned by `initRefund`. Key fields:

| Field | Type | Description |
| :--- | :--- | :--- |
| `paymentId` | `String?` | Identifier of the original transaction that was refunded. |
| `amount` | `Int?` | Refunded amount. |
| `status` | `String?` | Refund status. |
| `authorizationCode` | `String?` | Authorization code of the refund. |
| `traceNumber` | `Int?` | Trace number. |
| `canceledAt` | `String?` | Cancellation date and time. |
| `reasonCode` / `reasonMessage` | `String?` | Reason code and message. |

## Example

```kotlin
val onResult = TransactionResultCallback { result ->
    when (result.result) {
        "00" -> when (val payload = result.payload) {
            is IPaymentResponse -> { /* handle an approved payment */ }
            is ICancelPaymentResponse -> { /* handle an approved refund */ }
            else -> { /* ... */ }
        }
        else -> { /* non-approval — show result.resultMessage */ }
    }
}
```