#jdesignv2_webhooks

1 messages ยท Page 1 of 1 (latest)

limpid driftBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can start a new thread if you have another question.

๐Ÿ”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1260006029056540813

๐Ÿ“ Have more to share? Add details, code, screenshots, videos, etc. below.

rough granite
#

You're making a separate API request after you get the webhook, correct?

scenic gorge
#

This is what is happening... But after cs_test_ it should get the line items...

#

yup

#

because sometimes not all line items are included in the initial webhook event

#

And the weird thing IMO is that the Stripe API does not send any error... normally you (Stripe) have very good error messages but this time nothing is happening at all ...

#

And this is how I have implemented it in my code base - maybe there is smth wrong with it?

rough granite
#

The Checkout Session API doesn't send the line_items by default. You have to expand those too

scenic gorge
#

yeah I do that... wait a sec...

rough granite
#

What's the payload from that request?

scenic gorge
#

But it gives me only a "hand full" of line items...

#

you mean what Stripe sends me with the request?

#

What I can see in the stripe dashboard

scenic gorge
rough granite
scenic gorge
#

one sec...

rough granite
#

I'm only seeing 3 line items on the Checkout Session, so I'm curious if you're also seeing 3 in the payload

scenic gorge
#

3 should be correct but I need to build it again to see the payload in the cloud (vercel)

#

so give me a minute

rough granite
#

Okay, cool. So it's working as expected?

scenic gorge
#

no... the api request still does nothing...

#

Or does it only work if has_more: true?

rough granite
#

What do you mean? Didn't it give you the payload you just posted?

scenic gorge
#

The problem is that if I have 3 or 6 line items it works without the api call - If I have more then that I need to get them via the api call... Sometimes I have 15 or more Line_items...

#

So I need that API call

#

But it just stops the whole process... and I dont quite get why...

#

I can make another example if you wantr

#

With more line items

rough granite
#

Well, no line items will show up in the webhook event as far as I know. You will always have to make a separate API call if you want them.

scenic gorge
#

Wait will give you another example event

#

give me a minute

#

This now has more then 15 line items and it says has_more: true - but when I want to get these line items the API call does not work...

#

And I need to get all line items once to fullfill the order in our system... :/

#

This is the event ID: evt_1PaQsqKBPpELGMIUAx8AMQSc

rough granite
#

Ahhh, okay. You have to use pagination to get the rest. They won't all show up on the first request after a certain number of them: https://docs.stripe.com/api/pagination

scenic gorge
#

const line_items = await stripe.checkout.sessions.listLineItems(session.id, {limit: 50, expand: ["data.price.product"]});

#

But isn't this actually doing that?

#

Or how else would I implement this logic?

rough granite
scenic gorge
#

yeah that is what I try to use...

#

but it somehow does not return anything / has an endless loop or smth in it...

#

At least for me

rough granite
#

What's the payload it sends back?

scenic gorge
#

Nothing... It never comes back

#

that is the problem

#

No error / information what happened

#

I am just gonna try it again in dev mode locally

#

Locally it works as expected...

rough granite
#

Sounds like there likely is an error somewhere when in prod vercel, but you'll have to dig to find it

scenic gorge
#

And on vercel it does not

#

hmmmm

#

well

#

Can you maybe ask your colleagues if they have had a similiar issue once with vercel and stripe?

#

As it is very weird that only this api call does not work... everything else works as expected... (also on vercel) and on top of that it works completely fine locally (dev & production)...

rough granite
#

We don't really have the ability to troubleshoot, even with a working vercel integration. There's no indication where the issue lies. You said it just doesn't do anything. Doesn't really give us a lot to go off of

scenic gorge
#

But well

#

Then I have to have another night shift - here we go...

rough granite
#

Oof. Well, best of luck to you. If you have any other Stripe-related issues, feel free to pop back in