示例#1
0
        public static void SendOTPForForgotPassword(ForgotPasswordResponse response, string mobileNumber, int userId, string userType)
        {
            if (response == null)
            {
                response = new ForgotPasswordResponse();
            }
            if (response.reset_password == null)
            {
                response.reset_password = new ForgotPasswordDto();
            }
            string otp = SMSService.SendOTP(mobileNumber);

            if (string.IsNullOrWhiteSpace(otp))
            {
                response.code         = 1;
                response.has_resource = 0;
                response.message      = MessagesSource.GetMessage("otp.not.sent");
                return;
            }
            if (SaveOTP(otp, userId, userType))
            {
                response.reset_password.new_password_otp_sent = 1; // state that OTP has been sent.
            }
            response.code         = 0;
            response.has_resource = 1;
            response.message      = MessagesSource.GetMessage("otp.sent");
        }
示例#2
0
        public static void ResendOTP(ResendOtpResponse response, string mobileNumber, int userId, string userType)
        {
            mobileNumber = Common.GetStandardMobileNumber(mobileNumber);
            if (response == null)
            {
                response = new ResendOtpResponse();
            }
            if (response.otp_details == null)
            {
                response.otp_details = new OTPDetailsDto();
            }
            string otp = SMSService.SendOTP(mobileNumber);

            if (SaveOTP(otp, userId, userType))
            {
                response.otp_details.send_otp = 1; // state that OTP has been sent.
            }
            response.code         = 0;
            response.has_resource = 1;
            response.message      = MessagesSource.GetMessage("otp.sent");
        }
示例#3
0
 public static void SendOTP(string phoneNumber, string otp)
 {
     //string message = string.Format(OTP_MESSAGEING_TEMPLATE, otp);
     //SMSService.SendSMS(phoneNumber, message);
     SMSService.SendOTP(phoneNumber);
 }
示例#4
0
        public static void SendPasswordMessage(string phoneNumber, string newPassword)
        {
            string message = string.Format(PASSWORD_MESSAGEING_TEMPLATE, newPassword);

            SMSService.SendSMS(phoneNumber, message);
        }