public IActionResult ValidatePin([FromBody] ValidatePinRequest request)
        {
            if (request == null || !ModelState.IsValid)
            {
                //Bad request
                return(StatusCode(400));
            }

            try
            {
                var result = receptionManagement.ValidatePin(request.Pin);

                if (result)
                {
                    // 200 OK - Created
                    return(StatusCode(200));
                }

                // 500 ERR - Internal server error
                return(StatusCode(500));
            }
            catch
            {
                // 500 ERR - Internal server error
                return(StatusCode(500));
            }
        }
        public async Task <ValidatePinResponse> ValidatePinAsync([FromBody] ValidatePinRequest request)
        {
            var result = await _customerCredentialsService.ValidatePinAsync(request.CustomerId, request.PinCode);

            return(new ValidatePinResponse {
                Error = (PinCodeErrorCodes)result
            });
        }
Esempio n. 3
0
        public void ValidateGoodStaticPinTest()
        {
            // Arrange
            ValidatePinRequest req = new ValidatePinRequest(goodUsername, goodStaticPin);

            // Act
            BaseResponse res = secAuthSvc.Authenticate.ValidatePin(req);

            // Assert
            Assert.AreEqual(Constants.ResponseStatus.Valid, res.Status);
        }