public ActionResult Visa(FormCollection values) { var visaPayment = new VisaPayment(); TryUpdateModel(visaPayment); if (!ModelState.IsValid) return View("Index"); var orderId = values["OrderId"]; var amount = values["Amount"]; //Send to bus return RedirectToAction("Complete", new {orderId , amount}); }
public ActionResult Visa(FormCollection values) { var visaPayment = new VisaPayment(); TryUpdateModel(visaPayment); if (!ModelState.IsValid) return View("Index"); var orderId = values["OrderId"]; var amount = values["Amount"]; MvcApplication.Bus.Send<PayOrderCommand>(c => { c.Name = visaPayment.Name; c.VisaNumber = visaPayment.CreditCardNumber; c.ExpiryMonth = Int32.Parse(visaPayment.ExpiryMonth); c.ExpiryYear = Int32.Parse(visaPayment.ExpiryYear); c.AmountToPay = Decimal.Parse(amount, CultureInfo.InvariantCulture); c.OrderId = orderId; }); return RedirectToAction("Complete", new {orderId , amount}); }