#pesochek2342_api
1 messages ¡ Page 1 of 1 (latest)
đ 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.
Hi, let me help you with this.
I strongly recommend you to use newer tax APIs like Automatic tax or Tax Rates.
I understand that, but it will take some time to refactor the app.
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.
Could you please share the Request ID req_xxx? https://support.stripe.com/questions/finding-the-id-for-an-api-request
Its removal was documented here: https://stripe.com/docs/upgrades#2020-08-27
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.
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 }
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?
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',
});
Perhaps before the API version was provided in the second argument as a string.
Makes sense. Will check. Currently it's running in a docker container, so I didn't even look into the node_modules/
What are you trying to do with the legacy app? How complex is it?
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..
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?
Yes, it worked and I already see it in the dashboard. Thanks for your help, the problem is resolved now.
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
It's in our pipeline of course. Thanks again.
Happy to help.