Jump to content

Content Security Policy blocking payment module


Rizzzle

Recommended Posts

Hello,

Prestashop: 1.7.8.9

Php version: 7.4.33

Apache.

Test site. Having issues with the payment module Stripe:

Three errors:

Content-Security-Policy: The page’s settings blocked an inline script (script-src-elem) from being executed because it violates the following directive: “script-src 'self'”

"Content-Security-Policy: The page’s settings blocked an inline script....."

Content-Security-Policy: (Report-Only policy) The page’s settings would block an inline script (script-src-elem) from being executed because it violates the following directive: “script-src 'self'”

Browser: Firefox.

Any ideas? Please help.
Thank you

Link to comment
Share on other sites

Hi ,
The Content-Security-Policy (CSP) errors you're encountering with the Stripe payment module in Firefox indicate that the CSP settings on your site are blocking inline scripts
Example modification to .htaccess:
<IfModule mod_headers.c>
Header set Content-Security-Policy "default-src 'self'; script-src 'self' https://js.stripe.com; style-src 'self' 'unsafe-inline'; frame-src 'self' https://js.stripe.com;"
</IfModule>

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...