ScanBarcodeResultCallback

Callback interface for receiving the result of a barcode scanning operation.

Successful scans are reported via onSuccess, while errors (including user cancellation and timeouts) are reported via onFailure with appropriate TerminalErrorCode values:

  • TerminalErrorCode.CANCELED when the user cancels the operation

  • TerminalErrorCode.REQUEST_TIMED_OUT when the scan times out

  • Other error codes for scanning failures

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

Functions

Link copied to clipboard
abstract fun onFailure(e: TerminalException)

This method will be called any time the the current operation fails.

Link copied to clipboard
abstract fun onSuccess(scanResult: ScanResult)

Called when a barcode is successfully scanned.