
public void attachOurServerWebhookToEfiPayToReceivePaymentNotifications(String webhookUrl, String pixPaymentKey) {
HttpHeaders headers = new HttpHeaders();
String accessToken = authenticate().getAccessToken();
headers.setBearerAuth(accessToken);
headers.set("x-skip-mtls-checking", "true");
Map body = new HashMap();
body.put("webhookUrl", webhookUrl);
try {
Map response = restTemplate.exchange(URL + "/v2/webhook/" + pixPaymentKey, HttpMethod.PUT,
new HttpEntity<>(body, headers), new ParameterizedTypeReference>() {
}).getBody();
LOGGER.info(response.toString());
} catch (Exception e) {
LOGGER.error(e.getMessage());
}
}