Connection and reconnection
Target audience: developers working on the integration layer.
Public status semantics are described in State and flows. This page covers the internal reconnection logic.
terminalReady
TerminalConnectionManager derives terminalReady by combining:
- successful SDK initialization
TransactionManagerState.LOGGED_INterminalConnected
Signals affecting connection state
The manager listens to:
paymentCompletedcommunicationStatusnotificationEventsshouldReconnect
When the connection is lost, the internal connection state is set to false.
Reconnection
Reconnection is guarded by a Mutex to ensure only one reconnect flow runs at a time.
Sequence:
- teardown of the runtime
- re-initialization using the last known
TerminalConnectionConfig - wait for initialization result
- login
- publish device information
- set connection state to
true
Development rule
New reconnection logic should be placed here or in SdkRuntime, depending on whether it concerns connection policy or SDK events. It should not be implemented in UI, ViewModels, or payment-specific methods.