#Pdot - Webhooks

1 messages · Page 1 of 1 (latest)

sinful drift
#

Hello! What's the exact error message you're getting?

young silo
#

let me grab that

#

Here is what the Webhook is sending. No headers or Stripe signature is present

sinful drift
#

According to that the body object has no .headers at all. If you log out body is it what you expect?

young silo
#

yeah body returns properly, however the tutorial mentions a headers is present in the request?

sinful drift
#

It should have headers, yeah. Can you see any other headers from the request?

young silo
#

Nope, tried it multiple times. Let me send you what stripe sends as the request when the webhook fires in a txt file obj

#

removed some tokens and stuff this time lol

sinful drift
#

That's just the body of the request, you also need the headers.

#

Where is body coming from in your code?

#

Err, rather, where is event coming from?

#

Have you tried event.headers?

young silo
#

sorry, let me grab the full event

#

omg I m so silly its deff there.

#

sorry for the silly question

#

I do however have another question if you don't mind, is it possible to have the webhook also send the line_items? I ask because I am sending meta_data in line_items and I need them when the webhook fires to perform external db calls

sinful drift
#

Payment Intents don't have line items... is this Payment Intent associated with an Invoice?

young silo
#

sorry I am bit new to stripe, but to create a payment I am using stripe.checkout.Session.create

#

maybe payment_intent.succeeded is the wrong webhook I am using?

#

and no its not associated with any invoices

sinful drift
#

Ah, okay, so you want the line items from the associated Checkout Session?

young silo
#

yes sir

sinful drift
young silo
#

Ok i'll give that an attempt

young silo
#

Hi, thanks this worked like a charm. I have another quick question if you don't mind

#

does metadata only accept string values? I can't seem to find any docs on this

cobalt siren
#

Correct, metadata only accepts strings.

#

So if you need other data you will need to convert/serialize as a string