#kaveeshamuthukuda_webhooks
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1308361616047341570
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
hi there!
you need to create a real webhook endpoint in your Stripe dashboard.
this is explaiend here: https://docs.stripe.com/webhooks#register-webhook
Hi,I already did all that .It was working all fine in local enviornment .I want to know about hosting enviornment .I already have a webhook endpoint in stripe dashboard which works fine the logs are recorded fine.but I get 400 in stripe dashboard deliveries to webhook end points
can you share an event ID (evt_xxx) that retruned a 400 error?
evt_3QMnLYRvW6Yc17tk0hw3UgBk
when I run stripe listen --skip-verify in my powershell and do the transaction my backend gets hit .But practically I cant always run stripe listen Is there a permanent solution
but why are you using stripe listen? this should be only used for testing. now you should create a real webhook endpoint in your dashbaord that directly sends event to your server.
I already have a webhook endpoint [HttpPost]
[Route("webhook")]
public async Task<IActionResult> WebhookHandler()
{
var json = await new StreamReader(HttpContext.Request.Body).ReadToEndAsync();
logger.LogInformation($"Webhook received: {json}");......... I get this issue in my dashboard Stripe exception: The expected signature was not found in the Stripe-Signature header. Make sure you're using the correct webhook secret (whsec) and confirm the incoming request came from Stripe..should I add webhook secret in front end?
did you update your webhook endpoint secret? the one used by the Stripe CLI is not the same one as the dashboard.
you can learn more about this here: https://docs.stripe.com/webhooks/signature#check-the-endpoint-secret
I think thats the issue can you please tell me where I can get the correct webhook endpoint secret for the hosted enviornment in dashboard
did you read the link I shared?
I got the secret from the dashboard thanks.EventUtility.ConstructEvent(requestBody, signature, endpointSecret); whats this approach . I have currently used this hope its fine var stripeSignature = Request.Headers["Stripe-Signature"].FirstOrDefault();
// Check if the Stripe-Signature header exists
if (string.IsNullOrEmpty(stripeSignature))
{
_logger.LogError("Stripe-Signature header is missing.");
return BadRequest("Stripe-Signature header is missing.");
}
// Construct the event using the Stripe webhook secret
var stripeEvent = EventUtility.ConstructEvent(json, stripeSignature, _webhookSecret);
you have to test your code to know if it works or not.