Exemplo n.º 1
0
        public ActionResult TotalCodeCasinoPageTemplate()
        {
            var model = GetModel <GamePageViewModel>(CurrentPage);

            if (Request.QueryString["gameId"] != null)
            {
                var origin        = TenantHelper.GetCurrentTenantUrl(contentService, model.TenantUid);
                var gameId        = int.Parse(Request.QueryString["gameId"].ToString());
                var key           = ApiKeyCache.GetByTenantUid(model.TenantUid);
                var authorization = GetAuthorization(key);
                var games         = apiService.GetGameDataAnonymousArray(model.TenantUid, origin, authorization: authorization.AccessToken);
                var game          = games.SingleOrDefault(x => x.GameId == gameId);
                if (game != null)
                {
                    model.HasDemoMode = game.DemoEnabled;
                    model.GameUrl     = game.Url;
                }
            }
            else
            {
                model.Slider = CurrentPage.Value <IEnumerable <IPublishedElement> >("gameSlider")
                               .Select(x => new SliderItem
                {
                    Image       = x.HasValue("sliderItemImage") ? x.GetProperty("sliderItemImage").Value <IPublishedContent>().Url : string.Empty,
                    ButtonLabel = x.HasValue("sliderItemButtonLabel") ? x.GetProperty("sliderItemButtonLabel").GetValue().ToString() : string.Empty,
                    Title       = x.HasValue("sliderItemTitle") ? x.GetProperty("sliderItemTitle").GetValue().ToString() : string.Empty,
                    Subtitle    = x.HasValue("sliderItemSubtitle") ? x.GetProperty("sliderItemSubtitle").GetValue().ToString() : string.Empty,
                    Url         = x.HasValue("sliderItemUrl") ? x.GetProperty("sliderItemUrl").GetValue().ToString() : string.Empty,
                })?.ToList();
            }

            model.Category = "casino";
            return(CurrentTemplate(model));
        }
        public async Task <JsonResult> EditCustomer(string tenantUid, string title, string firstname, string lastname, string gender, string day, string month, string year, string country, string countrycode, string timezone, string odds, string language, string username, string customerGuid, string customerToken, string address1 = "", string address2 = "", string address3 = "", string town = "", string county = "", string postalcode = "", string notify = "true")
        {
            var customer = new EditCustomer
            {
                Username = username,
                Fields   = new Models.EditCustomer.EditFields
                {
                    CountryCode         = countrycode,
                    DOB                 = !string.IsNullOrEmpty(day) ? $"{year}-{month}-{day}" : string.Empty,
                    FirstName           = firstname,
                    LastName            = lastname,
                    Gender              = gender,
                    LanguageCode        = language,
                    OddsDisplay         = odds,
                    TimeZoneCode        = timezone,
                    Title               = title,
                    AddressLine1        = address1,
                    AddressLine2        = address2,
                    AddressLine3        = address3,
                    County              = county,
                    Town                = town,
                    Country             = country,
                    PostCode            = postalcode,
                    NotificationComPref = notify
                }
            };
            var origin        = TenantHelper.GetCurrentTenantUrl(contentService, tenantUid);
            var key           = ApiKeyCache.GetByTenantUid(tenantUid);
            var authorization = await new Authorization().GetAuthorizationAsync(key);

            var response = await apiService.EditCustomerAsync(customer, tenantUid, origin, customerToken);

            return(Json(response, JsonRequestBehavior.DenyGet));
        }
