cancel
Showing results for 
Search instead for 
Did you mean: 

Accept Hosted Response

Hi there.  I know this isn't a new topic, but I've browsed the related messages that I could find - honest - and am still struggling.  I have "everything" working except I can't seem to access a response for an Accept Hosted transaction.

 

Let me try to boil it down to the nitty gritty.

 

A.  If I set "hostedPaymentReturnOptions.showReceipt" to true, test payments are accepted and upon clicking the button defined by "hostedPaymentReturnOptions.urlText" (aka "Continue") I am redirected to the "hostedPaymentReturnOptions.url", but I don't get any response.

 

B.  But, if I set "hostedPaymentReturnOptions.showReceipt" to false, the "Processing..." button just stays as such and nothing further ever happens.

 

Thanks in advance.

redherring917
Member
1 ACCEPTED SOLUTION

Accepted Solutions

When I had the "Processing..." sit there I opened Chrome Developer Tools, clicked the Console tab, and it informed me that I had a JavaScript bug. Another thing you might try is the "console.log('MyFunction() is a executing');" route. I'm guessing you've already tried these, but just in case...

View solution in original post

7 REPLIES 7

To add a bit of detail, with hostedPaymentReturnOptions.showReceipt set to false, when the iframed Authorize payment form is initially loaded it DOES certainly call my hostedPaymentIFrameCommunicatorUrl page, as evidenced by the following javascript alert:

 

#action=resizeWindow&width=2418&height=540.313

 

But again, clicking the "Pay" button simply leaves the form in a "Processing..." state that never seems to complete.

 

Currently my hostedPaymentIFrameCommunicatorUrl page's content is simply that of the generic sample, shown below.

 

Thanks.

 

*******************

 

 

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>IFrame Communicator</title>

<!--
To securely communicate between our Accept Hosted form and your web page,
we need a communicator page which will be hosted on your site alongside
your checkout/payment page. You can provide the URL of the communicator
page in your token request, which will allow Authorize.Net to embed the
communicator page in the payment form, and send JavaScript messaging through
your communicator page to a listener script on your main page.

This page contains a JavaScript that listens for events from the payment
form and passes them to an event listener in the main page.
-->


<script type="text/javascript">

function callParentFunction(str) {
if (str && str.length > 0 && window.parent && window.parent.parent
&& window.parent.parent.CommunicationHandler && window.parent.parent.CommunicationHandler.onReceiveCommunication)
{
var referrer = document.referrer;

window.parent.parent.CommunicationHandler.onReceiveCommunication({qstr : str , parent : referrer});
}
}

function receiveMessage(event) {
if (event && event.data) {
callParentFunction(event.data);
}
}

if (window.addEventListener) {
window.addEventListener("message", receiveMessage, false);
} else if (window.attachEvent) {
window.attachEvent("onmessage", receiveMessage);
}

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

</script>
</head>
<body>
</body>
</html>

redherring917
Member

Thought maybe I should be more specific / clearer / more succinct.

 

  • I'm using iframe
  • hostedPaymentReturnOptions.showReceipt is set to false, therefore no url defined
  • hostedPaymentIFrameCommunicatorUrl.url is defined

 

When I click on the "Pay" button it changes to a muted "Processing..." and just hangs there like that. 

 

This seems like it should be so simple.  Suggestions / hints / advice would be oh so greatly appreciated.

 

Thanks.


@redherring917 wrote:

Thought maybe I should be more specific / clearer / more succinct.

 

  • I'm using iframe
  • hostedPaymentReturnOptions.showReceipt is set to false, therefore no url defined
  • hostedPaymentIFrameCommunicatorUrl.url is defined

 

When I click on the "Pay" button it changes to a muted "Processing..." and just hangs there like that. 

 

This seems like it should be so simple.  Suggestions / hints / advice would be oh so greatly appreciated.

 

Thanks.


If I set "hostedPaymentReturnOptions.showReceipt" to true, test payments are accepted and upon clicking the button defined by "hostedPaymentReturnOptions.urlText" (aka "Continue") I am redirected to the "hostedPaymentReturnOptions.url", but I don't get any response.

Nice, useless SPAM link.  I'm assuming some admin can ban that user?  Certainly seems appropriate.

 

It would be great to get some input on this as I find myself rather stuck at the moment.

 

Thanks.

We are seeing similar behavior, except that it's just taking about ninety seconds to 'process' on the sandbox environment. Today is the first day I've been working on it but I was surprised to see it taking so long and certainly hope that's not how things behave on production.

 

It looks to me like the sample code with showReceipt set to false will not actually POST the results anywhere -- the docs are a little ambiguous in suggesting that it will automatically POST to the URL you specify even with showReceipt false (or at least some of the other threads on the subject) but it looks instead like it just sets the value of #popupToken to the Authorize.net result JSON struct.

When I had the "Processing..." sit there I opened Chrome Developer Tools, clicked the Console tab, and it informed me that I had a JavaScript bug. Another thing you might try is the "console.log('MyFunction() is a executing');" route. I'm guessing you've already tried these, but just in case...

Thanks for your reply.  It was in fact a javascript bug on my end that Authorize was able to direct me to.  I felt pretty silly when that ended up being the case, but somehow I never made the connection before they enlightened me :|

 

Thanks again.