class PisCommonPaymentServiceInternal implements PisCommonPaymentService {

    @Override
    @Transactional
    public CmsResponse<Boolean> updateMultilevelSca(String paymentId, boolean multilevelScaRequired) {
        Optional<PisCommonPaymentData> pisCommonPaymentDataOptional = pisCommonPaymentDataRepository.findByPaymentId(paymentId);
        if (pisCommonPaymentDataOptional.isEmpty()) {
            log.info("Payment ID: [{}]. Update multilevel SCA required status failed, because payment is not found",
                     paymentId);
            return CmsResponse.<Boolean>builder()
                       .payload(false)
                       .build();
        }
        PisCommonPaymentData payment = pisCommonPaymentDataOptional.get();
        payment.setMultilevelScaRequired(multilevelScaRequired);

        return CmsResponse.<Boolean>builder()
                   .payload(true)
                   .build();
    }

}