public void ConnectToReader(StripeTerminalReader reader, Action <ReaderConnectionResult> onReaderConnectionSuccess) { var discoveredReader = _discoveredReaders.FirstOrDefault(x => x.SerialNumber == reader.SerialNumber); if (discoveredReader != null) { _connectedReader = discoveredReader; StripeTerminal.Instance.ConnectReader(discoveredReader, new ConnectionCallback((reader, e) => { var result = new ReaderConnectionResult { ErrorMessage = e?.ErrorMessage, IsConnected = e == null }; System.Diagnostics.Debug.WriteLine(e?.Message + " " + e?.ErrorMessage); onReaderConnectionSuccess?.Invoke(result); })); } }
public void ConnectToReader(StripeTerminalReader reader, Action <ReaderConnectionResult> onReaderConnectionSuccess) { var discoveredReader = _discoveredReaders?.FirstOrDefault(x => x?.SerialNumber == reader?.SerialNumber); if (discoveredReader != null) { SCPTerminal.Shared.ConnectReader(discoveredReader, (SCPReader scpReader, NSError e) => { if (e == null) { _reader = discoveredReader; } var result = new ReaderConnectionResult { ErrorMessage = e?.LocalizedDescription, IsConnected = e == null }; onReaderConnectionSuccess?.Invoke(result); }); } }