Пример #1
0
        public IActionResult RegistrarPagamento([FromBody] PagamentoInput input)
        {
            try
            {
                if (input.EhValido())
                {
                    string response = _pagamentoService.ExibirInfoTroco(input.ValorVenda, input.ValorPago);

                    PagamentoOutput output = new PagamentoOutput {
                        InfoTroco = response
                    };

                    return(ResponseSuccess(output, _pagamentoService));
                }
                return(BadRequest("Dados de entrada inválidos"));
            }
            catch (Exception ex)
            {
                return(ResponseException(ex));
            }
        }