Dev / Production API Keys

Would like to know how to properly setup keys for Stripe so that when I am in dev/staging they use the test keys and when in production switch to use live keys.

We use the following set in the “BF - Global Before” before script

Set Variable [ $$BF_Env ; Value: If( JSONGetElement ($$BF_Payload ; "data.state.params.host" ) = "production.domain.com" ; "production" ; "sandbox" )] 

We then have an if statement in the stripe config script that returns the sandbox API keys unless $$BF_Env = “production”

We have a global prefs key that is isDevMode` type thing.
Then when we call the keys, we just check that and return the right set.

c