public ActionResult Index(PaymentModel model)
        {
            if (model == null)
            {
                throw new ArgumentNullException("model");
            }
            if (model.claimId == 0)
            {
                throw new ArgumentException("claimid");
            }

            PaymentContext context = new PaymentContext {
                Reservation = BookingProvider.GetReservationState(UrlLanguage.CurrentLanguage, model.claimId),
                PaymentModes = BookingProvider.GetPaymentModes(UrlLanguage.CurrentLanguage, model.claimId)
            };
            return base.View(context);
        }
        public ActionResult Index(int? claim)
        {
            ReservationState state = null;

            if (claim.HasValue)
                state = BookingProvider.GetReservationState(UrlLanguage.CurrentLanguage, claim.Value);

            #region ПРОВЕРКА ПРАВ ПОЛЬЗОВАТЕЛЯ НА ПРОСМОТР ЗАКАЗА
            //если есть в параметрах телефон, проверяем его
            if (!string.IsNullOrEmpty(Request.Params["phone"]))
            {
                try
                {
                    //проверяем правильность телефона, добавляем в список разрешенных
                    if (ClearPhoneFromGarbege(Request.Params["phone"]) == ClearPhoneFromGarbege(state.customer.phone))
                    {

                        if (System.Web.HttpContext.Current.Session["allowed_claims"] == null)
                            System.Web.HttpContext.Current.Session["allowed_claims"] = new List<int>();

                        (System.Web.HttpContext.Current.Session["allowed_claims"] as List<int>).Add(claim.Value);

                    }
                    else
                        state = BookingProvider.GetReservationState(UrlLanguage.CurrentLanguage, 0);
                }
                catch (Exception)
                {
                    state = BookingProvider.GetReservationState(UrlLanguage.CurrentLanguage, 0);
                }
            }
            else //если нет, проверяем есть ли в сессии разрешение на заявку
            {
                try
                {
                    if ((claim.HasValue)
                       && ((System.Web.HttpContext.Current.Session["allowed_claims"] == null)
                         || (!(System.Web.HttpContext.Current.Session["allowed_claims"] as List<int>).Contains(claim.Value))))
                        state = BookingProvider.GetReservationState(UrlLanguage.CurrentLanguage, 0);
                }
                catch (NullReferenceException)
                {
                    state = BookingProvider.GetReservationState(UrlLanguage.CurrentLanguage, 0);
                }
            }
            #endregion

            PaymentContext context = new PaymentContext();
            if (claim.HasValue)
            {
                context.Reservation = state;
                context.PaymentModes = BookingProvider.GetPaymentModes(UrlLanguage.CurrentLanguage, claim.Value);
            }

            if (!string.IsNullOrEmpty( Request.Params["paymentMethod"] ))
            {
               return ProcessingPrivate(new ProcessingModel() {
                   claimId = claim.Value,
                   paymentId = Request.Params["paymentMethod"]
               });
            }

            return base.View(context);
        }
        public ActionResult Index(int? claim)
        {
            ReservationState state = null;

            if (claim.HasValue)
                state = BookingProvider.GetReservationState(UrlLanguage.CurrentLanguage, claim.Value);

            #region ПРОВЕРКА ПРАВ ПОЛЬЗОВАТЕЛЯ НА ПРОСМОТР ЗАКАЗА
            //если есть в параметрах телефон, проверяем его
            if (!string.IsNullOrEmpty(Request.Params["phone"]))
            {
                try
                {
                    //проверяем правильность телефона, добавляем в список разрешенных
                    if (ClearPhoneFromGarbege(Request.Params["phone"]) == ClearPhoneFromGarbege(state.customer.phone))
                    {

                        if (System.Web.HttpContext.Current.Session["allowed_claims"] == null)
                            System.Web.HttpContext.Current.Session["allowed_claims"] = new List<int>();

                        (System.Web.HttpContext.Current.Session["allowed_claims"] as List<int>).Add(claim.Value);

                    }
                    else
                        state = BookingProvider.GetReservationState(UrlLanguage.CurrentLanguage, 0);
                }
                catch (Exception)
                {
                    state = BookingProvider.GetReservationState(UrlLanguage.CurrentLanguage, 0);
                }
            }
            else //если нет, проверяем есть ли в сессии разрешение на заявку
            {
                try
                {
                    if ((claim.HasValue)
                       && ((System.Web.HttpContext.Current.Session["allowed_claims"] == null)
                         || (!(System.Web.HttpContext.Current.Session["allowed_claims"] as List<int>).Contains(claim.Value))))
                        state = BookingProvider.GetReservationState(UrlLanguage.CurrentLanguage, 0);
                }
                catch (NullReferenceException)
                {
                    state = BookingProvider.GetReservationState(UrlLanguage.CurrentLanguage, 0);
                }
            }
            #endregion
            var paymentModes = BookingProvider.GetPaymentModes(UrlLanguage.CurrentLanguage, claim.Value);

            paymentModes = BookingController.ApplyPaymentComissions(paymentModes, state.price);

            var targetCurr = "EUR";

            if (Session["currency"] != null)
                targetCurr = Session["currency"].ToString();

            if (targetCurr != state.price.currency)
            {
                var excontrol = new GuestService.Controllers.Api.ExcursionController();

                state.price = excontrol.ConvertPrice(state.price, targetCurr);

                for (int i = 0; i < state.orders.Count; i++)
                    state.orders[i].price = excontrol.ConvertPrice(state.orders[i].price, targetCurr);
            }

            PaymentContext context = new PaymentContext();

            if (claim.HasValue)
            {
                context.Reservation = state;
                context.PaymentModes = paymentModes;
            }

            if (!string.IsNullOrEmpty( Request.Params["paymentMethod"] ))
            {
               return ProcessingPrivate(new ProcessingModel() {
                   claimId = claim.Value,
                   paymentId = Request.Params["paymentMethod"]
               });
            }

            context.PaymentModes = BookingController.FilterModes(context.PaymentModes, targetCurr);

            return base.View(context);
        }