| | |
| | | String account = getCustomerAccount(registDTO); |
| | | |
| | | OtpTmp otpTmp = otpTmpService.findByAccountAndIndexKey(account, registDTO.getIndexKey()); |
| | | if(otpTmp.getStatus() == OtpTmpStatusEnum.VERRIFIED) { |
| | | Customer customer = customerDTOMapper.toCustomer(registDTO); |
| | | customer.setDataFrom(DataFromEnum.PAM); |
| | | save(customer); |
| | | return customer; |
| | | }else { |
| | | throw new IllegalArgumentException("Invalid indexKey state error. IndexKey: " |
| | | + registDTO.getIndexKey() |
| | | + " => status: " + otpTmp.getStatus()); |
| | | } |
| | | |
| | | if(otpTmp!=null) { |
| | | if(otpTmp.getStatus() == OtpTmpStatusEnum.VERRIFIED) { |
| | | Customer customer = customerDTOMapper.toCustomer(registDTO); |
| | | customer.setDataFrom(DataFromEnum.PAM); |
| | | save(customer); |
| | | return customer; |
| | | }else { |
| | | throw new IllegalArgumentException("Invalid indexKey state error. IndexKey: " |
| | | + registDTO.getIndexKey() |
| | | + " => status: " + otpTmp.getStatus()); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | } |