Пример #1
0
        public async Task <ResponseModel <string> > ClearPayments(string cartId)
        {
            var response = new ResponseModel <string>()
            {
                ResponseData = new List <string>(),
                Errors       = new List <string>()
            };

            if (String.IsNullOrEmpty(cartId) || String.IsNullOrWhiteSpace(cartId))
            {
                response.ResponseCode    = ReturnCodesConstant.R02;
                response.ResponseMessage = ReturnCodesConstant.R02Message;
                response.Errors.Add(ReturnCodesConstant.CARTID_IS_NULL);
                return(response);
            }

            if (await _dbRepo.ClearPayments(cartId))
            {
                response.ResponseCode    = ReturnCodesConstant.R00;
                response.ResponseMessage = ReturnCodesConstant.R00Message;
                return(response);
            }
            else
            {
                response.ResponseCode    = ReturnCodesConstant.R05;
                response.ResponseMessage = ReturnCodesConstant.R05Message;
                return(response);
            }
        }