purchase

abstract suspend fun purchase(request: PosRequest, customMetaData: Map<String, String> = emptyMap(), timeOut: Int? = null): Flow<FiscalPurchaseResult<SdkSuccessAnswer.FiscalPurchase>>

Initiates a purchase transaction with the specified amount.

Return

Flow emitting a FiscalPurchaseResult which can be a FiscalPurchaseResult.Success containing SdkSuccessAnswer.Purchase with invoice and receipt details if successful, or a FiscalPurchaseResult.Error if the operation fails.

Additionally, the flow can emit intermediate states:

Note: These intermediate states will only be emitted when the communication type is set to CommunicationType.AIDL.

Parameters

request

The POS request

customMetaData

A map of key-value pairs containing additional info for the transaction. This metadata is stored along with the transaction and can be used later for searching, filtering.

timeOut

Card wait timeout in seconds. null uses the POS default (30 seconds).

See also