#nerdsliceradyn

1 messages · Page 1 of 1 (latest)

hoary glacierBOT
polar raft
#

Hello! The payload cannot be changed, so that approach won't work. What part of your system is returning the 419?

neon anchor
#

payment_intent.succeeded

polar raft
#

That's the Event type from Stripe. I'm asking you what part of your system, on your side, is returning a 419 HTTP status code when we attempt to deliver an Event to it?

neon anchor
#

I see what you're asking, its in controller. I have added the url to my middleware exclusion for csrf verification

polar raft
#

Sounds like the exclusion isn't working?

neon anchor
#

Thats what I thought but wanted to see if i had missed anything in integration as that is a much easier mess to clean up

polar raft
#

It sounds like something with Laravel. 419 isn't an official HTTP status code, seems like Laravel is using it for the CSRF stuff.

neon anchor
#

Fixed that now getting No signatures found matching the expected signature for payload

polar raft
#

That usually means you're either using the wrong Webhook Signing Secret, or that you're using a modified request body.

neon anchor
#

stripe = new \Stripe\StripeClient(env('STRIPE_KEY'));

    // This is your Stripe CLI webhook secret for testing your endpoint locally.
    $endpoint_secret = env('STRIPE_SECRET');

    $payload = @file_get_contents('php://input');
    $sig_header = $_SERVER['HTTP_STRIPE_SIGNATURE'];
    $event = null;
polar raft
#

Verify the secret you're using is the correct one, and make sure you're passing te raw, unmodified request body when constructing the Event.

neon anchor
#

I see the issue, thank you

#

Well thought I did. I was using STRIPE_SECRET not STRIPE_WEBHOOK_SECRET

polar raft
#

Are you using Stripe CLI and stripe listen or is this an actual Webhook Endpoint?

neon anchor
#

I had my test secret webhook in place. resolved now