#Python-Subscription

1 messages · Page 1 of 1 (latest)

rancid ermine
trim bronze
#

I've tried casting the 'sub_id' to both types of string and even as any with no avail

rancid ermine
#

that's weird. how about printing out the type of sub_id?

trim bronze
#

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

rancid ermine
#

It's a different issue, isn't it? Did you resolve the previous one?

trim bronze
#

I did

#

Should I start a new thread?

rancid ermine
#

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

trim bronze
#

yeah a console.log(process.env.stripeToken) shows the correct value

rancid ermine
#

could be the location of the stripe variable

#

How about sharing full code of the file which is not working?

trim bronze
#

Its the cancelRole that doens't work

rancid ermine
#

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?

quaint stream
#

Hi @trim bronze I'll take over this thread, give me a sec to catch up the conversations.

#

Can you share with me the request IDs?