I am using a serverless lambda function to run Stripe payments.
In my server function i have the following…
require(‘dotenv’).config()
const stripe = require(‘stripe’)(process.env.STRIPE_SECRET_KEY);
i have a .env file with the SK in there, and this works when running on localhost. But it doesnt work when i deploy.
I have added the SK in Netlify’s dashboard
STRIPE_SECRET_KEY
sk_test_opK…sIKZ
But it doesnt work for me, what am i doing wrong?