Exemplo n.º 3
0
        public async Task <JsonResult> VerifyMobileValidateSMS(string tenantUid, string mobile, string code, string language)
        {
            var origin        = TenantHelper.GetCurrentTenantUrl(contentService, tenantUid);
            var key           = ApiKeyCache.GetByTenantUid(tenantUid);
            var authorization = await new Authorization().GetAuthorizationAsync(key);
            var response      = await verificationService.ValidateSmsVerificationCodeAsync(tenantUid, origin, mobile, code, authorization.AccessToken);

            return(Json(response, JsonRequestBehavior.DenyGet));
        }
        public async Task <JsonResult> ForgotUsernameEmail(string tenantUid, string email, string language)
        {
            var origin        = TenantHelper.GetCurrentTenantUrl(contentService, tenantUid);
            var key           = ApiKeyCache.GetByTenantUid(tenantUid);
            var authorization = await new Authorization().GetAuthorizationAsync(key);
            var response      = await apiService.ForgotUsernameEmailAsync(tenantUid, origin, email, language, authorization.AccessToken);

            return(Json(response, JsonRequestBehavior.DenyGet));
        }
        public async Task <JsonResult> GetGameGrid(string tenantUid, string category = "", string subCategory = "", string provider = "", string keyword = "", string languageCode = "")
        {
            var origin        = TenantHelper.GetCurrentTenantUrl(contentService, tenantUid);
            var key           = ApiKeyCache.GetByTenantUid(tenantUid);
            var authorization = await new Authorization().GetAuthorizationAsync(key);
            var response      = await _gameService.GetGameDataAnonymousArrayAsync(tenantUid, origin, category, subCategory, provider, keyword, languageCode, authorization.AccessToken);

            return(Json(response, JsonRequestBehavior.DenyGet));
        }
        public async Task <JsonResult> LoginForm(string tenantUidForm, string credentialForm, string passwordForm, string rememberMe = "off")
        {
            var origin        = TenantHelper.GetCurrentTenantUrl(contentService, tenantUidForm);
            var key           = ApiKeyCache.GetByTenantUid(tenantUidForm);
            var authorization = await new Authorization().GetAuthorizationAsync(key);
            var response      = await apiService.LoginFormAsync(tenantUidForm, origin, credentialForm, passwordForm, rememberMe, authorization.AccessToken);

            return(Json(response, JsonRequestBehavior.DenyGet));
        }
        public async Task <JsonResult> ChangePasswordViaSms(string tenantUid, string username, string code, string password)
        {
            var origin        = TenantHelper.GetCurrentTenantUrl(contentService, tenantUid);
            var key           = ApiKeyCache.GetByTenantUid(tenantUid);
            var authorization = await new Authorization().GetAuthorizationAsync(key);
            var response      = await apiService.VerifyPasswordResetSmsAsync(tenantUid, origin, username, code, password, authorization.AccessToken);

            return(Json(response, JsonRequestBehavior.DenyGet));
        }
        public async Task <JsonResult> GetAccessToken(string tenantUid)
        {
            var origin        = TenantHelper.GetCurrentTenantUrl(contentService, tenantUid);
            var key           = ApiKeyCache.GetByTenantUid(tenantUid);
            var authorization = await new Authorization().GetAuthorizationAsync(key);
            var response      = authorization.AccessToken;

            return(Json(response, JsonRequestBehavior.DenyGet));
        }
        public async Task <JsonResult> GetCustomerEmail(string tenantUid, string customerGuid)
        {
            var origin        = TenantHelper.GetCurrentTenantUrl(contentService, tenantUid);
            var key           = ApiKeyCache.GetByTenantUid(tenantUid);
            var authorization = await new Authorization().GetAuthorizationAsync(key);
            var response      = apiService.GetCustomerEmail(tenantUid, origin, customerGuid, authorization.AccessToken);

            return(Json(response, JsonRequestBehavior.AllowGet));
        }
        public async Task <JsonResult> GetCustomer(string tenantUid, string username, string customerToken)
        {
            var origin        = TenantHelper.GetCurrentTenantUrl(contentService, tenantUid);
            var key           = ApiKeyCache.GetByTenantUid(tenantUid);
            var authorization = await new Authorization().GetAuthorizationAsync(key);

            var response = await apiService.GetCustomerInfoAsync(tenantUid, origin, username, customerToken);

            return(Json(response, JsonRequestBehavior.DenyGet));
        }
        public async Task <JsonResult> ForgotPasswordSendEmail(string tenantUid, string email, string username, string language, string requestUrl)
        {
            var origin          = TenantHelper.GetCurrentTenantUrl(contentService, tenantUid);
            var key             = ApiKeyCache.GetByTenantUid(tenantUid);
            var authorization   = await new Authorization().GetAuthorizationAsync(key);
            var verificationUrl = helper.GetResetPasswordVerificationUrl(tenantUid, requestUrl, username, language);
            var response        = await apiService.SendPasswordEmailAsync(tenantUid, origin, username, email, language, verificationUrl.ToString(), authorization.AccessToken);

            return(Json(response, JsonRequestBehavior.DenyGet));
        }
        public async Task <JsonResult> CreateTicketAnonymous(CreateTicketAnonymousModel ticket, string tenantUid)
        {
            var origin        = TenantHelper.GetCurrentTenantUrl(_contentService, tenantUid);
            var key           = ApiKeyCache.GetByTenantUid(tenantUid);
            var authorization = await new Authorization().GetAuthorizationAsync(key);

            var response = await _ticketService.CreateTicketAnonymous(tenantUid, authorization.AccessToken, origin, ticket);

            return(Json(response));
        }
