public JsonResult MoneyIn(MoneyInModel amountData) { var result = new JSONResult(); try { if (amountData.IsValidAmount()) { var newOrder = new OrderTopBalanceModel() { OrderId = Guid.NewGuid().ToString(), UserId = AuthWrapper.GetUserIdByLogin(User.Identity.Name), Amount = amountData.Amount, OrderDate = DateTime.Now, Status = StatusOrder.InProgress }; DataWrapper.AddNewOrderTopBalance(newOrder); var d = FreeKassa.GetUrlCash(newOrder); result.SetIsSuccess(FreeKassa.GetUrlCash(newOrder)); } else { result.SetNotSuccess(ErrorMessages.IncorrectAmount); } } catch (Exception ex) { result.SetNotSuccess(ErrorMessages.UnknownError); logger.Error("Method MoneyIn: ", ex); } return(Json(result, JsonRequestBehavior.AllowGet)); }
public static bool IsValidAmount(this MoneyInModel amountData) { return(IsValidAmount(amountData.Amount)); }