//Pass Order and Buyer to 2Checkout
        public ActionResult Checkout()
        {
            //Get Timestamp
            DateTime date = DateTime.Now;
            String time = date.ToString("yyyyMMdd-HHmmss");

            //Create Pending Order
            Order order = new Order();
            order.OrderNumber = "";
            order.CustomerName = "";
            order.Total = "";
            order.DatePlaced = time;
            db.Orders.Add(order);
            db.SaveChanges();

            //Pass to 2Checkout
            var dictionary = new Dictionary<string, string>();
            dictionary.Add("sid", "1817037");
            dictionary.Add("mode", "2CO");
            dictionary.Add("li_0_type", "Product");
            dictionary.Add("li_0_name", "Example Product");
            dictionary.Add("li_0_price", "1.00");
            dictionary.Add("merchant_order_id", order.ID.ToString());
            String PaymentLink = TwocheckoutCharge.Link(dictionary);
            Response.Redirect(PaymentLink);
            return View();
        }
 public ActionResult Edit(Order order)
 {
     if (ModelState.IsValid)
     {
         db.Entry(order).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(order);
 }
        public ActionResult Create(Order order)
        {
            if (ModelState.IsValid)
            {
                db.Orders.Add(order);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(order);
        }