Reply
Highlighted
Contributor
Posts: 48
Registered: ‎06-08-2011

CIM Hosted form issues

I'm using CIM hosted option and am having a couple of issues after running AuthorizeNetPopup.openAddPaymentPopup().

 

1) When I press 'cancel', the popup doesn't close but whites out. Only the border remains. When I debug in the browser, i get Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://localhost:4286') does not match the recipient window's origin ('null'). Looked at Google but it wasn't enlightening.

 

2) After entering a payment profile, the result reads 'Your information has been saved'. Is there a way for it to close instead and navigate to another page or notify me of the update? I assume this is what hostedProfileIFrameCommunicatorUrl is for but I haven't gotten it to work yet.

 

 

Highlighted
Contributor
Posts: 48
Registered: ‎06-08-2011

Re: CIM Hosted form issues

bump.
Highlighted
Administrator
Posts: 591
Registered: ‎08-21-2009

Re: CIM Hosted form issues

This error would seem to indicate that the iFrameCommunicator is being loaded, but for some reason it isn't successfully targeting the parent window. If you look at the code in our default iFrameCommunicator, you'll see that it references "parent.parent", this should raise the call past the hosted form and on to the window that is under your control.

 

The error is stating that it is not successfully targeting anything at all. Are you loading the hosted form in a lightbox, or in a popup window?

Highlighted
Contributor
Posts: 48
Registered: ‎06-08-2011

Re: CIM Hosted form issues

Hosted in a lightbox. I downloaded the example code and get the same result.

Highlighted
Contributor
Posts: 48
Registered: ‎06-08-2011

Re: CIM Hosted form issues

In the error message Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https:......') does not match the recipient window's origin ('null'), where does the second url ('null') come from?

Highlighted
Contributor
Posts: 48
Registered: ‎06-08-2011

Re: CIM Hosted form issues

bump.

 

The cancel button shows this:

<input type="button" class="CancelButton" id="btnCancelPaymentItem999" value="Cancel" onclick="btnCancelEdit_onclick(g_paymentItemEditInfo, 999)">

 

I don't see the handler for the onclick event anywhere. Please help!

 

Highlighted
Administrator
Posts: 591
Registered: ‎08-21-2009

Re: CIM Hosted form issues

When the save or cancel buttons are pressed, an event is initiated through the iFrameCommunicator. If you look at the iFrameCommunicator code, you can see precisely what function it is calling in your parent page, it is this function that acts as your event handler and can close or update the contents of the popup..

Highlighted
Contributor
Posts: 48
Registered: ‎06-08-2011

Re: CIM Hosted form issues

I understand what the iframecommunicator does but can't get it to work. I've updated iframecommunicator.html with console.log statements on the first line of each function and they're not appearing the the browser log. I'm not getting any javascript error messages in the browser either.  I'm hoping to see the 'cancel' button press event.

 

I'm not sure how to troubleshoot this. Can you please provide some direction on what to do?

Highlighted
Contributor
Posts: 48
Registered: ‎06-08-2011

Re: CIM Hosted form issues

bump. Please help.

Highlighted
Administrator
Posts: 591
Registered: ‎08-21-2009

Re: CIM Hosted form issues

The first step that I would take in debugging the communicator is to make sure is properly loading. You can do this in most browsers through their developer console. The iFrame containing the communicator would be at the bottom of our own content in the Authorize.Net iFrame.

 

If the communicator is loading, then I really can't think of any reason that your console.log statements wouldn't work.