#Pravin-webhook-403
1 messages ยท Page 1 of 1 (latest)
can you share the event IDs for the events that are failing?
"id": "evt_1KiN17PHpfPJEP73tee58HtT"
"id": "evt_1KiqEbPTbhE4OC3ri4W7htK7"
"id": "evt_1KiqEgPTbhE4OC3rZScvTO5U"
all above are failed
Okay thanks
Give me a few to look into it ๐
sur
with same end point below are few success
"id": "evt_1KiuPCPIMw93sdDwSKcompt2"
"id": "evt_1KirrXPHKH9fzztpD4mYdaVZ"
"id": "evt_1KirBpPTbhE4OC3rnB7zhF8s"
does your server use any middleware such as cloudflare or something similar?
no. its not
Okay. Are you performing signature verification server-side?
If so, do you see any errors in your server log by any chance?
yea. i have verified that. we dont have any signature error on my server
Interesting. Let me dig deeper
Can you share the code for your webhook handler?
public HttpStatus processStripeWebHookEvent(String sigHeader, String payload) {
logger.info("Stripe Webhook event received");
Optional<Event> webhookEvent;
try {
webhookEvent = Optional.ofNullable(Webhook.constructEvent(
payload, sigHeader, paymentServiceSecretesManager.getSecretsManager().getStripePaymentServiceWebHookKey()
));
} catch (SignatureVerificationException e) {
logger.error(e.getMessage());
throw new InvalidStripeWebhookSignature(HttpStatus.BAD_REQUEST.name(), e.getMessage());
}
if (webhookEvent.isPresent()) {
awsSQSProducer.produce(webhookEvent.get());
return HttpStatus.CREATED;
} else return HttpStatus.FORBIDDEN;
}
==========================================
above code is processing event
======================
below is webhook end point
=================
HttpStatus webHook(@RequestHeader(WEB_HOOK_SIGNATURE_HEADER) String sigHeader, @RequestBody String payload) {
logger.info("Stripe Webhook event received");
return webhookOrchestration.processStripeWebHookEvent(sigHeader, payload);
}
@worldly scarab any luck?
Not finding anything specific on our end. You'd likely need to review your network requests and add more logging to trace this as these seem to be coming form your server-side code
Seems its throwing 403 from my code itself. but now i am not sure why webhook event is coming as null or empty
any idea on this?
Umm I wouldn't say the webhook event is null or empty as the code may be throwing an exception for signature verification failure
I'd add more logging before it hits that try catch block and see if its really nullor empty
and how we are getting different signature in different events
is it possible ?
is there any way to find what what the signature for failed event
this happning only in live mode. not able to reproduce in test
NP! Good luck ๐