#nate!

1 messages · Page 1 of 1 (latest)

wild veldtBOT
upper gust
#

Hello, what's up?

grizzled escarp
#

i need to get quantity of items in

#

checkout.session.compeleted webhook request

upper gust
grizzled escarp
#

where is line_items

#

@upper gust

upper gust
#

It will be in the response when you retrieve the Checkout Session with line_items expanded.

grizzled escarp
#

how do i

#

tf do i put here bro

upper gust
#

That's code to retrieve a Charge, you need to retrieve the Checkout Session.

#

That code, but with line_items expanded.

grizzled escarp
#

@upper gust

upper gust
grizzled escarp
upper gust
#

The request ID will start with req_.

grizzled escarp
#

nothing like that

#

req_WfB7gnIUwnvfxL

upper gust
#

Thanks! Looking...

#

It looks like you tried to retrieve a Charge, not a Checkout Session.

#

You need to change your code to retrieve a Checkout Session, not a Charge.

grizzled escarp
#

look

upper gust
#

There is no stripe.checkout.retrieve

grizzled escarp
upper gust
#

What do you see?

grizzled escarp
upper gust
#

Sure, but I don't know if I'll be able to answer it.

grizzled escarp
#

let newKey = uuidv4();

#

so i have this module called uuid

#

i need to generate uuids that at amount of user e bought

upper gust
#

Not sure I understand. A UUID is a universally unique ID that isn't based on anything. Can you provide more detail?

grizzled escarp
#

when u run uuidv4(); function

#

it returns 1 uuid

#

i need to generate the same amount that user bought

#

i was thinking something like

#
let number = 0;
let keys: Array<string> = [];
while(0 > 14) {
    keys.push(uuidv4())
}
upper gust
#

That won't work, because 0 will never be greater than 14. You need a for loop where you count through the quantity.

grizzled escarp
#

can you write me that code

upper gust
#

Something like for (i=1, i<=quantity, i++) {}

#

That's not tested, but something like that.

#

But I can't really write your code for you beyond a simple example like that.

grizzled escarp
upper gust
#

I don't think that will work. The loop, if it starts, will go on forever because you're incrementing number and the while condition is checking to make sure number is greater than the other thing.

grizzled escarp
#

i switched > and it worked

wild veldtBOT