I'm working on a Ruby on Rails app where I'm planning to integrate Stripe payments. I'm using the stripe
gem. I'm planning to use Elements, as described here.
I'm including Stripe js like this:
= javascript_include_tag 'https://js.stripe.com/v3/'
In my charges.coffee
file I have this:
$(document).on 'turbolinks:load', ->
stripe = Stripe("<%= Rails.application.secrets['STRIPE_PUBLISHABLE_KEY'] %>")
elements = stripe.elements()
When I load the app I currently get the following error in Safari:
Refused to execute a script because its hash, its nonce, or 'unsafe-inline' does not appear in the script-src directive of the Content Security Policy.
Any ideas on what I can do to solve this issue?