#Python-Subscription
1 messages · Page 1 of 1 (latest)
I've tried casting the 'sub_id' to both types of string and even as any with no avail
that's weird. how about printing out the type of sub_id?
I see, its returning an object even though I casted it as a String
Strangely enough, though its a string I'm getting a new error
const stripe = require('stripe')(process.env.stripeToken);
isn't being recognized
Though its a global api key setter, I'm still gettig this error
StripeAuthenticationError: You did not provide an API key. You need to provide your API key in the Authorization header, using Bearer auth (e.g. 'Authorization: Bearer YOUR_SECRET_KEY'). See https://stripe.com/docs/api#authentication for details, or we can help at https://support.stripe.com/.
at res.toJSON.then.StripeAPIError.message (C:\Users\ayomi\OneDrive\Desktop\stripe-to-discord\node_modules\stripe\lib\StripeResource.js:214:23)
This works in another file though
It's a different issue, isn't it? Did you resolve the previous one?
no it's fine!
just continue here
Have you double (triple!) checked that process.env.stripeToken does have a value?
It's probably something with environment setup in your framework
yeah a console.log(process.env.stripeToken) shows the correct value
could be the location of the stripe variable
How about sharing full code of the file which is not working?
for the sanity check (I am not super familiar with Node) if you move the stripe define line right to the place of console.log(process.env.stripeToken), would it work?