public double PayIn(double amount, X509Certificate2 certificate)
        {
            AtmServiceLogger atmLogger = new AtmServiceLogger();

            if (Thread.CurrentPrincipal.IsInRole("ATMGroup"))
            {
                if (SmartCardDB.SmartCardList.ContainsKey(certificate.Thumbprint))
                {
                    // logovanje uplate na racun
                    atmLogger.WriteInformation($"Client {certificate.Subject.Split('=')[1]} has successfully paid in {amount} RSD.");

                    SmartCardDB.SmartCardList[certificate.Thumbprint].Amount += amount;
                    Program.BackupSmartCardProxy.PayIn(amount, certificate.Thumbprint);
                    return(SmartCardDB.SmartCardList[certificate.Thumbprint].Amount);
                }
                else
                {
                    // logovanje pokusaja uplate
                    atmLogger.WriteError($"Client {Formatter.ParseCNWithOU(certificate.Subject)} isn't user of this ATM service.");
                    throw new Exception($"Client {Formatter.ParseCNWithOU(certificate.Subject)} isn't user of this ATM service.");
                }
            }
            atmLogger.WriteError($"ATM not valid.");
            throw new Exception($"ATM not valid.");
        }
        public double PayOut(double amount, X509Certificate2 certificate)
        {
            AtmServiceLogger atmLogger = new AtmServiceLogger();

            if (Thread.CurrentPrincipal.IsInRole("ATMGroup"))
            {
                if (SmartCardDB.SmartCardList.ContainsKey(certificate.Thumbprint))
                {
                    if (SmartCardDB.SmartCardList[certificate.Thumbprint].Amount >= amount)
                    {
                        // logovanje uspesne isplate sa racuna
                        atmLogger.WriteInformation($"Client {Formatter.ParseCNWithOU(certificate.Subject)} has successfully paid out {amount} RSD.");

                        SmartCardDB.SmartCardList[certificate.Thumbprint].Amount -= amount;
                        Program.BackupSmartCardProxy.PayOut(amount, certificate.Thumbprint);
                        return(SmartCardDB.SmartCardList[certificate.Thumbprint].Amount);
                    }
                    else
                    {
                        atmLogger.WriteError($"Client {Formatter.ParseCNWithOU(certificate.Subject)} try to pay out {amount} RSD, but he hasn't got enough money on balance.");
                        throw new Exception($"Client {Formatter.ParseCNWithOU(certificate.Subject)} try to pay out {amount} RSD, but he hasn't got enough money on balance.");
                    }
                }
                else
                {
                    atmLogger.WriteError($"Client {Formatter.ParseCNWithOU(certificate.Subject)} isn't user of this ATM service.");
                    throw new Exception($"Client {Formatter.ParseCNWithOU(certificate.Subject)} isn't user of this ATM service.");
                }
            }
            atmLogger.WriteError($"ATM not valid.");
            throw new Exception($"ATM not valid.");
        }