void ReaderController.ReaderStateChangedListener.onDecodeCompleted(Dictionary <string, string> decodeData) { NetTracer.Information(string.Format("Entering onDecodeCompleted event...")); if (this.RamblerCardSwipeEvent != null) { // The card has been read and decoded. // Now parse the received data and send it to the subscriber lock (SyncLock) { if (!this.isCardReaderEnabled) { return; } try { RamblerMagneticStripeCardData ramblerCardData = new RamblerMagneticStripeCardData(); // Parse the received data and return card ramblerCardData.ParseCard(decodeData); // Notify the client with the rambler card data. this.NotifyCompleted(ramblerCardData); } catch { NetTracer.Warning(string.Format("The tracks information are not extracted correctly. Retrying again...")); // Restart the device to capture the swipe information again. this.StartReader(); } } } }
private void NotifyCompleted(RamblerMagneticStripeCardData card) { NetTracer.Information("Notify client with the MSR card data"); if (this.RamblerCardSwipeEvent != null) { this.RamblerCardSwipeEvent(this, card); } }