Getnet DocsGetnet Docs

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

FieldTypeDescription
resultString?Short standardized result code.
resultMessageString?Human-readable description of the outcome.
payloadAny?Operation-specific data. Cast it to the type for the operation.

Result codes

CodeMeaning
"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; for how to react to each failure, see 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:

FieldTypeDescription
paymentIdString?Unique transaction identifier. Store it to enable a direct refund.
orderIdString?Order identifier.
amountString?Transaction amount.
currencyString?Currency.
statusString?Transaction status.
paymentMethodString?Payment method used.
authorizationCodeString?Authorization code.
authorizedAtString?Authorization date and time.
acquirerString?Acquirer.
transactionId / acquirerTransactionIdString?Transaction identifiers.
reasonCode / reasonMessageString?Reason code and message.
emvString?EMV data.

Refunds — ICancelPaymentResponse

Returned by initRefund. Key fields:

FieldTypeDescription
paymentIdString?Identifier of the original transaction that was refunded.
amountInt?Refunded amount.
statusString?Refund status.
authorizationCodeString?Authorization code of the refund.
traceNumberInt?Trace number.
canceledAtString?Cancellation date and time.
reasonCode / reasonMessageString?Reason code and message.

Example

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 */ }
    }
}