#xxxx-SDK

1 messages · Page 1 of 1 (latest)

wide hemlock
#

Hi there, so you want to use API version 2020-08-27 instead of the latest version in your node project?

delicate belfry
#

yes.

wide hemlock
delicate belfry
#

One more question if i change the api version t the latest i.e 2022-08-01.
Will the old functionality will work? stripe.createExternalAccount, createSource,paymentIntenet?

#

Will my old code will be compatible with this or if i change the version , I have to make some chnages in my code as well?

wide hemlock
delicate belfry
#

So will i have to add some version after yarn add stripe?

#

while installing the package to use old version.

wide hemlock
#

it's not about able yarn add stripe, it's about how you initialize the SDK. Please go through the doc that I sent earlier.

delicate belfry
#

Sorry i am unable to understand as through the error i came to know that inside the node_modules files i have this
apiVersion: LatestApiVersion
that's why its using the latest version.

#

If i add some version I think it will use that old version.

#

And in my dashboard also by default i have 2020-08-27 as default version.

#

I think the problem is that while installing the packages their should be a specofic version defined. As i am getting an error inside the node_modules files.

wide hemlock
#

No, the Node.js Stripe SDK version is independent from the Stripe API version

#

Where did you get the error? from yarn add stripe ?

delicate belfry
#

As i am using docker, and inside the docker file i have command yarn add stripe so i am getting this error then

#

27       apiVersion: '2020-08-27',
         ~~~~~~~~~~

  node_modules/stripe/types/lib.d.ts:72:7
    72       apiVersion: LatestApiVersion;
             ~~~~~~~~~~
    The expected type comes from property 'apiVersion' which is declared here on type 'StripeConfig'

Found 1 error(s).```
#

See inside this file node_modules/stripe/types/lib.d.ts

#

because inside this file i have '2022-08-01' as the LatestApiVersion but inside the code it is '2020-08-27' that's why it's not compatible.

#

Please help me out.

#

I have found something see-

#

Using old API versions with TypeScript
Types can change between API versions (e.g., Stripe may have changed a field from a string to a hash), so our types only reflect the latest API version.

We therefore encourage upgrading your API version if you would like to take advantage of Stripe's TypeScript definitions.

If you are on an older API version (e.g., 2019-10-17) and not able to upgrade, you may pass another version or apiVersion: null to use your account's default API version, and use a comment like // @ts-ignore stripe-version-2019-10-17 to silence type errors here and anywhere the types differ between your API version and the latest. When you upgrade, you should remove these comments.

round nymph
#

you can change the version then

delicate belfry
#

If you are on an older API version (e.g., 2019-10-17) and not able to upgrade, you may pass another version or apiVersion: null to use your account's default API version, and use a comment like // @ts-ignore stripe-version-2019-10-17 to silence type errors here and anywhere the types differ between your API version and the latest. When you upgrade, you should remove these comments.

#

||will this work||?

round nymph
#

I imagine it would, you can try it