Esempio n. 1
0
        public IActionResult SendSMSVerificationCodeByRegistrationToken([FromBody] PhoneNumberRequest request, [FromHeader(Name = "RegistrationToken")] string registrationToken)
        {
            if (ModelState.IsValid)
            {
                var response = new Response();
                var data     = new RegistrationCustomerData()
                {
                    RegistrationToken = registrationToken, PhoneNumber = request.PhoneNumber
                };

                var result = _registrationManager.ContinueRegistrationProcess(data, RegistrationProcessSteps.SendSMSVerificationCodeByRegistrationToken);
                response.ResultCode  = ResultCodeFormatter.FromCustomerRegistrationProcess(result.ResultCode);
                response.Description = result.Description;

                return(ResponseExtensions.ToHttpResponse(response));
            }
            else
            {
                return(ValidationError.GetValidationErrorResponse(ModelState));
            }
        }
Esempio n. 2
0
        public IActionResult GenerateAcbaOnline([FromBody] RegistrationCustomerData data, [FromHeader(Name = "RegistrationToken")] string registrationToken)
        {
            if (ModelState.IsValid)
            {
                var response = new Response();

                data.RegistrationToken = registrationToken;
                if (data.Password != data.RePassword)
                {
                    response.ResultCode  = ResultCodes.validationError;
                    response.Description = "Մուտքագրված գաղտնաբառերը չեն համընկնում: Մուտքագրեք ճիշտ գաղտնաբառ:";

                    return(ResponseExtensions.ToHttpResponse(response));
                }
                var result = _registrationManager.ContinueRegistrationProcess(data, RegistrationProcessSteps.GenerateAcbaOnline);
                response.ResultCode  = ResultCodeFormatter.FromCustomerRegistrationProcess(result.ResultCode);
                response.Description = result.Description;
                return(ResponseExtensions.ToHttpResponse(response));
            }
            else
            {
                return(ValidationError.GetValidationErrorResponse(ModelState));
            }
        }