#lamikam

1 messages · Page 1 of 1 (latest)

hollow galleonBOT
stiff matrix
#

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

surreal dagger
#

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);
        }
stiff matrix
#

Can you edit your message to remove endpoint secret?

surreal dagger
#

I will take a look. thanks!