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"); }
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"); }
public static void SendOTP(string phoneNumber, string otp) { //string message = string.Format(OTP_MESSAGEING_TEMPLATE, otp); //SMSService.SendSMS(phoneNumber, message); SMSService.SendOTP(phoneNumber); }