static void Main(string[] args) { var payment = new CardPaymentRequestMessage { Amount = 99.00m, CardHolderName = "Sample Card Holder", CardNumber = "1234589652369", ExpiryDate = "12/12" }; using (var bus = RabbitHutch.CreateBus("host=localhost")) { Console.WriteLine("publishing messages with request and response"); Console.WriteLine(); var response = bus.Request <CardPaymentRequestMessage, CardPaymentResponseMessage>(payment); Console.WriteLine(response.AuthCode); Console.WriteLine("response received"); Console.ReadLine(); } }
static void Main(string[] args) { var payment = new CardPaymentRequestMessage { CardNumber = "1234123412341234", CardHolderName = "Mr F Bloggs", ExpiryDate = "12/12", Amount = 99.00m }; using (var bus = RabbitHutch.CreateBus("host=localhost")) { Console.WriteLine("Publishing messages with request and response."); Console.WriteLine(); var response = bus.Request <CardPaymentRequestMessage, CardPaymentResponseMessage>(payment); Console.WriteLine(response.AuthCode); Console.WriteLine("Response received."); } }
private static void HandleCardPaymentMessage(CardPaymentRequestMessage message) { Console.WriteLine(message); }