Skip to content

Instantly share code, notes, and snippets.

@AttyC
Created September 11, 2015 09:42
Show Gist options
  • Save AttyC/7cf5734aa8d3e665b164 to your computer and use it in GitHub Desktop.
Save AttyC/7cf5734aa8d3e665b164 to your computer and use it in GitHub Desktop.
Stripe - do I need Stripe.js?
<script
src="https://checkout.stripe.com/checkout.js" class="stripe-button"
data-key="<%= Rails.configuration.stripe[:publishable_key] %>"
data-image="/square-image.png"
data-name="Demo Site"
data-description="data..."
data-amount="2000">
</script>
if Rails.env.production?
Rails.configuration.stripe = {
:publishable_key =>ENV['STRIPE_PUBLISHABLE_KEY'],
:secret_key => ENV['STRIPE_SECRET_KEY']
}
else Rails.configuration.stripe = {
:publishable_key =>ENV['pk_test_x376Bo0np4M9DOG0xhqlTW1V'],
:secret_key => ENV['sk_test_LzYaMKsG7bc73LfkDyUykfId']
}
end
Stripe.api_key = Rails.configuration.stripe[:secret_key]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment