FiscalPurchaseResult

sealed class FiscalPurchaseResult<out T>

A sealed class representing the result of an operation, which can either be a success or an error.

This type is specifically used for the results of the PosSdkActionExecutor.purchase and PosSdkActionExecutor.cancel methods in the POS External SDK. It can contain either a successful outcome with relevant data or an error detailing what went wrong during the operation.

The class also includes several intermediate states:

  • InitOperation: Indicates that the terminal is being configured.

  • ReaderReady: Indicates that the terminal is ready and waiting for the card.

  • Processing: Indicates that the transaction is being processed.

These intermediate states are only emitted when the communication type is set to CommunicationType.AIDL.

Type Parameters

T

The type of data contained in the result in case of a success. Typically, this will be a subtype of SdkSuccessAnswer.

Inheritors

Types

Link copied to clipboard
data class Error(val message: String, val code: String) : FiscalPurchaseResult<Nothing>

Represents an error result of an operation.

Link copied to clipboard
data object InitOperation : FiscalPurchaseResult<Nothing>

Intermediate state indicating that the terminal is being configured. This state will only be emitted when the communication type is set to CommunicationType.AIDL.

Link copied to clipboard
data object Processing : FiscalPurchaseResult<Nothing>

Intermediate state indicating that the transaction is being processed. This state will only be emitted when the communication type is set to CommunicationType.AIDL.

Link copied to clipboard
data object ReaderReady : FiscalPurchaseResult<Nothing>

Intermediate state indicating that the terminal is ready and waiting for the card. This state will only be emitted when the communication type is set to CommunicationType.AIDL.

Link copied to clipboard
data class Success<out T>(val data: T) : FiscalPurchaseResult<T>

Represents a successful result of an operation.