-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Closed
Description
Preconditions
- Magento CE 2.1.5 (probably 2.1.7 as well), Linux, nginx, Varnish, PHP 7.0, MySQL 5.6
- Paypal Payflow pro payment method is enabled (with iframe)
Steps to reproduce
- Customer adds a product to cart, and goes to checkout
- On second step, customer selects Payflow Pro method
- iframe is displayed, and customer enters wrong data
- iframe is removed, and message is displayed asking to try again
- customer selects the same payment method again
Expected result
Iframe should be displayed
Actual result
Iframe is not displayed
Overview of the issue:
Second time the iframe is to be displayed, vendor/magento/module-paypal/view/frontend/web/js/view/payment/method-renderer/iframe-methods.js afterPlaceOrder method is triggerred, and the following code executed:
if (this.iframeIsLoaded) {
document.getElementById(this.getCode() + '-iframe')
.contentWindow.location.reload();
}
However, this fails because the source of the iframe is no longer on the stores domain - it is on paypal - and we have a cross-domain request which is blocked.
Workaround:
change the code above to the following:
if (this.iframeIsLoaded) {
var iframe = document.getElementById(this.getCode() + '-iframe');
iframe.src = this.getActionUrl();
}