#Sargis
1 messages · Page 1 of 1 (latest)
Can you share the code where you read the event and de-serialise it?
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
Can you try logging payload? Is it null?
no its not
event = GSON.fromJson(payload, Event.class);
after this i got event parsed correctly
Can you use ApiResource.GSON.fromJson(payload, Event.class); to to map to Event.class as described in the doc to check if that works? https://stripe.com/docs/webhooks/signatures
Stripe uses custom GSON builder that's different from the default one provided by GSON directly
using code described in doc, i got SignatureVerificationException
this is the msg "No signatures found matching the expected signature for payload"
are you using Stripe-CLI?
what is the ID of your webhook endpoint?
"we_1Ml8cjJlhhiU66MPtsqSD2dY"
are you using the correct webhook endpoint secret?