cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

how to make the Iframe communicator page redirect to our custom receipt page

Hi there,

 

We are almost towards the completion of the authorize.net integration with our own application. We have been receiving the response parameters through IframeCommunicator page. As of now we have set the "showReceipt" parameter in the "hostedPaymentReturnOptions" accept hosted page setting to "false" because if its set to "true" it redirects to our custom receipt page without returning any response parameters. we would like t know if there is a way to redirect to our page from the iframe communicator while getting the transaction response parameters along.

 

Thanks in advance.

Mohammed
Contributor
6 REPLIES 6

Hi @Mohammed

 

When you embed our hosted form in an IFrame on your page, our hosted form can in turn embed your IFrameCommunicator page within it inside an invisible IFrame. This enables a channel of communication that allows us to send messages to your IFrameCommunicator page. Then, as long as your IFrameCommunicator page is hosted on the same domain as your main page, it can communicate back to your main page.

This channel of communication is used to pass a few basic messages back to a listener script running on your main page (the page that calls the form):

  • Ideal height and width of the window - enables you to resize the frame and avoid any scrollbars from appearing.
  • Request Succeeded - returned when the transaction is completed at Authorize.Net. You can use this notification to know when to look for those changes through the Transaction Reporting API. Transaction response parameters (such as transaction ID) are returned with this notification.
  • Request Cancelled - returned when the customer cancels the hosted form.

 

For an example of an IFrameCommunicator page and more information about the messages passed, see our sample IFrameCommunicator.html in our sample application on GitHub.





Send feedback at developer_feedback@authorize.net
Anurag
Moderator Moderator
Moderator

Can someone please post a php example of how to handle Request Succeeded?  I don't see any examples of this.

tapseries
Contributor

Hi @tapseries

 

Have you checkout this https://github.com/AuthorizeNet/accept-sample-app/blob/master/README-AcceptHosted.md

 

Hope it helps !!!





Send feedback at developer_feedback@authorize.net

Thanks.  I am trying to redirect to a receipt page that already exists.  I tried the code below, but it still shows the auth.net receipt.

 

 

<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)
   {
     window.parent.parent.CommunicationHandler.onReceiveCommunication = function (argument) {
        params = parseQueryString(argument.qstr)
        parentFrame = argument.parent.split('/')[4];
        switch (params['action']) {
           case "transactResponse": 	
   			$('#HostedPayment').attr('src','<receipt url>');
              
        }

    }
 
	  
   }
 }

 

tapseries
Contributor

I just tried the custom receipt code in the readme file and I still get an auth. net receipt page.

tapseries
Contributor

hi @tapseries

 

Can you please  post the request you passing for getHostedPaymentPage API ?

 

Thanks





Send feedback at developer_feedback@authorize.net