#arvindkgs-webhook

1 messages · Page 1 of 1 (latest)

daring creek
#

Do you have the event ID (evt_123) that you saw this for?

dire topaz
#

yes, hang on

#

evt_1JiKlhBuQq6cUmE7OkYT3JV0

#

this event is generated once subscription is newly created

daring creek
#

What information are you not seeing in that event? From our side I can see the event having the invoice info in it

#

Also I see we got a 401 from your server, do you know what error is happening on your side?

dire topaz
#

I am using Kong for handling incoming requests

#

below is my code

local stripe_signature_value = kong.request.get_header(STRIPE_SIGNATURE)
  local webhook_payload_value = kong.request.get_raw_body()

  -- if the Stripe-Signature header is missing then return an error
  if not stripe_signature_value then
    return false, "No Stripe Signature header provided"
  end

  -- if the payload is missing then return an error
  if not webhook_payload_value then
    return false, "No Stripe webhook payload provided"
  end
#

webhook_payload is null/empty

#

it should have worked

#

when using another account, and direct api handling without kong I do not see any issues

#

is it something to do with the account?

daring creek
#

So now you have switched both the account and to kong and are seeing this error?

dire topaz
#

yes

daring creek
#

What happens if you do direct API handling with this account? That can help us separate out what is happening here

dire topaz
#

that is a good question

#

I will try it out

#

Looks to be working without kong

serene steeple
#

So it does seem to be a kong specific issue in that case right? It wouldn't be a Stripe problem per se, and it's more "when I make a post request to my server, how do I access the raw post body for it"?

dire topaz
#

yes

serene steeple
#

I googled around but I've never used Kong and I didn't see much documentation about it unfortunately

#

You will have to debug this on your end, separate from your Stripe integration to start

dire topaz
#

okay, I was hoping that someone from stripe can valid my lua code for stripe signature verification

#

As stripe provides sample code for signature validation for other languages

#

I mean webhook signature validation

serene steeple
#

but it's unrelated to webhook signature validation right now right?

dire topaz
#

yes

serene steeple
#

once you figure out how to get the raw body you can move to signature verification and see if it works or not

dire topaz
#

but parsing the request body