#doowire

1 messages · Page 1 of 1 (latest)

lucid gladeBOT
wise spade
#

Hi 👋

You would use the Live API keys for your account

misty merlin
#

Confused. I just need to take my checkout session out of test mode

#

This is just telling me to handle edge cases etc

wise spade
#

Then you need to create your Checkout Session with your live API key

alpine schooner
#

To help clarify: the "test mode" on the dashboard is to switch the dashboard between looking at data created using the Test API Keys, and the "Live Mode" allows the dashboard to display data created using your "Live" API key.

The API itself routes transactions to "live" or "test" depending on the attached API key - it's the same API; there's no "mode" as such -just routing based on the provided API key

misty merlin
#

Oh that makes more sense. So I have one API key in test mode, and I have another API key when I toggle off test mode.

#

Side question though - What is the difference between the publishable key and the secret key. In my .local.env file i have been using the secret key for test mode

wise spade
#

Publishable keys are safe for use in front-end UIs that users have access to

#

Secret keys are highly sensitive and should only be used in servers where you have control of the code

#

Stripe.js is initialized with your publishable key

#

But API requests made from the server require your Secret key

misty merlin
alpine schooner
#

I'll clarify - there is no "test mode" as such to toggle - it is literally only what the dashboard shows. You ALWAYS have both test and live mode available - just which API key(s) you choose to use.

#

(i.e. you can run test code against the same account as your live mode, without damage)

#

The "test" webhooks handle events created by API actions using test API keys; the "live" webhooks handle events created by API actions using live API keys.

misty merlin
#

Perfect. So I can quickly set up both and just switch between the two.

wise spade
#

That's the idea

misty merlin
#

Perfect. Thank you