Exemplo n.º 13
0
        public async Task <JsonResult> VerifyEmailReSendCode(string tenantUid, string id, string email, string language)
        {
            var origin          = TenantHelper.GetCurrentTenantUrl(contentService, tenantUid);
            var key             = ApiKeyCache.GetByTenantUid(tenantUid);
            var authorization   = await new Authorization().GetAuthorizationAsync(key);
            var verificationUrl = helper.GetConfirmVerificationUrl(tenantUid, origin, email, language, id);
            var response        = await verificationService.VerificationEmailAsync(tenantUid.ToString(), origin, verificationUrl, email, language, authorization.AccessToken);

            return(Json(response, JsonRequestBehavior.DenyGet));
        }
Exemplo n.º 14
0
        public async Task <JsonResult> VerifyMobileSendSMS(string tenantUid, string countryCode, string mobile, string language)
        {
            var origin        = TenantHelper.GetCurrentTenantUrl(contentService, tenantUid);
            var key           = ApiKeyCache.GetByTenantUid(tenantUid);
            var authorization = await new Authorization().GetAuthorizationAsync(key);
            var mobileNumber  = $"{countryCode}{mobile.TrimStart(new Char[] { '0' })}";
            var response      = await verificationService.VerifyMobileAsync(tenantUid.ToString(), origin, mobileNumber, language, authorization.AccessToken);

            return(Json(response, JsonRequestBehavior.DenyGet));
        }
        public async Task <JsonResult> ForgotUsernameSms(string tenantUid, string countryCode, string mobile, string language)
        {
            var origin        = TenantHelper.GetCurrentTenantUrl(contentService, tenantUid);
            var key           = ApiKeyCache.GetByTenantUid(tenantUid);
            var authorization = await new Authorization().GetAuthorizationAsync(key);
            var mobileNumber  = $"{countryCode}{mobile}";
            var response      = await apiService.ForgotUsernameSmsAsync(tenantUid, origin, mobileNumber, language, authorization.AccessToken);

            return(Json(response, JsonRequestBehavior.DenyGet));
        }
Exemplo n.º 16
0
        public async Task <JsonResult> VerifyEmailConfirm(string tenantUid, string email, string code, string verificationUrl, string language)
        {
            if (string.IsNullOrEmpty(email))
            {
                return(Json(new { response = "Conflict, email is missing" }, JsonRequestBehavior.DenyGet));
            }
            var origin        = TenantHelper.GetCurrentTenantUrl(contentService, tenantUid);
            var key           = ApiKeyCache.GetByTenantUid(tenantUid);
            var authorization = await new Authorization().GetAuthorizationAsync(key);
            var response      = await verificationService.ConfirmEmailAsync(tenantUid, origin, email, code, new Uri(verificationUrl).ToString(), authorization.AccessToken);

            return(Json(response, JsonRequestBehavior.DenyGet));
        }
        public async Task <JsonResult> EditMobileNumber(string tenantUid, string username, string customerToken, string mobile, string countryCode)
        {
            var newMobile = new EditMobileNumber
            {
                Username = LoginSession.Username,
                Mobile   = $"{countryCode}{mobile}"
            };
            var origin        = TenantHelper.GetCurrentTenantUrl(contentService, tenantUid);
            var key           = ApiKeyCache.GetByTenantUid(tenantUid);
            var authorization = await new Authorization().GetAuthorizationAsync(key);

            var response = await apiService.EditMobileAsync(newMobile, tenantUid, origin, customerToken);

            return(Json(response, JsonRequestBehavior.DenyGet));
        }
        public async Task <JsonResult> UploadAnonymous(HttpPostedFileBase file, string tenantUid)
        {
            if (file.ContentLength > 0)
            {
                var origin        = TenantHelper.GetCurrentTenantUrl(_contentService, tenantUid);
                var key           = ApiKeyCache.GetByTenantUid(tenantUid);
                var authorization = await new Authorization().GetAuthorizationAsync(key);

                var response = await _ticketFileService.UploadAnonymous(tenantUid, authorization.AccessToken, origin, file);

                return(Json(response));
            }

            return(Json(new EmptyResult()));
        }
        public async Task <JsonResult> EditPassword(string tenantUid, string username, string customerToken, string oldpassword, string newpassword)
        {
            var newPassword = new EditPassword
            {
                Username    = LoginSession.Username,
                OldPassword = oldpassword,
                NewPassword = newpassword
            };

            var origin        = TenantHelper.GetCurrentTenantUrl(contentService, tenantUid);
            var key           = ApiKeyCache.GetByTenantUid(tenantUid);
            var authorization = await new Authorization().GetAuthorizationAsync(key);

            var response = await apiService.EditPasswordAsync(newPassword, tenantUid, origin, customerToken);

            return(Json(response, JsonRequestBehavior.DenyGet));
        }
