Пример #1
0
        public Task Handle(PagamentoRecusadoEvent message)
        {
            //_bus.Send(new CancelarPedidoCommand { AggregateRoot = message.AggregateRoot }).Wait();
            // Realiza processamento de negocio!

            Console.ForegroundColor = ConsoleColor.Red;
            Console.WriteLine("Pagamento Recusado!");
            Console.ForegroundColor = ConsoleColor.Black;

            _bus.Publish(new PedidoCanceladoEvent()
            {
                AggregateRoot = message.AggregateRoot
            }).Wait();
            Data.PagamentoRealizado = false;

            ProcessoSaga();

            return(Task.CompletedTask);
        }
Пример #2
0
 public async Task Handle(PagamentoRecusadoEvent message, CancellationToken cancellationToken)
 {
     await _mediatorHandler.EnviarComando(new CancelarProcessamentoPedidoEstornarEstoqueCommand(message.PedidoId, message.ClienteId));
 }
Пример #3
0
 public async Task Handle(PagamentoRecusadoEvent mensagem, CancellationToken cancellationToken)
 {
     await _mediatorHandler.EnviarComando(new CancelarPedidoCommand(mensagem.PedidoID, mensagem.ClienteID));
 }