public static FeesCharges GetFeeSection() { FeesCharges fees = new FeesCharges(); // read file from json config var path = @"C:\Users\toby\source\repos\FeeCharges\FeeCharges\wwwroot\fees.config.json"; try { string fileContent = String.Empty; StreamReader reader = new StreamReader(path); fileContent = reader.ReadToEnd(); if (!string.IsNullOrEmpty(fileContent)) { fees = JsonConvert.DeserializeObject <FeesCharges>(fileContent); } } catch (IOException e) { Console.WriteLine(e); } catch (Exception e) { Console.WriteLine(e); throw; } return(fees); }
public static double AmountToPay(FeesCharges fees, double amount) { // return amount to be charged if (fees == null) { return(default);
public SurChargeTransaction() { _actual = Configuration.GetFeeSection(); _actualFunc = Configuration.GetFeeSection; }