#putte
1 messages ยท Page 1 of 1 (latest)
Hi ๐
Have you taken a look at this example?
https://github.com/stripe-samples/accept-a-payment/tree/main/custom-payment-flow/server/node-typescript
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?
Yes exactly
And you are logging the value immediately before this step in your code?
Yes
And it is correct? It matches what you see in your dashboard?
Yes the test key is correct
And it starts sk_ ? Just trying to rule out everything
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
11.12.0
I updated it today because I thought that might be the case
Okay what happens if you just do a simple const stripe = new Stripe('sk_test_xxxxx')?
FUN