public IActionResult Index(PurchaseCourseViewModel model) { if (ModelState.IsValid) { // HACK: Validate tracking form var selectedCourse = _courseCtrl.GetCourseDetail(model.CourseId); if (selectedCourse == null) return View("Error"); var data = new PurchaseCourseConfirmViewModel(model) { TotalChargeAmount = selectedCourse.Price }; return View("Confirm", data); } return View(model); }
public IActionResult Confirm(PurchaseCourseConfirmViewModel model) { var canAddNewCourse = _myCourseCtrl.CanAddNewCourseCatalog(User.Identity.Name, model.CourseId); if (!canAddNewCourse) return View("Error"); // HACK: Validate tracking form // TODO: Pay with Paypal //addNewSubscriptionToUser(model.CourseId); return RedirectToAction("Finished", new { @id = "TrackingId01" }); }