/// <summary> /// /// </summary> /// <param name="stateId"></param> /// <param name="bookingId">It will be available after cancel previous progress booking i.e CancelRewardPointProgressBooking()</param> /// <param name="uniqueSessionId"></param> /// <returns></returns> public ActionResult ChargeCard(int?stateId, int?bookingId, string uniqueSessionId) { var propDetails = new PropDetailsM(); try { if (User.Identity.IsAuthenticated) { var user = BL_WebsiteUser.GetSingleRecordById(User.Identity.GetUserId <long>()); if (!user.StateId.HasValue) { user.StateId = stateId; Task.Run(() => BL_WebsiteUser.UpdateRecord(user)); } if (Session[uniqueSessionId] != null) { int bookingIdForPayament = 0; propDetails = Session[uniqueSessionId] as PropDetailsM; if (bookingId.HasValue) { bookingIdForPayament = bookingId.Value; } else { bookingIdForPayament = SaveBookingAndGetBookingId(propDetails); } string message = string.Empty; long oldBookingId = 0L; var eligibleToMakePayament = BL_WebsiteUser.CheckIfEligibleToMakePayamentUsingRewardPoint(bookingIdForPayament, user.Id, out message, out oldBookingId); if (!eligibleToMakePayament) { return(Json(new { status = true, bookingInProgress = true, oldBookingId = oldBookingId, bookingIdForPayament = bookingIdForPayament, message = message }, JsonRequestBehavior.AllowGet)); } return(Json(new { status = true, bookingIdForPayament = bookingIdForPayament }, JsonRequestBehavior.AllowGet)); } } } catch (Exception) { return(Json(new { status = false, message = "Sorry! An error occurred while processing your request, Kindly try after some time." }, JsonRequestBehavior.AllowGet)); } return(Json(new { status = false, message = "Sorry! An error occurred while processing your booking, Kindly try after some time." }, JsonRequestBehavior.AllowGet)); }