//public ActionResult LoadEwalletPartial() //{ // User _User = (User)Session["User"]; // Api.PaymentTransaction.PaymentTransaction ApiPaymentTransaction = new Api.PaymentTransaction.PaymentTransaction(); // Api.Affiliates.Affiliates ApiAffiliates = new Api.Affiliates.Affiliates(); // List<Domain.Socioboard.Domain.PaymentTransaction> lsttransactions=(List<Domain.Socioboard.Domain.PaymentTransaction>)(new JavaScriptSerializer().Deserialize(ApiPaymentTransaction.GetPaymentDataByUserId(_User.Id.ToString()),typeof(List<Domain.Socioboard.Domain.PaymentTransaction>))); // List<Domain.Socioboard.Domain.Affiliates> lstAffiliates=(List<Domain.Socioboard.Domain.Affiliates>)(new JavaScriptSerializer().Deserialize(ApiAffiliates.GetAffilieteDetailbyUserIdTrans(_User.Id.ToString()),typeof(List<Domain.Socioboard.Domain.Affiliates>))); // ViewBag.lsttransactions = lsttransactions; // ViewBag.lstAffiliates = lstAffiliates; // return PartialView("_EwalletPartial",_User); //} public ActionResult RechrgeEwalletByPaypal(string amount) { string pay = string.Empty; Api.User.User ApiobjUser = new Api.User.User(); User objUser = (User)Session["User"]; Helper.Payment payme = new Payment(); Session["RechrgeAmount"] = amount; string UpgradeAccountSuccessURL = ConfigurationManager.AppSettings["RechargeEwalletSuccessURL"]; string UpgradeAccountFailedURL = ConfigurationManager.AppSettings["RechargeEwalletFailedURL"]; string UpgradeAccountpaypalemail = ConfigurationManager.AppSettings["RechargeEwalletpaypalemail"]; string userId = objUser.Id.ToString(); string UserName = objUser.UserName; string EmailId = objUser.EmailId; pay = payme.PayWithPayPal(amount, "Recharge Ewallet", UserName, "", EmailId, "USD", UpgradeAccountpaypalemail, UpgradeAccountSuccessURL, UpgradeAccountFailedURL, UpgradeAccountSuccessURL, "", "", userId); //Response.Redirect(pay); return Content(pay); }
// Edited by Antima[09/12/2014] public ActionResult PaypalAgency(string PlanType) { string pay = ""; try { Helper.Agency agency = new Agency(); Helper.Payment payme = new Payment(); agency.AgencyPlan(PlanType); string amount = agency.amount; string plantype = agency.plantype; string UserName = agency.UserName; string EmailId = agency.EmailId; string userId = agency.userId; //pay = payme.PayWithPayPal(amount, plantype, UserName, "", EmailId, "USD", ConfigurationManager.AppSettings["Downloadpaypalemail"], ConfigurationManager.AppSettings["DownloadSuccessURL"], // ConfigurationManager.AppSettings["DownloadFailedURL"], ConfigurationManager.AppSettings["DownloadSuccessURL"], ConfigurationManager.AppSettings["EnterPrisecancelurl"], ConfigurationManager.AppSettings["EnterPrisenotifyurl"], userId); pay = payme.PayWithPayPal(amount, plantype, UserName, "", EmailId, "USD", ConfigurationManager.AppSettings["Downloadpaypalemail"], ConfigurationManager.AppSettings["DownloadSuccessURL"], ConfigurationManager.AppSettings["DownloadFailedURL"], ConfigurationManager.AppSettings["DownloadSuccessURL"],"","", userId); } catch (Exception ex) { Console.WriteLine(ex.StackTrace); } return Content(pay); }
// Edited by Antima[8/11/2014] public ActionResult PaypalPage() { string pay = ""; try { Helper.Payment payme = new Payment(); string amount = "100"; string plantype = "Professional Installation"; string UserName = "******"; string EmailId = "*****@*****.**"; string DownloadSuccessURL = ConfigurationManager.AppSettings["DownloadSuccessURL"]; string DownloadFailedURL = ConfigurationManager.AppSettings["DownloadFailedURL"]; string Downloadpaypalemail = ConfigurationManager.AppSettings["Downloadpaypalemail"]; string userId = ""; pay = payme.PayWithPayPal(amount, plantype, UserName, "", EmailId, "USD", Downloadpaypalemail, DownloadSuccessURL, DownloadFailedURL, DownloadSuccessURL, "", "", userId); } catch (Exception ex) { Console.WriteLine(ex.StackTrace); } //return View(); Response.Redirect(pay); return Content(""); }
// vikash [20/11/2014] public ActionResult UpgradeAccountByPayPal(string plan, string price) { string pay = string.Empty; Api.User.User ApiobjUser = new Api.User.User(); User objUser = (User)Session["User"]; objUser = (User)(new JavaScriptSerializer().Deserialize(ApiobjUser.getUsersById(objUser.Id.ToString(), Session["access_token"].ToString()), typeof(User))); Helper.Payment payme = new Payment(); string amount = price.Replace("$", "").Trim(); Session["PaymentAmount"] = amount; Session["AccountType"] = plan; if (amount == "FREE") { amount = "0"; pay = "success"; if (DateTime.Compare(objUser.ExpiryDate, DateTime.Now) > 0) { objUser.ExpiryDate = objUser.ExpiryDate.AddDays(30); } else { objUser.ExpiryDate = DateTime.Now.AddDays(30); } string i = ApiobjUser.UpdateUserAccountInfoByUserId(objUser.Id.ToString(), "Free", objUser.ExpiryDate, objUser.PaymentStatus, Session["access_token"].ToString()); Session["Paid_User"] = "******"; } string UserName = objUser.UserName; string EmailId = objUser.EmailId; string ewallet = objUser.Ewallet; Session["Ewallet"] = ewallet; if (decimal.Parse(ewallet) > 0 && amount != "0") { if (decimal.Parse(ewallet, CultureInfo.InvariantCulture.NumberFormat) >= decimal.Parse(amount, CultureInfo.InvariantCulture.NumberFormat)) { ewallet = (decimal.Parse(ewallet, CultureInfo.InvariantCulture.NumberFormat) - decimal.Parse(amount, CultureInfo.InvariantCulture.NumberFormat)).ToString(CultureInfo.InvariantCulture.NumberFormat); Session["Ewallet"] = ewallet; //int ret = ApiobjUser.UpdatePaymentandEwalletStatusByUserId(objUser.Id.ToString(), ewallet, plan, "paid"); UpgradeAccountSuccessful(); amount = "0"; pay = "success"; } else { decimal _amount = (decimal.Parse(amount, CultureInfo.InvariantCulture.NumberFormat) - decimal.Parse(ewallet, CultureInfo.InvariantCulture.NumberFormat)); amount = _amount.ToString(CultureInfo.InvariantCulture.NumberFormat); Session["Ewallet"] = "0"; } } if (amount != "0") { string UpgradeAccountSuccessURL = ConfigurationManager.AppSettings["UpgradeAccountSuccessURL"]; string UpgradeAccountFailedURL = ConfigurationManager.AppSettings["UpgradeAccountFailedURL"]; string UpgradeAccountpaypalemail = ConfigurationManager.AppSettings["UpgradeAccountpaypalemail"]; string userId = objUser.Id.ToString(); pay = payme.PayWithPayPal(amount, plan, UserName, "", EmailId, "USD", UpgradeAccountpaypalemail, UpgradeAccountSuccessURL, UpgradeAccountFailedURL, UpgradeAccountSuccessURL, "", "", userId); } return Content(pay); }
public ActionResult PaypalUpgradePlan(string UpgradeType) { string pay = ""; string amount = ""; try { Api.User.User ApiobjUser = new Api.User.User(); User objUser = (User)Session["User"]; Helper.Payment payme = new Payment(); if (UpgradeType == "MonthlyUpgrade") { amount = "99.99"; } else { amount = "1199.88"; } Session["PaymentAmount"] = amount; Session["UpgradeType"] = UpgradeType; Session["Ewallet"] = "0"; string ewallet = objUser.Ewallet; if (float.Parse(ewallet) > 0) { if (float.Parse(ewallet) >= float.Parse(amount)) { ewallet = (float.Parse(ewallet) - float.Parse(amount)).ToString(); Session["Ewallet"] = ewallet.ToString(); //int ret = ApiobjUser.UpdatePaymentandEwalletStatusByUserId(objUser.Id.ToString(), ewallet, objUser.AccountType, "paid"); PaymentSuccessful(); amount = "0"; pay = "success"; } else { amount = (float.Parse(amount) - float.Parse(ewallet)).ToString(); } } if (amount != "0") { string AccountType = objUser.AccountType; string UserName = objUser.UserName; string EmailId = objUser.EmailId; string UpgradePlanSuccessURL = ConfigurationManager.AppSettings["UpgradePlanSuccessURL"]; string UpgradePlanFailedURL = ConfigurationManager.AppSettings["UpgradePlanFailedURL"]; string UpgradePlanpaypalemail = ConfigurationManager.AppSettings["UpgradePlanpaypalemail"]; string userId = objUser.Id.ToString(); pay = payme.PayWithPayPal(amount, AccountType, UserName, "", EmailId, "USD", UpgradePlanpaypalemail, UpgradePlanSuccessURL, UpgradePlanFailedURL, UpgradePlanSuccessURL, "", "", userId); } } catch (Exception ex) { Console.WriteLine(ex.StackTrace); } return Content(pay); }
public ActionResult RechrgeEwalletByPaypal(string amount) { if (Session["User"] != null) { string pay = string.Empty; Api.User.User ApiobjUser = new Api.User.User(); User objUser = (User)Session["User"]; objUser = (User)(new JavaScriptSerializer().Deserialize(ApiobjUser.getUsersById(objUser.Id.ToString(), Session["access_token"].ToString()), typeof(User))); Helper.Payment payme = new Payment(); Session["RechrgeAmount"] = amount; string UpgradeAccountSuccessURL = ConfigurationManager.AppSettings["RechargeEwalletSuccessURL"]; string UpgradeAccountFailedURL = ConfigurationManager.AppSettings["RechargeEwalletFailedURL"]; string UpgradeAccountpaypalemail = ConfigurationManager.AppSettings["RechargeEwalletpaypalemail"]; string userId = objUser.Id.ToString(); string UserName = objUser.UserName; string EmailId = objUser.EmailId; pay = payme.PayWithPayPal(amount, "Recharge Ewallet", UserName, "", EmailId, "USD", UpgradeAccountpaypalemail, UpgradeAccountSuccessURL, UpgradeAccountFailedURL, UpgradeAccountSuccessURL, "", "", userId); //Response.Redirect(pay); return Content(pay); } else { return RedirectToAction("Index", "Index"); } }
// vikash [20/11/2014] public ActionResult UpgradeAccountByPayPal(string plan, string price) { string pay = string.Empty; Api.User.User ApiobjUser = new Api.User.User(); User objUser = (User)Session["User"]; Helper.Payment payme = new Payment(); string amount = price.Replace("$", "").Trim(); Session["PaymentAmount"] = amount; Session["AccountType"] = plan; if (amount == "FREE") { amount = "0"; pay = "success"; } string UserName = objUser.UserName; string EmailId = objUser.EmailId; string ewallet = objUser.Ewallet; Session["Ewallet"] = ewallet; if (float.Parse(ewallet) > 0) { if (float.Parse(ewallet) >= float.Parse(amount)) { ewallet = (float.Parse(ewallet) - float.Parse(amount)).ToString(); Session["Ewallet"] = ewallet; //int ret = ApiobjUser.UpdatePaymentandEwalletStatusByUserId(objUser.Id.ToString(), ewallet, plan, "paid"); UpgradeAccountSuccessful(); amount = "0"; pay = "success"; } else { amount = (float.Parse(amount) - float.Parse(ewallet)).ToString(); Session["Ewallet"] = "0"; } } if (amount != "0") { string UpgradeAccountSuccessURL = ConfigurationManager.AppSettings["UpgradeAccountSuccessURL"]; string UpgradeAccountFailedURL = ConfigurationManager.AppSettings["UpgradeAccountFailedURL"]; string UpgradeAccountpaypalemail = ConfigurationManager.AppSettings["UpgradeAccountpaypalemail"]; string userId = objUser.Id.ToString(); pay = payme.PayWithPayPal(amount, plan, UserName, "", EmailId, "USD", UpgradeAccountpaypalemail, UpgradeAccountSuccessURL, UpgradeAccountFailedURL, UpgradeAccountSuccessURL, "", "", userId); } return Content(pay); }