public ActionResult CreditOption(bool isModal, string creditCard) { checkoutProcess checkoutItem = (checkoutProcess)Session["checkoutProcess"]; checkoutShared cs = new checkoutShared(db); cardOption helperPage = new cardOption(); // Product Price var productPriceItem = cs.getProductPrice(checkoutItem.cartItem, langId, langCode, mainPath, false); if (!productPriceItem.Item1) { // Redirect Error #region Error if (isModal) { string redirectPage = getSiteNameWithoutSlash(Request) + returnBasketMainPageRelativeUrl(null); return Json(new { redirectPage = redirectPage }, JsonRequestBehavior.AllowGet); } else { return returnBasketMainPage(null); } #endregion } var productPrice = productPriceItem.Item2; // Cargo Price var cargoPrice = cs.getCargoPriceByCargoId(checkoutItem.cargoId, productPrice, langId); if (cargoPrice < 0) { // Error On Cargo #region Error { if (isModal) { return Json(new { redirectPage = redirectToStepFullSiteName(checkoutStep.cargo, checkoutItem) }, JsonRequestBehavior.AllowGet); } else { return returnBasketMainPage(null); } } #endregion } var cargoAndProductPrice = productPrice + cargoPrice; // get Option List if (cs.isCreditCardValid(creditCard)) { helperPage.optionList = cs.getCardOptionList(langId, cargoAndProductPrice, creditCard, HelperSite.Pos.posType.standart, System.Globalization.CultureInfo.CreateSpecificCulture("en-US"), "TL"); if (helperPage.optionList == null) { errorSend(new Exception("mainPosNull geliyor"), "Pos atanmamış"); helperPage.isErrorExist = true; } } helperPage.creditOptionId = checkoutItem.cardInfo.cardOption.creditOptionId; if (isModal) { string html = RenderRazorViewToString("CreditOption", helperPage); return Json(new { html = html }, JsonRequestBehavior.AllowGet); } else { return View(helperPage); } }