#Sargis

1 messages · Page 1 of 1 (latest)

strange valleyBOT
oblique marsh
#

Can you share the code where you read the event and de-serialise it?

fleet magnet
#

sure

#
        String payload = null;
        try {
            payload = request.getReader().lines().collect(Collectors.joining(System.lineSeparator()));
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        Event event = null;

        try {
            event = GSON.fromJson(payload, Event.class);
        } catch (JsonSyntaxException e) {
            System.out.println();
        }

        EventDataObjectDeserializer dataObjectDeserializer = event.getDataObjectDeserializer();
        StripeObject stripeObject = dataObjectDeserializer.getObject().get();
    }```
#

I used ngrok to receive web hook calls in my local

oblique marsh
#

Can you try logging payload? Is it null?

fleet magnet
#

no its not

#

event = GSON.fromJson(payload, Event.class);
after this i got event parsed correctly

oblique marsh
#

Stripe uses custom GSON builder that's different from the default one provided by GSON directly

strange valleyBOT
fleet magnet
cobalt gazelle
#

👋 taking over for my colleague. Let me catch up.

#

what is the error you got?

fleet magnet
#

this is the msg "No signatures found matching the expected signature for payload"

cobalt gazelle
#

are you using Stripe-CLI?

fleet magnet
#

nope, i got ngrok

#

forwarding web hook calls to my local

#

is it related ?

cobalt gazelle
#

what is the ID of your webhook endpoint?

fleet magnet
#

"we_1Ml8cjJlhhiU66MPtsqSD2dY"

cobalt gazelle
#

are you using the correct webhook endpoint secret?

strange valleyBOT