#putte

1 messages ยท Page 1 of 1 (latest)

uneven girderBOT
tawny onyx
cerulean sable
#

Yes I have

#

I used the same method

tawny onyx
#

And so this:

onst stripe = new Stripe(process.env.STRIPE_SECRET_KEY, {
  apiVersion: "2022-11-15",
  appInfo: { // For sample support and debugging, not required for production:
    name: "stripe-samples/accept-a-payment",
    url: "https://github.com/stripe-samples",
    version: "0.0.2",
  },
  typescript: true,
});

returns the Auth error?

cerulean sable
#

Yes exactly

tawny onyx
#

And you are logging the value immediately before this step in your code?

cerulean sable
#

Yes

tawny onyx
#

And it is correct? It matches what you see in your dashboard?

cerulean sable
#

Yes the test key is correct

tawny onyx
#

And it starts sk_ ? Just trying to rule out everything

cerulean sable
#

yes it starts with sk_test

#

dont worry ask as many questions as you like, I'm not sure either what the problem is

#

It happened once I "converted" my backend to typescript, forcing me to use import instead of require

#

Hey I think I know what the issue is

#

So I console.log the object from const stripe = new Stripe

#

VERSION: '11.12.0',
on: [Function: bound addListener],
once: [Function: bound once],
off: [Function: bound removeListener],
api: {
auth: 'Bearer sk_test
*******',
host: 'api.stripe.com',
port: '443',
protocol: 'https',
basePath: '/v1/',
version: '2022-11-15',
timeout: 80000,
maxNetworkRetries: 0,
agent: null,
httpClient: NodeHttpClient { _agent: undefined },
dev: false,
stripeAccount: null
},

#

it says dev: false? is this expected ? I can see however that correct api_key is assigned in the Bearer token on the auth key

tawny onyx
#

Wait ... huh? ๐Ÿค”

#

What version of stripe-node are you using?

cerulean sable
#

11.12.0

#

I updated it today because I thought that might be the case

#
tawny onyx
#

Okay what happens if you just do a simple const stripe = new Stripe('sk_test_xxxxx')?

cerulean sable
#

Its impossible in ts

#

it requires you to provide config

tawny onyx
#

FUN