Exemplo n.º 20
0
        public async Task <JsonResult> ChangeEmail(string tenantUid, string id, string username, string email, string language)
        {
            var origin        = TenantHelper.GetCurrentTenantUrl(contentService, tenantUid);
            var key           = ApiKeyCache.GetByTenantUid(tenantUid);
            var authorization = await new Authorization().GetAuthorizationAsync(key);
            var response      = (ChangeEmailResponseContent)await verificationService.ChangeEmailAsync(tenantUid, origin, username, email, authorization.AccessToken);

            if (response.Success)
            {
                var verificationUrl      = helper.GetConfirmVerificationUrl(tenantUid, origin, email, language, id);
                var postRegisterResponse = await verificationService.VerificationEmailAsync(tenantUid.ToString(), origin, verificationUrl, email, language, authorization.AccessToken);

                postRegisterResponse.RelatedResponse = response;
                return(Json(postRegisterResponse, JsonRequestBehavior.DenyGet));
            }
            return(Json(response, JsonRequestBehavior.DenyGet));
        }
        public async Task <JsonResult> EditEmail(string tenantUid, string username, string customerToken, string email, string language)
        {
            var origin          = TenantHelper.GetCurrentTenantUrl(contentService, tenantUid);
            var verificationUrl = new Uri(new Uri(origin), helper.GetConfirmVerificationUrl(tenantUid, origin, email, language));

            var newEmail = new EditEmail
            {
                Username        = LoginSession.Username,
                Email           = email,
                VerificationUrl = verificationUrl.ToString()
            };
            var key           = ApiKeyCache.GetByTenantUid(tenantUid);
            var authorization = await new Authorization().GetAuthorizationAsync(key);

            var response = await apiService.EditEmailAsync(newEmail, tenantUid, origin, customerToken);

            return(Json(response, JsonRequestBehavior.DenyGet));
        }
        public async Task <ActionResult> TotalCodeTenantConfirmEmail(ContentModel model)
        {
            var confirmModel = GetModel <ConfirmEmailModel>(CurrentPage);

            confirmModel.BackUrl = LoginSession.LoggedIn ? model.Content.Parent.Children.FirstOrDefault(x => x.ContentType.Alias.Equals("totalCodeAccountPage")).Url : confirmModel.Root.Url;

            if (Request.QueryString.Count == 0)
            {
                return(Redirect("/"));
            }
            //string domain = System.Net.WebUtility.UrlDecode(Request.Url.ToString());
            string id = Request.QueryString["a"], code = Request.QueryString["b"].Replace(" ", "+"), email = Request.QueryString["c"];
            var    tenantUid        = model.Content.Parent.GetProperty("tenantUid").GetValue().ToString();
            var    origin           = TenantHelper.GetCurrentTenantUrl(model);
            string domain           = helper.GetConfirmVerificationUrl(tenantUid, origin, email, Umbraco.CultureDictionary.Culture.TwoLetterISOLanguageName, id, code);
            var    confirmationData = new ConfirmationData
            {
                ClientId        = id,
                Code            = code,
                Email           = email,
                VerificationUrl = new Uri(domain).ToString()
            };

            var key           = ApiKeyCache.GetByTenantUid(tenantUid);
            var authorization = await new Authorization().GetAuthorizationAsync(key);
            var response      = (ConfirmEmailResponseContent)await verificationService.ConfirmEmailAsync(tenantUid, origin, confirmationData.Email, confirmationData.Code, confirmationData.VerificationUrl, authorization.AccessToken);


            confirmationData.IsConfirmed = response.Success;

            if (!response.Success)
            {
                // TODO: remove logging
                logger.Info <ConfirmEmailController>($"Verification Url: {confirmationData.VerificationUrl}");
                logger.Info <ConfirmEmailController>(JsonConvert.SerializeObject(response));
            }

            ViewData["ConfirmationData"] = confirmationData;

            return(Index(confirmModel));
        }
        public async Task <JsonResult> EditCommunicationPreferences(string tenantUid, string username, string customerToken, string notify = "false", string notifyViaSms = "false", string notifyViaEmail = "false", string notifyViaPlatform = "false")
        {
            var notifications = new EditCommunicationPreferences
            {
                Username = username,
                CommunicationPreferences = new CommunicationPreferenceParameter[]
                {
                    new CommunicationPreferenceParameter
                    {
                        Communication = "Notification",
                        IsSelected    = bool.Parse(notify)
                    },
                    new CommunicationPreferenceParameter
                    {
                        Communication = "TextMessage",
                        IsSelected    = bool.Parse(notifyViaSms)
                    },
                    new CommunicationPreferenceParameter
                    {
                        Communication = "Email",
                        IsSelected    = bool.Parse(notifyViaEmail)
                    },
                    new CommunicationPreferenceParameter
                    {
                        Communication = "InPlatformMessage",
                        IsSelected    = bool.Parse(notifyViaPlatform)
                    }
                }
            };
            var origin        = TenantHelper.GetCurrentTenantUrl(contentService, tenantUid);
            var key           = ApiKeyCache.GetByTenantUid(tenantUid);
            var authorization = await new Authorization().GetAuthorizationAsync(key);

            var response = await apiService.EditCommunicationPreferencesAsync(notifications, tenantUid, origin, customerToken);

            return(Json(response, JsonRequestBehavior.DenyGet));
        }
