class UpdatePaymentAfterSpiServiceRemote implements UpdatePaymentAfterSpiServiceEncrypted {

    @Override
    public CmsResponse<Boolean> updatePaymentCancellationTppRedirectUri(@NotNull String encryptedPaymentId, @NotNull TppRedirectUri tppRedirectUri) {
        try {
            MultiValueMap<String, String> headers = new LinkedMultiValueMap<>();
            headers.add("tpp-redirect-uri", StringUtils.defaultIfBlank(tppRedirectUri.getUri(), ""));
            headers.add("tpp-nok-redirect-uri", StringUtils.defaultIfBlank(tppRedirectUri.getNokUri(), ""));
            consentRestTemplate.exchange(pisPaymentRemoteUrls.updatePaymentCancellationRedirectURIs(), HttpMethod.PUT, new HttpEntity<>(headers), Void.class, encryptedPaymentId);
            return CmsResponse.<Boolean>builder()
                       .payload(true)
                       .build();
        } catch (CmsRestException e) {
            log.error(PAYMENT_NOT_FOUND_MESSAGE, encryptedPaymentId);
        }

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

}