checkout/frames-react

Fail to initialize Frames - Checkout.com CDN not present.

Opened this issue · 0 comments

Type: Bug
Error: Checkout.com CDN not present. Perhaps you forgot to add <script src="https://cdn.checkout.com/js/framesv2.min.js"></script> to your index.html file.

This issue is happening on live over SSL, when I was running locally it was not happening.

On initialization, it throws a console error

Checkout.com CDN not present. 
Perhaps you forgot to add <script src="https://cdn.checkout.com/js/framesv2.min.js"></script> 
to your index.html file.

But the in the source I can see the script

Later investigating, I found a workaround Frames.js

document.querySelector('script[src$="https://cdn.checkout.com/js/framesv2.min.js"]')

was returning null.
When you change following in Frames.js

     Frames.prototype.componentDidMount = function () {
-        var existingScript = document.querySelector("script[src$=\"".concat(config_1.CDN, "\"]"));
+        var existingScript = document.querySelector("script[src~=\"".concat(config_1.CDN, "\"]"));
         if (!existingScript) {
             console.error("Checkout.com CDN not present. Perhaps you forgot to add <script src=\"".concat(config_1.CDN, "\"></script> to your index.html file."));
         }

the Frames initiating properly.

Please look into this issue and provide a fix at the earliest.