Reply
Member
Posts: 6
Registered: ‎08-07-2019

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.

Member
Posts: 6
Registered: ‎08-07-2019

Re: Accept Hosted Response

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>

Member
Posts: 6
Registered: ‎08-07-2019

Re: Accept Hosted Response

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.

New Member
Posts: 1
Registered: ‎08-11-2019

Re: Accept Hosted Response


@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.

Member
Posts: 6
Registered: ‎08-07-2019

Re: Accept Hosted 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.

Member
Posts: 5
Registered: ‎08-15-2019

Re: Accept Hosted Response

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.