class PisCommonPaymentServiceInternalEncrypted implements PisCommonPaymentServiceEncrypted {

    @Override
    @Transactional
    public CmsResponse<Boolean> updateMultilevelSca(String encryptedPaymentId, boolean multilevelScaRequired) {
        Optional<String> decryptIdOptional = securityDataService.decryptId(encryptedPaymentId);

        if (decryptIdOptional.isEmpty()) {
            log.info("Encrypted Payment ID: [{}]. Update payment multilevel SCA failed, couldn't decrypt consent id",
                     encryptedPaymentId);
            return CmsResponse.<Boolean>builder()
                       .error(TECHNICAL_ERROR)
                       .build();
        }

        return pisCommonPaymentService.updateMultilevelSca(decryptIdOptional.get(), multilevelScaRequired);
    }

}