public async Task Handle(InitiatePaymentProcessCommand message, IMessageHandlerContext context)
        {
            Log.Info("Handle InitiatePaymentProcessCommand");

            await _reliablePaymentClient.ProcessPayment(message.CustomerId, message.Amount);

            await context.Publish(new PaymentSucceededEvent
            {
                OrderId = message.OrderId,
            });
        }
Beispiel #2
0
        public async Task Handle(OrderSubmittedEvent message, IMessageHandlerContext context)
        {
            Log.Info("Handle OrderSubmittedEvent");

            var amount = await GetAmount(message.Products);

            await _reliablePaymentClient.ProcessPayment(message.CustomerId, amount);

            await context.Publish <PaymentSucceededEvent>(e =>
            {
                e.OrderId = message.OrderId;
            });
        }