Exemplo n.º 1
0
        //public TopUpDto GenarateTopup(double money, string email)
        //{

        //	TopUpDto result = marchantService.GenarateTopup(money, email);
        //	return result;
        //	//throw new NotImplementedException();
        //}

        public List <Transactions> History(string email)
        {
            var result = marchantService.History(email);

            return(result);
            //throw new NotImplementedException();
        }
        public IActionResult History([FromBody] string email)
        {
            string error = "";

            if (string.IsNullOrEmpty(email))
            {
                error = " Email is null";
                return(BadRequest(new { message = error }));
            }
            if (!((validateMethods.CheckRegEx_UserName(email)) && (email.Length > validateMethods.LengthEmail) && (email.Length < 50)))
            {
                error = " Email is Invalid!";
                return(BadRequest(new { message = error }));
            }


            //Call Api Check email and Password

            if (error == "")
            {
                try
                {
                    var user = _marchantService.History(email);
                    if (user == null)
                    {
                        return(BadRequest(new { message = "Not Found" }));
                    }
                    return(Ok(user));
                }
                catch (Exception ex)
                {
                    error = ex.Message;
                }
                return(BadRequest(new { message = error }));
            }
            else
            {
                return(BadRequest(new { message = error }));
            }
        }