public LoadKeysResponse LoadKeys() { if (_configured) { try { LoadKeysResponse response = new LoadKeysResponse(TransbankWrap.load_keys()); if (response.Success) { return(response); } else { throw new TransbankLoadKeysException("Load Keys retured an error: " + response.ResponseMessage, response); } } catch (TransbankLoadKeysException) { throw; } catch (Exception e) { throw new TransbankException("Unable to load Keys in pos", e); } } else { throw new TransbankException("Port not Configured"); } }
private void LoadKeysToolStripMenuItem_Click(object sender, EventArgs e) { try { LoadKeysResponse response = POS.Instance.LoadKeys(); if (response.Success) { MessageBox.Show(response.ToString(), "Keys Loaded Successfully."); } } catch (TransbankException a) { MessageBox.Show(a.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public TransbankLoadKeysException(string message, LoadKeysResponse response) : base(message) { LoadKeyResponse = response; }