PreTransactionProgress

Handle returned immediately by Terminal.startPreTransaction.

Call getResult to retrieve the PreTransactionResult - it always returns one, either blocking until the wait is over or returning immediately with the current state. Call cancel to stop waiting early - from another thread, if getResult is currently blocked in a call from a different thread.

Continue the payment through PreTransactionResult.startTransaction, or discard it with PreTransactionResult.abort. Cancelling the local wait does not discard the payment.

Functions

Link copied to clipboard
fun cancel()

Stops waiting for loyalty data early - interrupts the local background wait if it is still running, and unblocks any concurrent getResult call that is currently blocked waiting for a result, which then returns a PreTransactionResult whose PreTransactionResult.getLoyaltyData is null. Does not affect the terminal or the payment itself - the wait and the payment are independent. Continue through PreTransactionResult.startTransaction afterwards. A direct Terminal.startTransaction call remains blocked until the pre-transaction is continued or discarded with Terminal.abort.

Link copied to clipboard

Retrieves the PreTransactionResult - never null. Call PreTransactionResult.getLoyaltyData on it to check whether loyalty card data was collected.

Link copied to clipboard
open override fun toString(): String