Exemplo n.º 1
0
 public IHttpActionResult ChargeUserAccount(ChargeModel model)
 {
     try
     {
         var user = AppUserManager.FindByName(model.MobileNo);
         if (user == null)
         {
             _responseProvider.SetBusinessMessage(new MessageResponse()
             {
                 Type    = ResponseTypes.Error,
                 Message = getResource.getMessage("UserNotFound")
             });
             return(Json(_responseProvider.GenerateBadRequestResponse()));
         }
         else
         {
             var res = _paymentManager.ChargeAccount(user.Id, model.ChargeValue, GetUserNameFamilyString(user));
             return(Json(res));
         }
     }
     catch (Exception e)
     {
         _logProvider.Log(Tag, "ChargeUserAccount", e.Message);
     }
     return(Json(_responseProvider.GenerateUnknownErrorResponse()));
 }