connectReader

fun connectReader(reader: Reader, config: ConnectionConfiguration, connectionCallback: ReaderCallback)

Attempts to connect to the given reader, with the connection type dependent on config.

If the connect succeeds, the callback will be called with the connected reader, and the terminal's ConnectionStatus will change to CONNECTED.

If the connect fails, the callback will be called with an error.

Under the hood, the SDK uses the ConnectionTokenProvider.fetchConnectionToken method you defined to fetch a connection token if it does not already have one. It then uses the connection token and reader information to create a reader session.

See https://stripe.com/docs/terminal/readers/connecting.

Parameters

reader

The Reader object to connect to.

config

Any configuration options we need for a specific connection type

connectionCallback

The callback to be called when connection completes