I’m about to start using stripe.js (but this should relate to a lot of different JS API code). Part of the call to stripe involves passing the API a public ‘key’ to identify my site.
This key will necessarily be different between my testing and production environments.
Stripe.setPublishableKey('<%= get_stripe_key %>'); or something similar.
However, I recently really took a liking to the data-* attributes in HTML5 and the flexibility they have and I was wondering what people thought about doing something like:
<body data-stripe-key='<%= get_stripe_key %>' > ...
data-stripe-key attribute for the key.