void ProcessPayment(SubmitPaymentMessage message) { if (message.Amount > _amount) { Console.WriteLine("Thanks for the tip!"); } else if (message.Amount < _amount) { Console.WriteLine("What are you, some kind of charity case?"); } var paymentType = message.PaymentType; Console.WriteLine("Received a payment of {0} for {1} ({2})", paymentType, _item, _size); if (paymentType == PaymentType.CreditCard) { Console.Write("Authorizing Card..."); Thread.Sleep(4000); Console.WriteLine("done!"); } var completeMessage = new PaymentCompleteMessage { CorrelationId = message.CorrelationId, }; Bus.Publish(completeMessage); }
public void Handle(PaymentCompleteMessage message) { Data.OrderIsPaid = true; DeliverOrder(); }