Response and Error Codes
This page summarizes how the SDK represents operation outcomes and error conditions. All repository calls return a RepositoryResult<T> wrapper which forces you to handle success and failure explicitly.
RepositoryResult<T>
RepositoryResult<T> is a Kotlin sealed class with the following branches:
- Success<T>: The call completed successfully.
- Contains a
data: Tpayload (for examplePaymentResult,RefundResult,TpvInfo,TotalsResult, etc.).
- Contains a
- ConnectionError: A communication problem occurred.
- Typical causes: the Get Smart SDK Payment Service is not running, the device is offline, or there is a connectivity issue with the host.
- Cancelled: The operation was cancelled.
- Often indicates that the user aborted an interactive flow on the TPV UI. Includes a human‑readable
message.
- Often indicates that the user aborted an interactive flow on the TPV UI. Includes a human‑readable
- ProtocolError: The request could not be processed due to an integration or mapping issue.
- Includes a
type: ProtocolErrorTypeand an optionaldescription.
- Includes a
For idiomatic handling patterns and examples, see Core Concepts / Handle Responses and Errors.
ProtocolErrorType
When you receive RepositoryResult.ProtocolError, the type field is one of the following values (see also Data Models Glossary):
MAPPING_DATA: Internal error mapping data between the SDK and the background service.- Action: usually indicates an unexpected state; capture logs and contact support if it persists.
MAPPING_DOMAIN: Something is wrong with the data your app sent.- Action: validate parameters such as amounts, currencies, and identifiers.
TPV_NOT_INITIALIZED: A critical configuration error.- Action: ensure
InitializationRepository.initTpv()has been called successfully before performing operations like payments, refunds, or history queries.
- Action: ensure
Business‑level results
Many successful calls still require you to check a business result inside the payload:
- Payment, refund and preauthorization operations return sealed result types such as
PaymentResult,RefundResult, andPreauthorizationResult, which distinguish:- Accepted operations (authorized by the host, with a
Transactionpayload). - Denied operations (rejected by the host/bank, with an explanatory
Transactionpayload). - Specific domain errors (for example
RefundResult.ExceededAmount).
- Accepted operations (authorized by the host, with a
- History and totals queries return structures like
GetTransactionsResultorTotalsResultwhich indicate whether there is data, more pages, or invalid identifiers.
Always inspect both the outer RepositoryResult<T> and the inner domain result to decide what to show in your UI and when to retry or escalate errors.
English › Documentation › Documentation › Local Processor (Spain) › Get Smart › Get Smart SDK › Reference