#Pdot - Webhooks
1 messages · Page 1 of 1 (latest)
let me grab that
Here is what the Webhook is sending. No headers or Stripe signature is present
According to that the body object has no .headers at all. If you log out body is it what you expect?
yeah body returns properly, however the tutorial mentions a headers is present in the request?
It should have headers, yeah. Can you see any other headers from the request?
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
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?
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
Payment Intents don't have line items... is this Payment Intent associated with an Invoice?
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
Ah, okay, so you want the line items from the associated Checkout Session?
yes sir
You likely want to listen for checkout.session.completed in that case, which will give you the Checkout Session ID: https://stripe.com/docs/api/events/types#event_types-checkout.session.completed
The line items aren't included by default, but using the Checkout Session's ID you can fetch the Checkout Session with the line items expanded: https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-line_items
Ok i'll give that an attempt