public Response<string> SavePaymentDetails(StripePaymentModel objReq) { Response<string> response = new Response<string>(); List<string> objResp = new List<string>(); try { StripeMethods obj = new StripeMethods(); if (CheckRequestIsvalidornot(this.Request)) { if (ModelState.IsValid) { if (obj.SavePaymentDetails(objReq) == 1) response.Create(true, "Payment details saved successfully", Messages.AppVersion, objResp); else if (obj.SavePaymentDetails(objReq) == 3) response.Create(true, "Sorry Request time is expired", Messages.AppVersion, objResp); else if (obj.SavePaymentDetails(objReq) == 2) response.Create(true, "Already Paid", Messages.AppVersion, objResp); else response.Create(false, Messages.FormatMessage(Messages.InvalidReq), Messages.AppVersion, objResp); } else response.Create(false, ModelState.Values.FirstOrDefault().Errors.FirstOrDefault().ErrorMessage, Messages.AppVersion, objResp); } else response.Create(false, Messages.FormatMessage(Messages.InvalidReq), Messages.AppVersion, objResp); } catch (Exception ex) { object session = new JavaScriptSerializer().Serialize(objReq); LogManager.Error("Error occured while Processing Webservice request :{0}", ex, session, ex.Message); response.Create(false, Messages.FormatMessage(Messages.ErrorOccure), Messages.AppVersion, objResp); } return response; }
public Response<StripeModel> GetStripeInfo(Entity objReq) { Response<StripeModel> response = new Response<StripeModel>(); List<StripeModel> objResp = new List<StripeModel>(); try { StripeMethods obj = new StripeMethods(); if (CheckRequestIsvalidornot(this.Request)) { if (ModelState.IsValid) { objResp.Add(obj.GetStripeInfo(objReq)); if (objResp != null) response.Create(true, "Stripe details", Messages.AppVersion, objResp); else response.Create(false, Messages.FormatMessage(Messages.InvalidReq), Messages.AppVersion, objResp); } else response.Create(false, ModelState.Values.FirstOrDefault().Errors.FirstOrDefault().ErrorMessage, Messages.AppVersion, objResp); } else response.Create(false, Messages.FormatMessage(Messages.InvalidReq), Messages.AppVersion, objResp); } catch (Exception ex) { object session = new JavaScriptSerializer().Serialize(objReq); LogManager.Error("Error occured while Processing Webservice request :{0}", ex, session, ex.Message); response.Create(false, Messages.FormatMessage(Messages.ErrorOccure), Messages.AppVersion, objResp); } return response; }