#pesochek2342_api

1 messages ¡ Page 1 of 1 (latest)

calm steepleBOT
#

👋 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/1255856112574660650

📝 Have more to share? Add details, code, screenshots, videos, etc. below.

worn ermine
#

Hi, let me help you with this.

#

I strongly recommend you to use newer tax APIs like Automatic tax or Tax Rates.

latent mountain
worn ermine
#

I've never heard of that tax_percent and I don't know how it works.

#

For the API version, 2015-08-19 is 9 years old so I doubt there's an adequate support for it.

latent mountain
worn ermine
#

I don't think there's a more straightforward way to make this work rather than using Tax rates. I am happy to assist you with the migration, it must be rather trivial, i.e. instead of providing the raw tax percentage number, you create/reuse a Tax Rate object.

latent mountain
# worn ermine I don't think there's a more straightforward way to make this work rather than u...

Yeah I think I'll figure it out if there's no other way. By the way there's no request ID as it gets bounced right away I guess.

{ Error: Invalid Stripe API version: [object Object]
cas-admin-app | at Function.generate (/app/node_modules/stripe/lib/Error.js:56:16)
cas-admin-app | at IncomingMessage.res.once (/app/node_modules/stripe/lib/StripeResource.js:168:39)
cas-admin-app | at Object.onceWrapper (events.js:286:20)
cas-admin-app | at IncomingMessage.emit (events.js:203:15)
cas-admin-app | at IncomingMessage.EventEmitter.emit (domain.js:448:20)
cas-admin-app | at endReadableNT (_stream_readable.js:1145:12)
cas-admin-app | at process._tickCallback (internal/process/next_tick.js:63:19)
cas-admin-app | raw:
cas-admin-app | { message: 'Invalid Stripe API version: [object Object]',
cas-admin-app | type: 'invalid_request_error',
cas-admin-app | rawType: 'invalid_request_error',
cas-admin-app | code: undefined,
cas-admin-app | param: undefined,
cas-admin-app | detail: undefined,
cas-admin-app | requestId: undefined,
cas-admin-app | statusCode: 400,
cas-admin-app | charge: undefined,
cas-admin-app | decline_code: undefined,
cas-admin-app | payment_intent: undefined,
cas-admin-app | payment_method: undefined,
cas-admin-app | setup_intent: undefined,
cas-admin-app | source: undefined }

worn ermine
#

Actually this seems to be related to the fact that you are providing an object instead of a string to set the version.

#

What stripe-node version are you using?

latent mountain
#

7.8.0.. as I mentioned it's a quite old app. And I'm setting the version as suggested in the current docs:

const stripe = require('stripe')(config.stripe.secretKey, {
apiVersion: '2015-08-19',
});

worn ermine
#

Perhaps before the API version was provided in the second argument as a string.

latent mountain
#

Makes sense. Will check. Currently it's running in a docker container, so I didn't even look into the node_modules/

worn ermine
#

What are you trying to do with the legacy app? How complex is it?

latent mountain
#

I'm trying to fix some long lasting bugs. So I deployed it locally, set up a separate Stripe account (which I can run in a full development/test mode), and now I'm stuck at this version issue since our old code is not compatible with the new API. There's no issue with our main live Stripe account though, because somehow it manages to use that 2015-08-19 version, it's not defined in any imports, the app simply uses it somehow.

#

Looks like you're right, it used to be a plain string..

worn ermine
#

Your main account has the 2015-08-19 set up by default, and its stripe-node package is compatible with it, that's why it works. Your new account has the latest API version by default, so you have to set it explicitly in your app. Have you tried providing a string instead of the object?

latent mountain
#

Yes, it worked and I already see it in the dashboard. Thanks for your help, the problem is resolved now.

worn ermine
#

Glad it worked. I would still recommend you to consider upgrading your setup to the latest versions, both stripe-node and Stripe API. Also, if you're using Sources API for charge customer, it's going to be blocked soon: https://docs.stripe.com/sources

latent mountain
#

It's in our pipeline of course. Thanks again.

worn ermine
#

Happy to help.