Beispiel #1
0
        public ActionResult CompleteFlow()
        {
            var baseUrl = string.Format("{0}://{1}{2}", Request.Url.Scheme, Request.Url.Authority, Url.Content("~"));

            if (baseUrl.Contains("https://"))
            {
                baseUrl = baseUrl.Replace("https://", "");
            }

            var hostUrl    = baseUrl + "/CCSubmitTest/ToLander/?";
            var refererUrl = baseUrl + "/CCSubmitTest/CompleteFlow/?lp=l7&aid=&dbg=testFlow&s=test&c=22&lxid=-1";

            var prelanderParams = new ControllerRedirectModel()
            {
                //Email = "*****@*****.**",
                host = hostUrl,
                //Msisdn = "000 000 000",
                type      = "lander",
                prelander = "lander",
                referrer  = refererUrl,
                // 'request' - query params from referer
                request = "lp=l7&dbg=true&s=test&c=22&lxid=-1"
            };

            //var controller = DependencyResolver.Current.GetService<CCSubmitApiController>();
            //controller.ControllerContext = new ControllerContext(this.Request.RequestContext, controller);

            //return RedirectToAction("Index", "CCSubmitApi");
            return(RedirectToAction("Redirection", "CCSubmitApi", prelanderParams));
        }
Beispiel #2
0
        public ActionResult ToLander(ControllerRedirectModel redirectModel)
        {
            //return Redirect("http:google.com");

            var requestParams = "";
            var type          = "type=" + redirectModel.type;
            var prelander     = "&prelander=" + redirectModel.prelander;


            requestParams += type;
            requestParams += prelander;

            var landerUrl = "http://dusan.landing/sports/s10-giveaway/?";

            return(Redirect(landerUrl + requestParams));
        }
 public static ActionModel ConvertFromRedirectInput(ControllerRedirectModel inputModel)
 {
     return(new ActionModel()
     {
         Msisdn = inputModel.msisdn,
         Email = inputModel.email,
         prelander = inputModel.prelander,
         PrelanderType = inputModel.type,
         device_mf = inputModel.device_mf,
         device_model = inputModel.device_model,
         device_os = inputModel.device_os,
         carrier = inputModel.carrier,
         isp = inputModel.isp,
         countryCode = inputModel.countryCode,
         ipAddress = inputModel.ipAddress,
         host = inputModel.host,
         request = inputModel.request,
         referrer = inputModel.referrer
     });
 }
Beispiel #4
0
        // SUMMARY: Initial redirection from prelander
        public ActionResult Redirection(ControllerRedirectModel input)
        {
            if (string.IsNullOrEmpty(input.host) || string.IsNullOrEmpty(input.request))
            {
                return(this.Content("error"));
            }
            string         redirect = "https://" + input.host + input.request;
            CCSubmitDirect db       = CCSubmitDirect.Instance;

            int?aid = ActionManager.ExecuteAction(new ActionModel()
            {
                Database = db,
                ActionID = -1,
                Event    = ActionModelEvent.Default,

                Msisdn        = input.msisdn,
                Email         = input.email,
                prelander     = input.prelander,
                PrelanderType = input.type,
                device_mf     = input.device_mf,
                device_model  = input.device_model,
                device_os     = input.device_os,
                carrier       = input.carrier,
                isp           = input.isp,
                countryCode   = input.countryCode,
                ipAddress     = input.ipAddress,
                host          = input.host,
                request       = input.request,
                referrer      = input.referrer
            });

            if (!aid.HasValue)
            {
                return(this.Result(false, "error", null));
            }


            db.Transactional.Run();
            return(this.Redirect(redirect + "&aid=" + aid.Value));
        }