Stripe API/Secret Key Error

I followed the tutorial here, Stripe Custom Checkout Forms to create a Stripe checkout form.

I am receiving the following error:

“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/."

I am using Nodejs locally. I have not uploaded the project anywhere as of yet.

Here is the screenshot of my App Structure.

Here is the screenshot of my Server Action.

Thank you in advance for your assistance. :wink:

The client _secret set value on the server side gets its value from the payment intent action. It looks like you modified it with a static value.

@mebeingken, did I mis-read this topic, Stripe confirm intent does not include secret ?

Are we supposed to change createSetupIntent.client_secret with our secret key? If not, where does the Secret Key get entered?

The Stripe Payment Intent does not have a field for the Secret Key, only the API Key, which according to the tutorial, is not used.

I just tested and this still works fine.

The Create Payment Intent has a client_secret value which is returned to the client via the set value client_secret action. It is returning a secret value that is for this purchase intent only; it is not your secret key from the stripe portal.

The stripe secret key from the portal goes in the server connect settings, on the Stripe tab.

Ok, I put {{createPaymentIntent.client_secret)) back in the Set Value client_secret field.

I added the Stripe Secret Key into the Server Connect Settings under Stripe.

Saved, server reloaded, entered the information to process the charge and it looks like it went through ! :slight_smile:

Thanks @mebeingken for saving me from myself!

1 Like