#mr_pablo - Subscription Plan

1 messages ยท Page 1 of 1 (latest)

agile summit
agile summit
#

HI ๐Ÿ‘‹

#

Thanks for the event's assist ๐Ÿ™‚

#

What happens if you attempt to access it via the price attribute?

hallow lagoon
#

"Property 'price' does not exist on type 'Subscription'"

agile summit
#

โ˜น๏ธ

agile summit
#

And this is occurring on the back-end, with you using the Stripe node JS library, correct?

nimble sable
#

Do you happen to know what API version you're using on your account?

nimble sable
#

I think you've logged off so I'm going to close this thread, but when you come back online I believe this is an issue with mismatching API versions - the account that made that subscription is on API version 2020-08-27, but your recent requests were made with version 8.60.0 of the stripe-node library which has a slightly different TS type definition for Subscription. See https://github.com/stripe/stripe-node/blob/f1dbba57473a7db9c19dedfea284b97dc985b0d2/types/2020-03-02/Subscriptions.d.ts#L145

GitHub

Node.js library for the Stripe API. . Contribute to stripe/stripe-node development by creating an account on GitHub.

nimble lava
#

@hallow lagoon looking now

#

to answer your response to my thread (not sure why you closed it...) I am using 8.207.0 and API version 2020-08-27. What version nbumber was the file you linked me, showing the plan type?

#

to clarify we lock the thread because you didn't reply and it's been 14 hours so we need to keep the context clear for our team as we do this in shifts(karbi is in the US, I'm in Europe), not feasible to keep a thread open that long

hallow lagoon
#

Oh right. Well I opened the thread in the day (im in UK) and I went home so I'm not gonna be checking on it until the next day

nimble lava
#

but yeah for this specific issue, we consider subscription.plan or subscription.price deprecated really.

you should be using subscription.items.data[0].price

hallow lagoon
#

๐Ÿคทโ€โ™‚๏ธ

#

ah ok

nimble lava
#

subscription can have multiple prices

hallow lagoon
#

I think i know whats happened. I think the API version used by our FE team to mock up a payment page is old

#

Actually

nimble lava
#

we probably removed subscription.plan from the typescript bindings to discourage use of it, but technically if you disable TS on that line you could access it

hallow lagoon
#

scratch that, the data was from a webhook

#

So even more confused now

#

OK, so regardless, i shouldn't use it

nimble lava
#

yeah it's not really to do with API version of the raw data itself at all

#

it's there, it's in the object, you can access it, but we don't expose it in the type binding

hallow lagoon
#

Could you pass on the fact that it's still shown in subscription.plan

nimble lava
#

that's how we soft-deprecate features

hallow lagoon
#

and have that removed, as its super confusing

nimble lava
#

I can try!

hallow lagoon
#

thank you