connectInternetReader

fun connectInternetReader(reader: Reader, config: ConnectionConfiguration.InternetConnectionConfiguration, connectionCallback: ReaderCallback)

Attempts to connect to the given internet reader.

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 this connection

connectionCallback

The callback to be called when connection completes