merchflow / medusa-taxes-stripe

0 stars 1 forks source link

Authentication error from stripe - secret key missing #4

Open sethbrasile opened 2 months ago

sethbrasile commented 2 months ago

This plugin doesn't mention whether I need to include an options object or not, and it doesn't mention how to provide the stripe api key and webhook secret.

I have tried with and without an options object in medusa-config.js and I have tried every naming convention I can come up with to pass in the secrets, but either way I end up with no secret key set.

error:   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/.
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.Error_js_1.StripeAPIError.message (/path-to-project/node_modules/medusa-taxes-stripe/node_modules/stripe/cjs/RequestSender.js:96:31)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Could you help me configure this plugin? I'm happy to PR the readme once I figure it out.

sethbrasile commented 2 months ago

Ok I got it.

{
    resolve: `medusa-taxes-stripe`,
    options: {
      stripeApiKey: process.env.STRIPE_API_KEY,
    },
  },

I definitely tried this before and it didn't work lol, I must have had something else wrong.

I'll send a PR to add this to the readme.

sethbrasile commented 2 months ago

5