Exemplo n.º 24
0
        public async Task <JsonResult> Register(string tenantUid,
                                                string email,
                                                string username,
                                                string password,
                                                string mobile,
                                                string title             = "",
                                                string firstName         = "",
                                                string lastName          = "",
                                                string gender            = "",
                                                string day               = "",
                                                string month             = "",
                                                string year              = "",
                                                string dob               = "",
                                                string address1          = "",
                                                string address2          = "",
                                                string address3          = "",
                                                string town              = "",
                                                string county            = "",
                                                string postalcode        = "",
                                                string currency          = "",
                                                string odds              = "",
                                                string language          = "",
                                                string country           = "",
                                                string timeZone          = "",
                                                string bonusCode         = "",
                                                string referrer          = "",
                                                string notify            = "",
                                                string notifyViaPlatform = "",
                                                string notifyViaEmail    = "",
                                                string notifyViaSMS      = "")
        {
            var origin        = TenantHelper.GetCurrentTenantUrl(contentService, tenantUid);
            var key           = ApiKeyCache.GetByTenantUid(tenantUid);
            var authorization = await new Authorization().GetAuthorizationAsync(key);

            if (dob == "")
            {
                if (year != "" && month != "" && day != "")
                {
                    dob = year + "-" + month + "-" + day;
                }
            }
            if (Request.Cookies.AllKeys.Contains("referrer"))
            {
                if (!String.IsNullOrEmpty(Request.Cookies.Get("referrer").Value))
                {
                    referrer = Request.Cookies.Get("referrer").Value;
                }
            }

            CustomerRegisterResponseContent response = (CustomerRegisterResponseContent)await verificationService.CustomerRegisterAsync(
                tenantUid : tenantUid.ToString(),
                origin : origin,
                email : email,
                username : username,
                password : password,
                mobile : mobile.TrimStart(new Char[] { '0' }),
                title : title,
                firstName : firstName,
                lastName : lastName,
                gender : gender,
                dob : dob,
                address1 : address1,
                address2 : address2,
                address3 : address3,
                town : town,
                county : county,
                postCode : postalcode,
                currency : currency,
                odds : odds,
                language : language,
                country : country,
                timeZone : timeZone,
                bonusCode : bonusCode,
                referrer : referrer,
                notify : notify == "on"? "true" : "false",
                notifyViaPlatform : notifyViaPlatform == "on"? "true" : "false",
                notifyViaEmail : notifyViaEmail == "on"? "true" : "false",
                notifyViaSMS : notifyViaSMS == "on"? "true" : "false",
                authorization : authorization.AccessToken);

            if (response.Success && !response.Payload.IsActive)
            {
                var verificationUrl      = helper.GetConfirmVerificationUrl(tenantUid, origin, email, language, response.Payload.Id.ToString());
                var postRegisterResponse = await verificationService.VerificationEmailAsync(tenantUid.ToString(), origin, verificationUrl, email, language, authorization.AccessToken);

                postRegisterResponse.RelatedResponse = response;
                return(Json(postRegisterResponse, JsonRequestBehavior.DenyGet));
            }
            return(Json(response, JsonRequestBehavior.DenyGet));
        }