In-Context Checkout: Uncaught SecurityError: Blocked a frame with origin: checkout.js:4734 throws error

随声附和 提交于 2019-11-28 12:52:33

UPD: No, below is not a solution for the problem. Occasionally Paypal's checkout.js script throws the error.

However, it solves this issue

Apparently,

1) there was no this:

window.paypalCheckoutReady = function() {
    // wrong this is here
}

I changed to:

window.paypalCheckoutReady = () => {
    // correct this is here now
}

I don't like .bind(this).

2) I removed <form /> tag and set plain <div> instead:

// before
<form id="checkoutBtnContainer" method="post" action="/checkout"></form>

// after
<div id="checkoutBtnContainer"></div>

I don't know why and how, but all works fine now.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!