public async Task <bool> Pay() { Transaction = new Transaction(); Transaction.CardNumber = CardNumber.CardMask(); Transaction.Cvv = Cvv; Transaction.Month = Month.Value; Transaction.Year = Year.Value; Transaction.FullName = FullName; Transaction.Amount = PurchaseValue.Value; Transaction.Installment = Installment.Value; Transaction.IdShopkeeper = IdShopKeeper.Value; Transaction.Situation = true; Transaction.CreatedAt = DateTime.Now; var acquirer = _desafioContext.Acquirers.SingleOrDefault(p => p.Id == 1); if (acquirer == null) { return(false); } Transaction.NetAmount = PurchaseValue.Value - (PurchaseValue.Value * (acquirer.Tax / 100)); _desafioContext.Transactions.Add(Transaction); try { await _desafioContext.SaveChangesAsync(); return(true); } catch (Exception e) { return(false); } }