startTransaction

fun startTransaction(amount: Int, type: TransactionType, currencyCode: CurrencyCode, metadata: TransactionMetadata? = null, onCompleted: (TransactionReceipt) -> Unit, onCancelled: (CancellationType) -> Unit, onError: (ToroException) -> Unit, onGratuityConfirmed: (gratuityAmount: Int, gratuityPercentage: Int) -> Unit? = null)

Starts a transaction with the specified amount and currency code on the selected device.

Parameters

amount

The total amount (including gratuity if applicable) to charge in the smallest unit of the currency (e.g. pence for GBP).

type

The type of transaction to be processed.

currencyCode

The currency code of the transaction.

metadata

Optional metadata to be included in the transaction.

onCompleted

Callback for when the transaction completes.

onCancelled

Callback for when the transaction is cancelled.

onError

Callback for when an error occurs during the transaction.

onGratuityConfirmed

Callback for when the user has confirmed the gratuity. Only applicable when services.cabcard.toro.core.model.GratuityConfig mode is not services.cabcard.toro.core.enums.GratuityMode.NONE.

See also