public async Task <ActionResult> PayPalAccount(string emailId, bool IsLogin)
        {
            HttpResponseMessage userresponse = await WebApiReq.GetReq("/api/User/GetUserData?emailId=" + emailId, "", "", _appSettings.ApiDomain);

            if (userresponse.IsSuccessStatusCode)
            {
                string package = string.Empty;
                User   user    = await userresponse.Content.ReadAsAsync <User>();

                HttpContext.Session.SetObjectAsJson("User", user);
                if (user.AccountType == Domain.Socioboard.Enum.SBAccountType.Free)
                {
                    package = "Free";
                }
                else if (user.AccountType == Domain.Socioboard.Enum.SBAccountType.Deluxe)
                {
                    package = "Deluxe";
                }
                else if (user.AccountType == Domain.Socioboard.Enum.SBAccountType.Premium)
                {
                    package = "Premium";
                }
                else if (user.AccountType == Domain.Socioboard.Enum.SBAccountType.Topaz)
                {
                    package = "Topaz";
                }
                else if (user.AccountType == Domain.Socioboard.Enum.SBAccountType.Platinum)
                {
                    package = "Platinum";
                }
                else if (user.AccountType == Domain.Socioboard.Enum.SBAccountType.Gold)
                {
                    package = "Gold";
                }
                else if (user.AccountType == Domain.Socioboard.Enum.SBAccountType.Ruby)
                {
                    package = "Ruby";
                }
                else if (user.AccountType == Domain.Socioboard.Enum.SBAccountType.Standard)
                {
                    package = "Standard";
                }
                List <KeyValuePair <string, string> > Parameter = new List <KeyValuePair <string, string> >();
                Parameter.Add(new KeyValuePair <string, string>("packagename", package));
                HttpResponseMessage respons = await WebApiReq.PostReq("/api/PaymentTransaction/GetPackage", Parameter, "", "", _appSettings.ApiDomain);

                if (respons.IsSuccessStatusCode)
                {
                    try
                    {
                        Domain.Socioboard.Models.Package _Package = await respons.Content.ReadAsAsync <Domain.Socioboard.Models.Package>();

                        HttpContext.Session.SetObjectAsJson("Package", _Package);
                        if (!IsLogin)
                        {
                            if (user.PaymentType == Domain.Socioboard.Enum.PaymentType.paypal)
                            {
                                HttpContext.Session.SetObjectAsJson("paymentsession", true);
                                string paypalUrl = Helpers.Payment.RecurringPaymentWithPayPal(_Package.amount, _Package.packagename, user.FirstName + " " + user.LastName, user.PhoneNumber, user.EmailId, "USD", _appSettings.paypalemail, _appSettings.callBackUrl, _appSettings.failUrl, _appSettings.callBackUrl, _appSettings.cancelurl, _appSettings.notifyUrl, "", _appSettings.PaypalURL);
                                return(Content(paypalUrl));
                            }
                            else
                            {
                                HttpContext.Session.SetObjectAsJson("paymentsession", true);
                                return(RedirectToAction("paymentWithPayUMoney", "Index"));
                            }
                        }
                        else
                        {
                            if (user.PaymentType == Domain.Socioboard.Enum.PaymentType.paypal)
                            {
                                HttpContext.Session.SetObjectAsJson("paymentsession", true);
                                return(Redirect(Helpers.Payment.RecurringPaymentWithPayPal(_Package.amount, _Package.packagename, user.FirstName + " " + user.LastName, user.PhoneNumber, user.EmailId, "USD", _appSettings.paypalemail, _appSettings.callBackUrl, _appSettings.failUrl, _appSettings.callBackUrl, _appSettings.cancelurl, _appSettings.notifyUrl, "", _appSettings.PaypalURL)));
                            }
                            else
                            {
                                HttpContext.Session.SetObjectAsJson("paymentsession", true);
                                return(RedirectToAction("paymentWithPayUMoney", "Index", new { contesnt = false }));
                            }
                        }
                    }
                    catch (Exception ex) { }
                }
            }
            return(Content(""));
        }
        public async Task <ActionResult> Active(string id, string Token)
        {
            string res = string.Empty;
            List <KeyValuePair <string, string> > Parameters = new List <KeyValuePair <string, string> >();

            Parameters.Add(new KeyValuePair <string, string>("Id", id));
            Parameters.Add(new KeyValuePair <string, string>("Token", Token));
            HttpResponseMessage response = await WebApiReq.PostReq("/api/User/VerifyEmail", Parameters, "", "", _appSettings.ApiDomain);

            HttpResponseMessage userresponse = await WebApiReq.GetReq("/api/User/GetUser?Id=" + id, "", "", _appSettings.ApiDomain);

            try
            {
                if (response.IsSuccessStatusCode)
                {
                    //res = await response.Content.ReadAsStringAsync();
                    //TempData["Error"] = res;
                    //return RedirectToAction("index", "index");
                    if (userresponse.IsSuccessStatusCode)
                    {
                        string package = string.Empty;
                        User   user    = await userresponse.Content.ReadAsAsync <User>();

                        if (user != null)
                        {
                            HttpContext.Session.SetObjectAsJson("User", user);
                        }
                        else
                        {
                            return(RedirectToAction("index", "index"));
                        }


                        List <KeyValuePair <string, string> > Parameter = new List <KeyValuePair <string, string> >();
                        if (user.AccountType == Domain.Socioboard.Enum.SBAccountType.Free)
                        {
                            package = "Free";
                        }
                        else if (user.AccountType == Domain.Socioboard.Enum.SBAccountType.Deluxe)
                        {
                            package = "Deluxe";
                        }
                        else if (user.AccountType == Domain.Socioboard.Enum.SBAccountType.Premium)
                        {
                            package = "Premium";
                        }
                        else if (user.AccountType == Domain.Socioboard.Enum.SBAccountType.Topaz)
                        {
                            package = "Topaz";
                        }
                        else if (user.AccountType == Domain.Socioboard.Enum.SBAccountType.Platinum)
                        {
                            package = "Platinum";
                        }
                        else if (user.AccountType == Domain.Socioboard.Enum.SBAccountType.Gold)
                        {
                            package = "Gold";
                        }
                        else if (user.AccountType == Domain.Socioboard.Enum.SBAccountType.Ruby)
                        {
                            package = "Ruby";
                        }
                        else if (user.AccountType == Domain.Socioboard.Enum.SBAccountType.Standard)
                        {
                            package = "Standard";
                        }

                        if (package != "Free")
                        {
                            Parameter.Add(new KeyValuePair <string, string>("packagename", package));
                            HttpResponseMessage respons = await WebApiReq.PostReq("/api/PaymentTransaction/GetPackage", Parameter, "", "", _appSettings.ApiDomain);

                            if (respons.IsSuccessStatusCode)
                            {
                                try
                                {
                                    if ((user.PayPalAccountStatus == Domain.Socioboard.Enum.PayPalAccountStatus.notadded || user.PayPalAccountStatus == Domain.Socioboard.Enum.PayPalAccountStatus.inprogress) && (user.AccountType != Domain.Socioboard.Enum.SBAccountType.Free))
                                    {
                                        Domain.Socioboard.Models.Package _Package = await respons.Content.ReadAsAsync <Domain.Socioboard.Models.Package>();

                                        HttpContext.Session.SetObjectAsJson("Package", _Package);
                                        if (user.PaymentType == Domain.Socioboard.Enum.PaymentType.paypal)
                                        {
                                            HttpContext.Session.SetObjectAsJson("paymentsession", true);
                                            return(Redirect(Helpers.Payment.RecurringPaymentWithPayPal(_Package.amount, _Package.packagename, user.FirstName + " " + user.LastName, user.PhoneNumber, user.EmailId, "USD", _appSettings.paypalemail, _appSettings.callBackUrl, _appSettings.failUrl, _appSettings.callBackUrl, _appSettings.cancelurl, _appSettings.notifyUrl, "", _appSettings.PaypalURL)));
                                        }
                                        else
                                        {
                                            HttpContext.Session.SetObjectAsJson("paymentsession", true);
                                            return(RedirectToAction("paymentWithPayUMoney", "Index", new { contesnt = false }));
                                        }
                                    }
                                    else
                                    {
                                        return(RedirectToAction("Index", "Home"));
                                    }
                                }
                                catch (Exception ex) { }
                            }
                        }
                        else
                        {
                            List <KeyValuePair <string, string> > _Parameters = new List <KeyValuePair <string, string> >();
                            _Parameters.Add(new KeyValuePair <string, string>("userId", user.Id.ToString()));
                            HttpResponseMessage _response = await WebApiReq.PostReq("/api/User/UpdateFreeUser", _Parameters, "", "", _appSettings.ApiDomain);

                            if (response.IsSuccessStatusCode)
                            {
                                try
                                {
                                    Domain.Socioboard.Models.User _user = await _response.Content.ReadAsAsync <Domain.Socioboard.Models.User>();

                                    HttpContext.Session.SetObjectAsJson("User", _user);
                                    return(RedirectToAction("Index", "Home"));
                                }
                                catch { }
                            }
                        }
                        return(RedirectToAction("index", "index"));
                    }
                }
                else
                {
                    TempData["Error"] = "Error while hiting api";
                    return(RedirectToAction("index", "index"));
                }
                return(RedirectToAction("index", "index"));
            }
            catch (Exception ex)
            {
                return(RedirectToAction("index", "index"));
            }
        }