Member
Posts: 4
Registered: ‎02-12-2018
Re: Accept hosted empty transaction response

This is solved:

 

The reason was that IFrameCommunicator didn't register the message event listener, until the iframe was loaded instantly.

 

The default iframe HTML code is:

 

<div  id="iframe_holder" class="center-block" style="width:90%;max-width: 1000px">
			<iframe id="load_payment" class="embed-responsive-item" name="load_payment" width="100%" height="650px" frameborder="0" scrolling="yes" hidden="true">
			</iframe>

And later JS code is:

 

$("#iframe_holder iframe").hide();

which sets

display:none

on the iframe. Removing this JS code and hidden="true" from iframe inline, the iframe now loads instantly and registers eventListener correctly. Without that, only this code:

 

if (window.location.hash && window.location.hash.length > 1) {
   callParentFunction(window.location.hash.substring(1));
 }

from IFrameCommunicator would run, which for some reason doesn't include the respone JSON.

View solution in original post

Who Me Too'd this solution