0
votes

So as the title says, I have a problem proceeding the order, I just get this error:

GET https://website.com/public/intent 500 (Internal Server Error)

That's how I implemented stripe:

<script src="https://js.stripe.com/v3/"></script>
<script>
 // Stripe stuff
 var stripe = Stripe('pk_test_key');
 var elements = stripe.elements();</script>

Into logs I get this error:

"This API call cannot be made with a publishable API key. Please use a secret API key. You can find a list of your API keys at https://dashboard.stripe.com/account/apikeys."

When I'm trying to use the secret key it tells me to use the public key and vice versa.

Can someone help me out ?

1
Please share more details. When an error 500 occurs, there's usually something written to either your server's or your application's log - Nico Haase
I get this error: "This API call cannot be made with a publishable API key. Please use a secret API key. You can find a list of your API keys at dashboard.stripe.com/account/apikeys." - nanelu

1 Answers

0
votes

What API calls are you trying to make? Integrating with Stripe, for example following this guide to accept a payment, requires both client-side and server-side components. In the JavaScript world you'd use stripe-node (github) on your server with your secret key to create a Payment Intent, and use Stripe.js with a publishable key in your client application (eg: React app) to collect payment details and submit the payment.

Never include your secret key in a client-side application. This is not secure.