public HttpResponseMessage ValidateScratchCardScratchCard(ValidateScratchCardRequestModel requestModel)
        {
            if (requestModel == null)
            {
                return Request.CreateErrorResponse(HttpStatusCode.BadRequest, "Invalid Request");
            }

            requestModel = new ValidateScratchCardRequestModel
            {
                DeviceIdentifier = requestModel.DeviceIdentifier,
                InstallationGuid = requestModel.InstallationGuid,
                CardNumber = requestModel.CardNumber,
                ApplicationId = requestModel.ApplicationId

                //DeviceIdentifier = "Hammads",
                //InstallationGuid = Guid.Parse("90b2044c-ae0a-46f3-9260-acf3a058294a"),
                //CardNumber = "13123456789012",
                //ApplicationId = 1
            };

            if (!ModelState.IsValid)
            {
                return Request.CreateErrorResponse(HttpStatusCode.BadRequest, "Invalid Request");
            }

            ScratchCardAction scratchCardActions = new ScratchCardAction();
            ValidateScratchCardResponseModel responseModel = scratchCardActions.ValidateScratchCard(requestModel);

            if (responseModel.Error != null)
            {
                return Request.CreateResponse(HttpStatusCode.OK, responseModel);
            }

            return Request.CreateResponse(HttpStatusCode.OK, responseModel, "application/json");
        }
        public ValidateScratchCardResponseModel validatescratchcard(ValidateScratchCardRequestModel initialModel)
        {
            ValidateScratchCardResponseModel responseModel = new ValidateScratchCardResponseModel();

            ScratchCardRequestModel requestModel = new ScratchCardRequestModel
            {
                CardNumber = initialModel.CardNumber,
                InstallationGuid = initialModel.InstallationGuid,
                ApplicationId = initialModel.ApplicationId,
                DeviceIdentifier = initialModel.DeviceIdentifier
            };

            CardValidation cardValidator = new CardValidation();
            CardValidationResponseModel cardValidationResponseModel = cardValidator.ScratchCardValidation(requestModel);

            if(!cardValidationResponseModel.IsValid)
            {
                responseModel.Error = cardValidationResponseModel.Error;
                responseModel.IsValid = false;
                responseModel.IsComplimentary = false;
                return responseModel;
            }

            responseModel.Error = null;
            responseModel.IsValid = true;
            responseModel.IsComplimentary = cardValidationResponseModel.IsComplimentary;
            return responseModel;
        }
 public ValidateScratchCardResponseModel ValidateScratchCard(ValidateScratchCardRequestModel requestModel)
 {
     ScratchCardCase scratchCardCase = new ScratchCardCase();
     return scratchCardCase.validatescratchcard(requestModel);
 }