예제 #1
0
 public void Processa(IList <Boleto> boletos, Fatura fatura)
 {
     foreach (var boleto in boletos)
     {
         Pagamento pagamento = new Pagamento(boleto.ValorDoBoleto, MeioDePagamento.BOLETO);
         fatura.AdicionaPagamento(pagamento);
     }
 }
예제 #2
0
        public void Processa(IList <Boleto> boletos, Fatura fatura)
        {
            Boleto boleto = boletos[0];

            Pagamento pagamento = new Pagamento(boleto.ValorDoBoleto, MeioDePagamento.BOLETO);

            fatura.Pagamentos.Add(pagamento);
        }
예제 #3
0
        public void Processa(IList <Boleto> boletos, Fatura fatura)
        {
            double valorTotal = 0;

            foreach (var boleto in boletos)
            {
                Pagamento pagamento = new Pagamento(boleto.ValorDoBoleto, MeioDePagamento.BOLETO);
                fatura.Pagamentos.Add(pagamento);

                valorTotal += boleto.ValorDoBoleto;
            }

            if (valorTotal >= fatura.ValorTotalDaFatura)
            {
                fatura.Pago = true;
            }
        }