class PisCommonPaymentServiceInternalEncrypted implements PisCommonPaymentServiceEncrypted {

    @Override
    public CmsResponse<String> getDecryptedId(String encryptedId) {
        Optional<String> decryptIdOptional = securityDataService.decryptId(encryptedId);

        if (decryptIdOptional.isEmpty()) {
            log.info("Encrypted Payment ID: [{}]. Couldn't decrypt consent id", encryptedId);
            return CmsResponse.<String>builder()
                       .error(TECHNICAL_ERROR)
                       .build();
        }
        return CmsResponse.<String>builder()
                   .payload(decryptIdOptional.get())
                   .build();
    }

}