public ConfigModel ConfigRequest(ConfigModel atm) { ICryptographyService svr = new CryptographyService(atm.TerminalId); svr.CreateSessionKeys(); if (svr.GetResponseCode() == "00") { // Save the keys in database svr.UpdateSessionKeys(); atm.EncryptedPinKey1 = svr.GetEncryptedPinKey1(); atm.EncryptedPinKey2 = svr.GetEncryptedPinKey2(); return(atm); } _log.Error(string.Format("Response Code:{0}", svr.GetResponseCode())); throw new InvalidOperationException(string.Format("Response Code:{0}", svr.GetResponseCode())); }