Subversion Repositories SmartDukaan

Rev

Rev 22037 | Rev 22931 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 22037 Rev 22906
Line 79... Line 79...
79
		
79
		
80
		try {
80
		try {
81
			otpResponse = otpProcessor.generateOtp(email, phone, OtpType.REGISTRATION);
81
			otpResponse = otpProcessor.generateOtp(email, phone, OtpType.REGISTRATION);
82
			final ProfitMandiResponse<?> profitMandiResponse=new ProfitMandiResponse<>(LocalDateTime.now(), ProfitMandiConstants.URL_GENERATE_OTP , HttpStatus.OK.toString(), HttpStatus.OK, ResponseStatus.SUCCESS, otpResponse);
82
			final ProfitMandiResponse<?> profitMandiResponse=new ProfitMandiResponse<>(LocalDateTime.now(), ProfitMandiConstants.URL_GENERATE_OTP , HttpStatus.OK.toString(), HttpStatus.OK, ResponseStatus.SUCCESS, otpResponse);
83
			return new ResponseEntity<>(profitMandiResponse,HttpStatus.OK);
83
			return new ResponseEntity<>(profitMandiResponse,HttpStatus.OK);
84
		} catch (Exception | ProfitMandiBusinessException e) {
84
		} catch (Exception e) {
85
			logger.error("Error while generating otp ",e);
85
			logger.error("Error while generating otp ",e);
86
			otpResponse = new OTPResponse();
86
			otpResponse = new OTPResponse();
87
			otpResponse.setMessage("Unable to generate OTP, Please try again");
87
			otpResponse.setMessage("Unable to generate OTP, Please try again");
88
			final ProfitMandiResponse<?> profitMandiResponse=new ProfitMandiResponse<>(LocalDateTime.now(), ProfitMandiConstants.URL_GENERATE_OTP , HttpStatus.INTERNAL_SERVER_ERROR.toString(), HttpStatus.INTERNAL_SERVER_ERROR, ResponseStatus.FAILURE, otpResponse);
88
			final ProfitMandiResponse<?> profitMandiResponse=new ProfitMandiResponse<>(LocalDateTime.now(), ProfitMandiConstants.URL_GENERATE_OTP , HttpStatus.INTERNAL_SERVER_ERROR.toString(), HttpStatus.INTERNAL_SERVER_ERROR, ResponseStatus.FAILURE, otpResponse);
89
			return new ResponseEntity<>(profitMandiResponse,HttpStatus.INTERNAL_SERVER_ERROR);
89
			return new ResponseEntity<>(profitMandiResponse,HttpStatus.INTERNAL_SERVER_ERROR);
Line 102... Line 102...
102
		OTPResponse otpResponse;
102
		OTPResponse otpResponse;
103
		try {
103
		try {
104
			otpResponse = otpProcessor.validateOtp(email, reference_id, otp_number);
104
			otpResponse = otpProcessor.validateOtp(email, reference_id, otp_number);
105
			final ProfitMandiResponse<?> profitMandiResponse=new ProfitMandiResponse<>(LocalDateTime.now(), ProfitMandiConstants.URL_VERIFY_OTP , HttpStatus.OK.toString(), HttpStatus.OK, ResponseStatus.SUCCESS, otpResponse);
105
			final ProfitMandiResponse<?> profitMandiResponse=new ProfitMandiResponse<>(LocalDateTime.now(), ProfitMandiConstants.URL_VERIFY_OTP , HttpStatus.OK.toString(), HttpStatus.OK, ResponseStatus.SUCCESS, otpResponse);
106
			return new ResponseEntity<>(profitMandiResponse,HttpStatus.OK);
106
			return new ResponseEntity<>(profitMandiResponse,HttpStatus.OK);
107
		} catch (Exception | ProfitMandiBusinessException e) {
107
		} catch (Exception e) {
108
			logger.error("Error while generating otp ",e);
108
			logger.error("Error while generating otp ",e);
109
			otpResponse = new OTPResponse();
109
			otpResponse = new OTPResponse();
110
			otpResponse.setMessage("Unable to verify OTP, please try again");
110
			otpResponse.setMessage("Unable to verify OTP, please try again");
111
			final ProfitMandiResponse<?> profitMandiResponse=new ProfitMandiResponse<>(LocalDateTime.now(), ProfitMandiConstants.URL_VERIFY_OTP , HttpStatus.INTERNAL_SERVER_ERROR.toString(), HttpStatus.INTERNAL_SERVER_ERROR, ResponseStatus.FAILURE, otpResponse);
111
			final ProfitMandiResponse<?> profitMandiResponse=new ProfitMandiResponse<>(LocalDateTime.now(), ProfitMandiConstants.URL_VERIFY_OTP , HttpStatus.INTERNAL_SERVER_ERROR.toString(), HttpStatus.INTERNAL_SERVER_ERROR, ResponseStatus.FAILURE, otpResponse);
112
			return new ResponseEntity<>(profitMandiResponse,HttpStatus.INTERNAL_SERVER_ERROR);
112
			return new ResponseEntity<>(profitMandiResponse,HttpStatus.INTERNAL_SERVER_ERROR);