connectLocalMobileReader

fun connectLocalMobileReader(reader: Reader, config: ConnectionConfiguration.LocalMobileConnectionConfiguration, connectionCallback: ReaderCallback)

Attempts to connect to the local device's NFC reader.

The Terminal SDK supports using the phone's or tablet's NFC reader to collect payment method data from a card or NFC transmitter.

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 bluetooth Reader object to connect to.

config

Any configuration options we need for this connection

connectionCallback

The callback to be called when connection completes