Exemplo n.º 1
0
        public async Task <ActionResult> GenerateOtp([FromBody] OtpGenerationRequest request)
        {
            var otpService  = otpSenderFactory.ServiceFor(request?.Communication?.Value);
            var generateOtp = await otpService.GenerateOtp(request);

            return(ResultFrom(generateOtp));
        }
Exemplo n.º 2
0
        public async Task <Response> GenerateOtp(OtpGenerationRequest otpGenerationRequest)
        {
            var otp             = otpGenerator.GenerateOtp();
            var generateMessage = GenerateMessage(otpGenerationRequest.GenerationDetail, otp);

            var sendOtp = await smsClient.Send(otpGenerationRequest.Communication.Value, generateMessage, otpGenerationRequest.GenerationDetail.GetTemplateID());

            if (sendOtp.ResponseType == ResponseType.Success)
            {
                return(await otpRepository.Save(otp, otpGenerationRequest.SessionId));
            }

            return(sendOtp);
        }
Exemplo n.º 3
0
 public async Task <Response> GenerateOtp(OtpGenerationRequest otpGenerationRequest)
 {
     return(await otpRepository.Save("666666", otpGenerationRequest.SessionId));
 }