Ejemplo n.º 1
0
        public ActionResult Create(Order order)
        {
            try
            {
                bool result = service.ChargeCreditCart(order.CreditCard, order.Price);

                if (result == false)
                {
                    ModelState.AddModelError("CreditCard", "Invalid Credit Card");
                    return(View(order));
                }

                return(RedirectToAction("OrderComplete"));
            }
            catch
            {
                return(View(order));
            }
        }