start Transaction
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.
currency Code
The currency code of the transaction.
metadata
Optional metadata to be included in the transaction.
on Completed
Callback for when the transaction completes.
on Cancelled
Callback for when the transaction is cancelled.
on Error
Callback for when an error occurs during the transaction.
on Gratuity Confirmed
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.