#sejo

1 messages ยท Page 1 of 1 (latest)

cold quarryBOT
pliant spear
#

Hello what is your subscription problem?

wooden sigil
#

hi

#

I am creating the code that the documentation gives me on the side of the node.js backend but it gives me an error, I don't know why

#

It asks me for other items in lines_items but if the code is passing it to me, stripe should only pass the priceId

pliant spear
#

Can you send me the code for the API call that you are making and the exact text of the error that you are getting back?

wooden sigil
#

The currency was not there but as he asked me, I just put it in, but I already got more errors, that's why I entered here

cold quarryBOT
wooden sigil
#

?

pliant spear
#

Ah, you are using the parameters from an older API version

#

One sec, we have the new ones documented somewhere

#

So what happens if you remove currency? Do you get a different error?

wooden sigil
#

if you ask me to put it... it is supposed that with the priceId you should already identify the subscription of the web

#

then I would not be making a subscription and I would be making a normal purchase if I have to pass all the parameters

vivid sleet
#

Hello ๐Ÿ‘‹
Taking over as Pompey needs to step away soon

#

The code you're currently using is for an older API version than what your account currently uses

wooden sigil
#

is seriously ? at least you saw my code
? I mean, it's the same one that's there hahahahaha I said to copy the code from there

vivid sleet
#

The screenshot has a different code than what your server is running

#

You don't have line_items.amount in the code that you shared but we do see the error referencing it

#

So you are running a diff code than the one you're looking at

wooden sigil
#

This is from the link you gave me... where is what you told me about lines_items.amouunt?

vivid sleet
#

Look at the error message

wooden sigil
#

The only difference between that code and mine is that I put the success or cancel routes

vivid sleet
#

nope, I'd highly recommend checking if your server is running the correct code

wooden sigil
#

I mean, even though it's a subscription, do I have to detail the product? I don't understand what the priceId they give you when you create the product is for

vivid sleet
#

A user will subscribe to a recurring product when you create a subscription so yes, you'd need to pass in the information about what the user is subscribing to by passing in the product ID

wooden sigil
#

which I am trying to subscribe to is a recurring product

vivid sleet
#

It's not the code that you're writing is throwing the error.
It's the code that you're running on your server. You're likely running a diff code than what you're looking at.
The error message is super clear about what parameters are unexpected which you clearly don't have in your code shared in the screenshot

wooden sigil
#

ahhh of course, I understand even though it is a subscription, I still have to pass the product information with the id... because the id does not identify the recurring product

vivid sleet
wooden sigil
#

I just copied the code that doesn't matter to me, it doesn't fire and it gives me the same error

#

I send the priceId from the front, it is the same code now and it gives me the same error

vivid sleet
#

That's because as I mentioned earlier you're running a completely diff code on your server versus what you're writing.
If you comment out the whole code, you'd still see the same error

wooden sigil
#

But it is the code that the stripe website gives me for node.js, what other code do you want me to put? I don't understand why you only tell me that my code is wrong but what code should I put if that gives me stripe for node.js

vivid sleet
#

I am not telling you the code is wrong, I am telling you that your server is running a different code altogether.

wooden sigil
#

I'm following the steps on the website hahaha I don't think you even know what's going on because it's weird

vivid sleet
#

I don't think you understand what code your server is running.
Have you tried restarting the server?

wooden sigil
#

Thanks anyway, it will be looking for another payment gateway, thank you very much for your time

cobalt obsidian
#

๐Ÿ‘‹ hello there

#

Can you copy/paste the request ID (req_xxx) that is in your error above @wooden sigil ?

wooden sigil
cobalt obsidian
#

Yeah can you just grab that for me?

#

And can you run another quick test and comment out the Checkout Session creation altogether and just put a log in its place

#

Like console.log("within Checkout Session creation route");

wooden sigil
#

ok

cobalt obsidian
#

Great!

#

Okay can you comment the above back in and run another test?

#

And then provide the error if there is one

#

And the request ID if there is one

wooden sigil
cobalt obsidian
#

Interesting! Can you copy paste that request ID so I don't have to type it out?

wooden sigil
#

ok

#

'req_lmojNTIKj82URM'

cobalt obsidian
#

Thanks. Give me a moment to look

wooden sigil
#

ok

cobalt obsidian
#

Can you log out your price variable before the Checkout Session?

#

Looks like it is actually priceId

wooden sigil
#

I use this product id

cobalt obsidian
#

Yep that's the right one to use

#

Have you tried hard coding it?

#

Or making sure that your variable is initialized correctly?

wooden sigil
#

I have it on the front through a request to my node.js server, it sends me the id of the product that you saw when you made me comment on everything

cobalt obsidian
#

Sure but it isn't coming through in the API request for some reason. So we need to figure out why that is. Can you test hard coding it in your code instead of using a variable just to make sure that works as expected?

wooden sigil
#

ok

#

now if the payment gateway was triggered

cobalt obsidian
#

Okay so I can see successful Checkout Session creations on your account now so I do think we narrowed it down to involving that priceId variable

#

So I'd recommend logging out that variable on your server right before your checkout.sessions.create() function runs

wooden sigil
#

ok

#

I think that with this it works, it even points to where the subscription is created. I already have created the webhooks. Anything, I'll contact you again

cobalt obsidian
#

Sounds good! Glad you got it working!

wooden sigil
#

thank you very much the truth, what a headache

#

have a good day! thank you so much