Reply
Highlighted
Member
Posts: 2
Registered: ‎05-12-2017

Accept Hosted in iFrame: resizeWindow is not sent when form height changes because of window resize

I'm currently evaluating the possibility of using Accept Hosted form inside an iFrame in one of my projects. I've run into an issue while building a small test app, which, I believe, can also be reproduced in the Accept Sample App.

 

In step 3 of the "Accept Hosted Step-by-Step" guide there is a remark regarding "resizeWindow" message:

 

"An important message to receive is the resizeWindow message. Because our Accept Hosted form is responsive, we need to let your application know when the iframe should be resized. For example, when the form becomes single column on a phone, the height is increased and this height increase is sent in a ResizeWindow message."

 

However, in my tests this does not appear to be the case: when the iFrame that hosts the payment form is set to have a width as a percentage of the browser window width and the browser is resized so that the form changes from a two-column layout to a single-column one, the "resizeWindow" message is not sent. This results in both "Pay" and "Cancel" buttons being pushed below the visible area of the iFrame, making the form unusable. If a user manipulates the form in such a way that does trigger "resizeWindow" message (for example, if user checks the "bank account" or "credit card" radio button), the height is updated so that all form controls are visible again.

Here are the steps to reproduce the issue using Accept Sample App:

  1. Install and run the sample app as described in the "How to Use the Sample App" section
  2. Login with a customer profile ID and navigate to "pay" tab
  3. Observe that the payment form is loaded, it has a two-column layout and both "pay" and "cancel" buttons are visible
  4. Change the browser window width so that the form switches from two- to one-column layout
  5. Observe that while window width is changing the form height does not change, while certain inputs and both "pay" and "cancel" buttons are pushed down and become invisible.
  6. Select "Bank account"  payment option at the top of the form
  7. Observe the form height now changed and all controls are now visible again.

Is there a way to have the form send the "resizeWindow" notification in step 5? 

 

While I certainly could listen to "resize" event on window in my host application, I don't believe that I can query the height of the payment form because of the browser restrictions on the cross-domain iFrame contents access. 

 

I would really appreciate any suggestions on the topic. 

 

Thanks,

Maxim. 

Highlighted
Posts: 2,765
Topics: 57
Kudos: 247
Blog Posts: 67
Registered: ‎12-05-2011

Re: Accept Hosted in iFrame: resizeWindow is not sent when form height changes because of window res

Hello @maxim_baranov

 

It's been a while since you posted this question, are you still experiencing this issue or did you find a solution?

 

Richard

Highlighted
Member
Posts: 2
Registered: ‎05-12-2017

Re: Accept Hosted in iFrame: resizeWindow is not sent when form height changes because of window res

I was not able to find a solution, mainly because of the difficulties of determining an actual height of the content inside the iframe. I assume that one approach would be to have payment form itself detect the viewport width change and send the same resizeWindow message it does when the height of the content changes because of other reasons, such as switching between payment methods (CC or check). But that would require changes on the Accept Hosted side. 

 

We've also considered using a fixed width container to host the iframe for our project, thus circumventing the whole issue.

 

Ultimately (this issues was not a deciding factor), we decided to spend some extra time and build a custom payment form using the Accept.js instead. 

Highlighted
Member
Posts: 3
Registered: ‎08-09-2017

Re: Accept Hosted in iFrame: resizeWindow is not sent when form height changes because of window res

Same here.

 

The only time I see a resizeWindow message is when I click the radio button to change from credit card mode to bank account mode or vice-versa.

 

I have never seen a resizeWindow message when resizing the window.

Highlighted
All Star
Posts: 699
Registered: ‎11-03-2016

Re: Accept Hosted in iFrame: resizeWindow is not sent when form height changes because of window res

Hi @Chris2017,

 

I'll look into this. I honestly don't know whether it should be sending resize messages every time the layout changes or just when it's first loaded. I'm guessing the thinking might be that it needs to send its size when it's first loaded so you can set the iframe size appropriately.

 

It's going to load up at different sizes depending on whether it's loaded on mobile or desktop, for example, so setting the size at that time is important. However, it might be being assumed that the window size is not typically changed during the payment.

 

I'll have to double-check with some folks to see what the design was, whether it's working as designed, and clarify in documentation as appropriate.

Highlighted
Contributor
Posts: 10
Registered: ‎04-13-2018

Re: Accept Hosted in iFrame: resizeWindow is not sent when form height changes because of window res

Sorry to resurrect an old thread, but I don't see a resolution here, and I'm having the same problem as the OP. Accept.js and AcceptUI.js won't work for us because of PCI and payment flow issues.

 

@Aaron wrote, "...it might be being assumed that the window size is not typically changed during the payment."

 

This assumption doesn't always hold, particularly when you consider orientation changes on tablets and phones. Starting in landscape and rotating to portrait after the iframe is rendered can make the buttons overflow out of the bottom.

 

Is there any resolution or workaround? Iframes are known to be quirky in responsive designs. I'm continuing my research and experimentation, but I'm hoping someone here can save me.

 

Thanks,
Scott

Highlighted
Member
Posts: 1
Registered: ‎05-19-2019

Re: Accept Hosted in iFrame: resizeWindow is not sent when form height changes because of window res

Anyone have a solution for this? I'm running into the same issue.

Highlighted
Member
Posts: 5
Registered: ‎03-04-2020

Re: Accept Hosted in iFrame: resizeWindow is not sent when form height changes because of window res

No sir couldn't find it sorry for that if any updates avalable put it here