Ejemplo n.º 1
0
        public IHttpActionResult Cancelar(string hash)
        {
            var pedido = pedidoServico.PrimeiroPor(p => p.ListaHistorico.Any(lh => lh.StatusPedido == StatusPedido.AguardandoPagamento && lh.CodigoRetornoTransacao == hash));

            if (pedido == null)
            {
                throw new BusinessRuleException("Pedido não encontrado.");
            }

            var response = _apiTransacaoEbanx.Cancelar(pedido);

            return(Ok(response));
        }