razorpay / razorpay-woocommerce

Razorpay Payment Extension for Woocommerce
https://wordpress.org/plugins/woo-razorpay/
GNU General Public License v2.0
40 stars 30 forks source link

Cannot complete checkout | o.ownerWindow.postMessage is not a function #562

Open ablears opened 2 months ago

ablears commented 2 months ago

I have 4.6.7 installed on a WP network child site. Submitting checkout leads to a "Thank you for your order, please click the button below to pay with Razorpay." page. There, clicking 'Pay Now' is unresponsive, and I see the following in the dev console.

Uncaught TypeError: o.ownerWindow.postMessage is not a function value https://checkout.razorpay.com/v1/checkout.js:1 38111 https://checkout.razorpay.com/v1/checkout.js:1 checkout.js:1:74804

I guess because of this error the RazorPay JS object is not available, which causes the local plugin script to fail.

Uncaught ReferenceError: Razorpay is not defined

https://zzz.com/wp-content/plugins/woo-razorpay/script.js?ver=6.5.4:38 https://zzz.com/wp-content/plugins/woo-razorpay/script.js?ver=6.5.4:63 [script.js:38:28](https://zzz.com/wp-content/plugins/woo-razorpay/script.js?ver=6.5.4)

I've tested on Libreoffice on macOS, Chromium on RPI, and Chrome (urgh) on Windows (shudder), and all exhibit this issue.

Adding this script directly through the dev console also shows the same error.

var script = document.createElement('script'); script.src = 'https://checkout.razorpay.com/v1/checkout.js'; document.head.appendChild(script);

GET https://checkout.razorpay.com/v1/checkout.js [HTTP/1.1 200 OK 212ms] Uncaught TypeError: o.ownerWindow.postMessage is not a function