I am trying to implement the iframe mentioned here
https://docs.clover.com/docs/using-the-clover-hosted-iframe
When I load my page on Chrome Version 86.0.4240.183 (64-bit) I get the following error on the console
Content Security Policy of your site blocks the use of 'eval' in JavaScript
The Content Security Policy (CSP) prevents the evaluation of arbitrary strings as JavaScript to make it more difficult for an attacker to inject unathorized code on your site.
To solve this issue, avoid using
eval()
,new Function()
,setTimeout([string], ...)
andsetInterval([string], ...)
for evaluating strings.If you absolutely must: you can enable string evaluation by adding
unsafe-eval
as an allowed source in ascript-src
directive.⚠️ Allowing string evaluation comes at the risk of inline script injection.
The script being blocked is https://checkout.sandbox.dev.clover.com/scripts/index-7b61f880.js
if you search the code you will find it uses setTimeout
The generation of the token using the card details entered is not working. I am assuming it is due to this script being blocked.
Please advise on how to fix this.