ScanOptions

data class ScanOptions(val scanners: List<ScannerInfo>, val formats: Set<BarcodeFormat> = setOf(BarcodeFormat.ALL_FORMATS), val showControls: Boolean = true, val enableLight: Boolean = false, val timeout: Duration = 1.minutes)

Configuration options for a barcode scanning operation.

Throws

if scanners is empty or formats is empty.

Use of this SDK is subject to the Stripe Terminal Terms: https://stripe.com/terminal/legal

Constructors

Link copied to clipboard
constructor(scanners: List<ScannerInfo>, formats: Set<BarcodeFormat> = setOf(BarcodeFormat.ALL_FORMATS), showControls: Boolean = true, enableLight: Boolean = false, timeout: Duration = 1.minutes)

Types

Link copied to clipboard
class Builder

Builder for ScanOptions.

Properties

Link copied to clipboard
val enableLight: Boolean = false

Whether to enable the scanner's light (e.g., flashlight) during scanning.

Link copied to clipboard

The set of barcode formats to scan for. Must contain at least one format. Defaults to BarcodeFormat.ALL_FORMATS.

Link copied to clipboard

The list of scanners to use for scanning. Must contain at least one scanner.

Link copied to clipboard
val showControls: Boolean = true

Whether to show UI controls (e.g., cancel button) during scanning.

Link copied to clipboard

The maximum duration for the scanning operation before it times out.