#lamikam
1 messages · Page 1 of 1 (latest)
Hello 👋
Can you share the code you're using for the webhook handler?
Also, do you have any middleware that parses the request body to another format?
You might see this error if you either use incorrect webhook endpoint secret or if the request body (event payload) has been modified in some ways
Thanks. This is in java code. No changes to the payload that comes in
String payload = request.getReader().lines().collect(Collectors.joining(System.lineSeparator()));
String sigHeader = request.getHeader("Stripe-Signature");
String endpointSecret = "whsec_
Event event = null;
try {
event = Webhook.constructEvent(payload, sigHeader, endpointSecret);
System.out.println(event.toJson());
} catch (Exception e) {
LOGGER.logRawNow("Error on token servlet redirect", e, HIFLogMarker.LOGLEVEL.ERROR);
}
Can you edit your message to remove endpoint secret?
Have you had a chance to look at these github issues?
https://github.com/stripe/stripe-java/issues/1151
https://github.com/stripe/stripe-java/issues/1051
I will take a look. thanks!