#stephy
1 messages · Page 1 of 1 (latest)
hi, can you elaborate on what you did, what you expected to see, and what you saw instead?
first i go to stripe dashboard and create webhook end point https://phplaravel-813399-3371113.cloudwaysapps.com/stripe/webhook
and then i create a function in my larvel project to handle backed end and create the funtion in stripe.wehook url ..and am using post method to do this... when i check in stripe dashboard i got webhooks delivery failed
i catullay want to track the Ach payments that y i created webhooks
but i dont know what issue is this
what's the event ID evt_xxx with the problem?
where i find this evt_xx id?
when i check in stripe dashboard
it's on the page in the dashboard
if you click the ... button it has the ID
evt_1NuZ5FEZ1Pyl4W3k8zuO8E9y
you can see that your server is responding to us with a HTTP 419 status, you need to examine your server code and configuration to see why it does that.
so I'd start by looking at your code and checking any logs that your server is keeping
public function handleWebhook(Request $request)
{
$endpoint_secret = env('whsec_xxxxxxxxxxxx');
$payload = @file_get_contents('php://input');
$sig_header = $_SERVER['HTTP_STRIPE_SIGNATURE'];
$event = null;
try {
$event = \Stripe\Webhook::constructEvent(
$payload, $sig_header, $endpoint_secret
);
} catch (\UnexpectedValueException $e) {
// Invalid payload
return response('', 400);
} catch (\Stripe\Exception\SignatureVerificationException $e) {
// Invalid signature
return response('', 400);
}
// Handle the event
switch ($event->type) {
case 'checkout.session.completed':
$session = $event->data->object;
// ... handle other event types
default:
echo 'Received unknown event type ' . $event->type;
}
return response('');
}
this is my server code .. why 419? is this correct?
419 is generally an issue with server configuration, not so much your webhook code
you mean any security related?
It's CSRF related and Laravel specific: https://http.dev/419
I would recommend speaking to Laravel as this is not related to Stripe really