public void ProcessPayment(Contract contract, IOnlinePaymentService paymentService) { double baseValue = contract.TotalValue / contract.Months; for (int i = 1; i <= contract.Months; i++) { DateTime dueDate = contract.Date.AddMonths(i); double intermediateValue = baseValue + paymentService.Interest(baseValue, i); double FinalValue = intermediateValue + paymentService.PaymentFee(intermediateValue); Installment install = new Installment(dueDate, FinalValue); contract.addInstallments(install); } Console.WriteLine("INSTALLMENTS: "); foreach (Installment item in contract.list) { Console.WriteLine(item.DueDate.ToString("dd/MM/yyyy") + " - " + item.Amount); } }
public static void ProcessContract(Contract contract, int monthes, IOnlinePaymentService service) { double monthValue = contract.ContractValue / monthes; for (int i = 0; i < monthes; i++) { DateTime _dueDate = contract.Date.AddMonths(i + 1); double _amount = monthValue + service.Interest(monthValue, i + 1); _amount += service.PaymentFee(monthValue); contract.installments.Add(new Installment(_dueDate, _amount)); } }
public void ProcessContract(Contract contract, int month, IOnlinePaymentService onlinePaymentService) { double amountSimple = contract.TotalValue / month; for (int i = 1; i <= month; i++) { double updateAmount = onlinePaymentService.Interest(amountSimple, i); double amountTotal = onlinePaymentService.PaymentFee(updateAmount); DateTime date = contract.DateContract.Date.AddMonths(i); contract.AddItem(new Installments(date, amountTotal)); } }
public ContractService(IOnlinePaymentService onlinePaymentService) { _onlinePaymentService = onlinePaymentService; }
public ContractService(IOnlinePaymentService onlinePaymServ) { _iOnPaymService = onlinePaymServ; }
public ContractService(IOnlinePaymentService payService) { _payService = payService; }
public ContractProcessing(IOnlinePaymentService service) { _onlinePaymentService = service; }
public ContractService(Contract contract, int months, IOnlinePaymentService payment) { Compactar = contract; Months = months; Payment = payment; }
public ContractServices(IOnlinePaymentService onl) { _onlinePaymentService = onl; }
public ContractCalculator(IOnlinePaymentService onlinePaymentService) { OnlinePaymentService = onlinePaymentService; }
public ServiceContractPP(IOnlinePaymentService onlinePaymentService) { _onlinePaymentService = onlinePaymentService; }
public ContractServices(IOnlinePaymentService onlinePayment) { _onlinePayment = onlinePayment; }