<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Accept Hosted Form and Redirecting in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-Form-and-Redirecting/m-p/60047#M34613</link>
    <description>&lt;P&gt;Currently no, but it is one of the product ideas being requested:&amp;nbsp; &lt;A href="https://community.developer.authorize.net/t5/Ideas/Accepted-Hosted-Allow-BillTo-and-ShipTo-to-be-submitted-without/idi-p/59239" target="_blank"&gt;https://community.developer.authorize.net/t5/Ideas/Accepted-Hosted-Allow-BillTo-and-ShipTo-to-be-submitted-without/idi-p/59239&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 27 Sep 2017 15:32:13 GMT</pubDate>
    <dc:creator>NexusSoftware</dc:creator>
    <dc:date>2017-09-27T15:32:13Z</dc:date>
    <item>
      <title>Accept Hosted Form and Redirecting</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-Form-and-Redirecting/m-p/59627#M34206</link>
      <description>&lt;P&gt;Hello:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am building a solution using an Authorize.net Accept Hosted form within an iframe. Currently the solution works but not exactly as expected.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;At the moment when a payment is made, the receipt is provided in the iframe window.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My goal is to NOT show a receipt, instead to REDIRECT to a new page that would PROCESS the results and mark the order as complete in the ecommerce engine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;While I followed the instructions in the documentation, it still shows the receipt instead of redirecting.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Based on the documentation I would assume the following would redirect to the processing script instead of showing the receipt:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&amp;lt;setting&amp;gt;
                &amp;lt;settingName&amp;gt;hostedPaymentReturnOptions&amp;lt;/settingName&amp;gt;
                &amp;lt;settingValue&amp;gt;{"showReceipt" : false, "url":"https://www.hiddendomain.com/temp/auth.net/testreceipt.php"}&amp;lt;/settingValue&amp;gt;
&amp;lt;/setting&amp;gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any idea what I am doing wrong?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is the complete code in my test application:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
&amp;lt;?php
$transactionKey = 'hiddentransactionkey';
$api_login_id = 'hiddenloginid';
$url = "https://apitest.authorize.net/xml/v1/request.api";

//token request
$xmlStr = '&amp;lt;getHostedPaymentPageRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"&amp;gt;
&amp;lt;merchantAuthentication&amp;gt;
        &amp;lt;name&amp;gt;'.$api_login_id.'&amp;lt;/name&amp;gt;
        &amp;lt;transactionKey&amp;gt;'.$transactionKey.'&amp;lt;/transactionKey&amp;gt;
&amp;lt;/merchantAuthentication&amp;gt;
&amp;lt;transactionRequest&amp;gt;
        &amp;lt;transactionType&amp;gt;authCaptureTransaction&amp;lt;/transactionType&amp;gt;
        &amp;lt;amount&amp;gt;20.00&amp;lt;/amount&amp;gt;
        &amp;lt;billTo&amp;gt;
         &amp;lt;firstName&amp;gt;Ellen&amp;lt;/firstName&amp;gt;
         &amp;lt;lastName&amp;gt;Johnson&amp;lt;/lastName&amp;gt;
         &amp;lt;company&amp;gt;Souveniropolis&amp;lt;/company&amp;gt;
         &amp;lt;address&amp;gt;14 Main Street&amp;lt;/address&amp;gt;
         &amp;lt;city&amp;gt;Pecan Springs&amp;lt;/city&amp;gt;
         &amp;lt;state&amp;gt;TX&amp;lt;/state&amp;gt;
         &amp;lt;zip&amp;gt;44628&amp;lt;/zip&amp;gt;
         &amp;lt;country&amp;gt;USA&amp;lt;/country&amp;gt;
      &amp;lt;/billTo&amp;gt;
      &amp;lt;shipTo&amp;gt;
         &amp;lt;firstName&amp;gt;China&amp;lt;/firstName&amp;gt;
         &amp;lt;lastName&amp;gt;Bayles&amp;lt;/lastName&amp;gt;
         &amp;lt;company&amp;gt;Thyme for Tea&amp;lt;/company&amp;gt;
         &amp;lt;address&amp;gt;12 Main Street&amp;lt;/address&amp;gt;
         &amp;lt;city&amp;gt;Pecan Springs&amp;lt;/city&amp;gt;
         &amp;lt;state&amp;gt;TX&amp;lt;/state&amp;gt;
         &amp;lt;zip&amp;gt;44628&amp;lt;/zip&amp;gt;
         &amp;lt;country&amp;gt;USA&amp;lt;/country&amp;gt;
      &amp;lt;/shipTo&amp;gt;
&amp;lt;/transactionRequest&amp;gt;
&amp;lt;hostedPaymentSettings&amp;gt;
        &amp;lt;setting&amp;gt;
                &amp;lt;settingName&amp;gt;hostedPaymentBillingAddressOptions&amp;lt;/settingName&amp;gt;
                &amp;lt;settingValue&amp;gt;{"show": false, "required":true}&amp;lt;/settingValue&amp;gt;
        &amp;lt;/setting&amp;gt;
        &amp;lt;setting&amp;gt;
                &amp;lt;settingName&amp;gt;hostedPaymentButtonOptions&amp;lt;/settingName&amp;gt;
                &amp;lt;settingValue&amp;gt;{"text": "Pay"}&amp;lt;/settingValue&amp;gt;
        &amp;lt;/setting&amp;gt;
        &amp;lt;setting&amp;gt;
                &amp;lt;settingName&amp;gt;hostedPaymentReturnOptions&amp;lt;/settingName&amp;gt;
                &amp;lt;settingValue&amp;gt;{"showReceipt" : false, "url":"https://www.hiddendomain.com/temp/auth.net/testreceipt.php"}&amp;lt;/settingValue&amp;gt;
        &amp;lt;/setting&amp;gt;
        &amp;lt;setting&amp;gt;
         &amp;lt;settingName&amp;gt;hostedPaymentShippingAddressOptions&amp;lt;/settingName&amp;gt;
         &amp;lt;settingValue&amp;gt;{"show": false, "required":true}&amp;lt;/settingValue&amp;gt;
      &amp;lt;/setting&amp;gt;
        &amp;lt;setting&amp;gt;
                &amp;lt;settingName&amp;gt;hostedPaymentStyleOptions&amp;lt;/settingName&amp;gt;
                &amp;lt;settingValue&amp;gt;{"bgColor":"red"}&amp;lt;/settingValue&amp;gt;
        &amp;lt;/setting&amp;gt;
        &amp;lt;setting&amp;gt;
                &amp;lt;settingName&amp;gt;hostedPaymentOrderOptions&amp;lt;/settingName&amp;gt;
                &amp;lt;settingValue&amp;gt;{"show": false}&amp;lt;/settingValue&amp;gt;
        &amp;lt;/setting&amp;gt;
&amp;lt;/hostedPaymentSettings&amp;gt;
&amp;lt;/getHostedPaymentPageRequest&amp;gt;';

$xml = new SimpleXMLElement($xmlStr);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/xml'));
curl_setopt($ch, CURLOPT_POSTFIELDS, $xml-&amp;gt;asXML());
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10000);
// The following two curl SSL options are set to "false" for ease of development/debug purposes only.
// Any code used in production should either remove these lines or set them to the appropriate
// values to properly use secure connections for PCI-DSS compliance.
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);    //for production, set value to true or 1
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);    //for production, set value to 2
curl_setopt($ch, CURLOPT_DNS_USE_GLOBAL_CACHE, false);
$content = curl_exec($ch);

$hostedPaymentResponse = new SimpleXMLElement($content);

?&amp;gt;
&amp;lt;iframe id="load_payment" src="https://test.authorize.net/payment/payment?token=&amp;lt;?php echo $hostedPaymentResponse-&amp;gt;token ?&amp;gt;" class="embed-responsive-item" name="load_payment" width="600" height="650" frameborder="1" scrolling="no"&amp;gt;
&amp;lt;/iframe&amp;gt;
&amp;lt;form id="send_hptoken" name="authForm" action="https://test.authorize.net/payment/payment" method="post" target="load_payment" &amp;gt;
&amp;lt;input type="hidden" name="token" value="&amp;lt;?php echo $hostedPaymentResponse-&amp;gt;token ?&amp;gt;" /&amp;gt;
&amp;lt;/form&amp;gt;
&amp;lt;script&amp;gt;
document.authForm.submit();
&amp;lt;/script&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 31 Aug 2017 14:36:17 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-Form-and-Redirecting/m-p/59627#M34206</guid>
      <dc:creator>mwex501</dc:creator>
      <dc:date>2017-08-31T14:36:17Z</dc:date>
    </item>
    <item>
      <title>Re: Accept Hosted Form and Redirecting</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-Form-and-Redirecting/m-p/59635#M34214</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You need to specify an iframe communicator url, an example of which is at&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://github.com/AuthorizeNet/accept-sample-app/blob/master/IFrameCommunicator.html" target="_blank" rel="nofollow noopener noreferrer"&gt;https://github.com/AuthorizeNet/accept-sample-app/blob/master/IFrameCommunicator.html&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and handle the response in your parent page:&lt;/P&gt;&lt;PRE&gt;&amp;lt;setting&amp;gt;
&amp;lt;settingName&amp;gt;hostedPaymentIFrameCommunicatorUrl&amp;lt;/settingName&amp;gt;
&amp;lt;settingValue&amp;gt;{"url": "https://YOUR_FANCY_WEBSITE.COM/icommunicator.html"}&amp;lt;/settingValue&amp;gt;
&amp;lt;/setting&amp;gt;	&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;To handle the response, you could have something like the following in your parent page:&lt;/P&gt;&lt;PRE&gt;&amp;lt;script&amp;gt;
    window.CommunicationHandler = {};
    function parseQueryString(str) {
        var vars = [];
        var arr = str.split('&amp;amp;');
        var pair;
        for (var i = 0; i &amp;lt; arr.length; i++) {
            pair = arr[i].split('=');
            vars[pair[0]] = unescape(pair[1]);
        }
        return vars;
    }
    window.CommunicationHandler.onReceiveCommunication = function (argument) {
        params = parseQueryString(argument.qstr)
        parentFrame = argument.parent.split('/')[4];
        switch (params['action']) {
            case "transactResponse":
                var transResponse = JSON.parse(params['response']);
if (transResponse.transId &amp;gt; 0) {&lt;BR /&gt;$('#load_payment').hide();&lt;BR /&gt;$('#demo').html("Thank you. Your Transaction Id is: "+transResponse.transId);&lt;BR /&gt;&lt;BR /&gt; }           &lt;BR /&gt;                                
        }

    }

&amp;lt;/script&amp;gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2017 19:16:23 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-Form-and-Redirecting/m-p/59635#M34214</guid>
      <dc:creator>NexusSoftware</dc:creator>
      <dc:date>2017-08-31T19:16:23Z</dc:date>
    </item>
    <item>
      <title>Re: Accept Hosted Form and Redirecting</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-Form-and-Redirecting/m-p/60025#M34593</link>
      <description>&lt;P&gt;TY for the response but this doesn't seem to work.&lt;/P&gt;&lt;P&gt;Seems that action is always "resizeWindow" and never "transactResponse" even when the transaction is completed.&lt;/P&gt;&lt;P&gt;Note I am in sandbox mode if that effects the responses.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Sep 2017 17:47:06 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-Form-and-Redirecting/m-p/60025#M34593</guid>
      <dc:creator>mwex501</dc:creator>
      <dc:date>2017-09-26T17:47:06Z</dc:date>
    </item>
    <item>
      <title>Re: Accept Hosted Form and Redirecting</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-Form-and-Redirecting/m-p/60031#M34598</link>
      <description>&lt;P&gt;To see what is being passed, you could try :&lt;/P&gt;&lt;PRE&gt;console.log(params);&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Do you have a live URL to check out? Posting to the Sandbox doesn't make any difference.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Sep 2017 21:26:12 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-Form-and-Redirecting/m-p/60031#M34598</guid>
      <dc:creator>NexusSoftware</dc:creator>
      <dc:date>2017-09-26T21:26:12Z</dc:date>
    </item>
    <item>
      <title>Re: Accept Hosted Form and Redirecting</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-Form-and-Redirecting/m-p/60043#M34609</link>
      <description>&lt;P&gt;I set up a test script here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.breyerhorses.com/temp/auth.net/test.php" target="_blank"&gt;https://www.breyerhorses.com/temp/auth.net/test.php&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The iframe communicator is located here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.breyerhorses.com/temp/auth.net/authnet_iframe_communicator.html" target="_blank"&gt;https://www.breyerhorses.com/temp/auth.net/authnet_iframe_communicator.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The outstanding issues are:&lt;/P&gt;&lt;P&gt;* The only action I receive is resize window (I am logging the actions to the console)&lt;/P&gt;&lt;P&gt;* Also, though I am sending an address, it is returning a BLANK address on the THANK YOU page. My objective is to send an address from our cart and not allow the customer to modify it in the hosted window.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is the code in test.php:&lt;/P&gt;&lt;PRE&gt;&amp;lt;?php

$transactionKey = ''; // removed to protect the innocent
$api_login_id = '';
$url = "https://apitest.authorize.net/xml/v1/request.api";

$xmlStr = '&amp;lt;getHostedPaymentPageRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"&amp;gt;
&amp;lt;merchantAuthentication&amp;gt;
        &amp;lt;name&amp;gt;'.$api_login_id.'&amp;lt;/name&amp;gt;
        &amp;lt;transactionKey&amp;gt;'.$transactionKey.'&amp;lt;/transactionKey&amp;gt;
&amp;lt;/merchantAuthentication&amp;gt;
&amp;lt;transactionRequest&amp;gt;
        &amp;lt;transactionType&amp;gt;authCaptureTransaction&amp;lt;/transactionType&amp;gt;
        &amp;lt;amount&amp;gt;1.00&amp;lt;/amount&amp;gt;
&amp;lt;order&amp;gt;
&amp;lt;invoiceNumber&amp;gt;1&amp;lt;/invoiceNumber&amp;gt;
&amp;lt;/order&amp;gt;
        &amp;lt;billTo&amp;gt;
         &amp;lt;firstName&amp;gt;bfirst&amp;lt;/firstName&amp;gt;
         &amp;lt;lastName&amp;gt;blast&amp;lt;/lastName&amp;gt;
         &amp;lt;company&amp;gt;bcompany&amp;lt;/company&amp;gt;
         &amp;lt;address&amp;gt;baddress&amp;lt;/address&amp;gt;
         &amp;lt;city&amp;gt;bcity&amp;lt;/city&amp;gt;
         &amp;lt;state&amp;gt;MD&amp;lt;/state&amp;gt;
         &amp;lt;zip&amp;gt;12345&amp;lt;/zip&amp;gt;
         &amp;lt;country&amp;gt;US&amp;lt;/country&amp;gt;
      &amp;lt;/billTo&amp;gt;
      &amp;lt;shipTo&amp;gt;
         &amp;lt;firstName&amp;gt;sfirst&amp;lt;/firstName&amp;gt;
         &amp;lt;lastName&amp;gt;slast&amp;lt;/lastName&amp;gt;
         &amp;lt;company&amp;gt;scompany&amp;lt;/company&amp;gt;
         &amp;lt;address&amp;gt;saddress&amp;lt;/address&amp;gt;
         &amp;lt;city&amp;gt;scity&amp;lt;/city&amp;gt;
         &amp;lt;state&amp;gt;MD&amp;lt;/state&amp;gt;
         &amp;lt;zip&amp;gt;23456&amp;lt;/zip&amp;gt;
         &amp;lt;country&amp;gt;US&amp;lt;/country&amp;gt;
      &amp;lt;/shipTo&amp;gt;

&amp;lt;/transactionRequest&amp;gt;
&amp;lt;hostedPaymentSettings&amp;gt;
        &amp;lt;setting&amp;gt;
                &amp;lt;settingName&amp;gt;hostedPaymentBillingAddressOptions&amp;lt;/settingName&amp;gt;
                &amp;lt;settingValue&amp;gt;{"show": false, "required":false}&amp;lt;/settingValue&amp;gt;
        &amp;lt;/setting&amp;gt;
        &amp;lt;setting&amp;gt;
                &amp;lt;settingName&amp;gt;hostedPaymentButtonOptions&amp;lt;/settingName&amp;gt;
                &amp;lt;settingValue&amp;gt;{"text": "Pay"}&amp;lt;/settingValue&amp;gt;
        &amp;lt;/setting&amp;gt;
        &amp;lt;setting&amp;gt;
                &amp;lt;settingName&amp;gt;hostedPaymentReturnOptions&amp;lt;/settingName&amp;gt;
                &amp;lt;settingValue&amp;gt;{"url":"https://www.breyerhorses.com/temp/auth.net/authnet_response.php?action=continue","urlText":"Continue","cancelUrl":"https://www.breyerhorses.com/temp/auth.net/authnet_response.php?action=cancel","cancelUrlText":"Cancel"}&amp;lt;/settingValue&amp;gt;
        &amp;lt;/setting&amp;gt;
        &amp;lt;setting&amp;gt;
         &amp;lt;settingName&amp;gt;hostedPaymentShippingAddressOptions&amp;lt;/settingName&amp;gt;
         &amp;lt;settingValue&amp;gt;{"show": false, "required":false}&amp;lt;/settingValue&amp;gt;
&amp;lt;/setting&amp;gt;
        &amp;lt;setting&amp;gt;
                &amp;lt;settingName&amp;gt;hostedPaymentStyleOptions&amp;lt;/settingName&amp;gt;
                &amp;lt;settingValue&amp;gt;{"bgColor":"#B00"}&amp;lt;/settingValue&amp;gt;
        &amp;lt;/setting&amp;gt;
        &amp;lt;setting&amp;gt;
                &amp;lt;settingName&amp;gt;hostedPaymentIFrameCommunicatorUrl&amp;lt;/settingName&amp;gt;
                &amp;lt;settingValue&amp;gt;{"url": "https://www.breyerhorses.com/temp/auth.net/authnet_iframe_communicator.html"}&amp;lt;/settingValue&amp;gt;
        &amp;lt;/setting&amp;gt;
&amp;lt;/hostedPaymentSettings&amp;gt;
&amp;lt;/getHostedPaymentPageRequest&amp;gt;';

$xml = new SimpleXMLElement($xmlStr);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/xml'));

curl_setopt($ch, CURLOPT_POSTFIELDS, $xml-&amp;gt;asXML());
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10000);
// The following two curl SSL options are set to "false" for ease of development/debug purposes only.
// Any code used in production should either remove these lines or set them to the appropriate
// values to properly use secure connections for PCI-DSS compliance.
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);    //for production, set value to true or 1
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);    //for production, set value to 2
curl_setopt($ch, CURLOPT_DNS_USE_GLOBAL_CACHE, false);


$content = curl_exec($ch);

$hostedPaymentResponse = new SimpleXMLElement($content);
$hostedPaymentToken = $hostedPaymentResponse-&amp;gt;token;
?&amp;gt;
&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
&amp;lt;script&amp;gt;
    window.CommunicationHandler = {};
    function parseQueryString(str) {
        var vars = [];
        var arr = str.split('&amp;amp;');
        var pair;
        for (var i = 0; i &amp;lt; arr.length; i++) {
            pair = arr[i].split('=');
            vars[pair[0]] = unescape(pair[1]);
        }
        return vars;
    }
    window.CommunicationHandler.onReceiveCommunication = function (argument) {
console.log('onReceiveCommunication');
console.log(argument);
        params = parseQueryString(argument.qstr)
console.log(params);
        parentFrame = argument.parent.split('/')[4];
        switch (params['action']) {
            case "transactResponse":
                var transResponse = JSON.parse(params['response']);
if (transResponse.transId &amp;gt; 0) {
console.log('transId:'+transResponse.transId);
//$('#load_payment').hide();
//$('#demo').html("Thank you. Your Transaction Id is: "+transResponse.transId);

 }          break;
             case "resizeWindow":
var win = document.getElementById('load_payment');
win.style.height = params['height'];
break;

        }

    }

&amp;lt;/script&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
&amp;lt;iframe id="load_payment" class="embed-responsive-item" name="load_payment" width="600" height="650" frameborder="1" scrolling="no"&amp;gt;&amp;lt;/iframe&amp;gt;
&amp;lt;form id="send_hptoken" name="authForm" action="https://test.authorize.net/payment/payment" method="post" target="load_payment" &amp;gt;
&amp;lt;input type="hidden" name="token" value="&amp;lt;?php echo $hostedPaymentToken; ?&amp;gt;" /&amp;gt;
&amp;lt;/form&amp;gt;
&amp;lt;script&amp;gt;
document.authForm.submit();
&amp;lt;/script&amp;gt;
&amp;lt;/body&amp;gt;

&amp;lt;/html&amp;gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Sep 2017 13:26:57 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-Form-and-Redirecting/m-p/60043#M34609</guid>
      <dc:creator>mwex501</dc:creator>
      <dc:date>2017-09-27T13:26:57Z</dc:date>
    </item>
    <item>
      <title>Re: Accept Hosted Form and Redirecting</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-Form-and-Redirecting/m-p/60044#M34610</link>
      <description>&lt;P&gt;What works at &lt;A href="https://nexwebhost.com/authorizenet/get-hosted.html" target="_blank"&gt;https://nexwebhost.com/authorizenet/get-hosted.html&lt;/A&gt;, is&amp;nbsp;posting the following XML:&lt;/P&gt;&lt;PRE&gt;&amp;lt;getHostedPaymentPageRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"&amp;gt;
  &amp;lt;merchantAuthentication&amp;gt;
    &amp;lt;name&amp;gt;YOUR_LOGIN&amp;lt;/name&amp;gt;
    &amp;lt;transactionKey&amp;gt;YOUR_TRANSACTION_KEY&amp;lt;/transactionKey&amp;gt;
  &amp;lt;/merchantAuthentication&amp;gt;
  &amp;lt;transactionRequest&amp;gt;
    &amp;lt;transactionType&amp;gt;authCaptureTransaction&amp;lt;/transactionType&amp;gt;
    &amp;lt;amount&amp;gt;'.$amount.'&amp;lt;/amount&amp;gt;
  &amp;lt;/transactionRequest&amp;gt;
  &amp;lt;hostedPaymentSettings&amp;gt;
    &amp;lt;setting&amp;gt;
      &amp;lt;settingName&amp;gt;hostedPaymentIFrameCommunicatorUrl&amp;lt;/settingName&amp;gt;
      &amp;lt;settingValue&amp;gt;{"url": "https://nexwebhost.com/authorizenet/iCommunicator.html"}&amp;lt;/settingValue&amp;gt;
    &amp;lt;/setting&amp;gt;
    &amp;lt;setting&amp;gt;
      &amp;lt;settingName&amp;gt;hostedPaymentBillingAddressOptions&amp;lt;/settingName&amp;gt;
      &amp;lt;settingValue&amp;gt;{"show": false, "required":false}&amp;lt;/settingValue&amp;gt;
    &amp;lt;/setting&amp;gt;
    &amp;lt;setting&amp;gt;
      &amp;lt;settingName&amp;gt;hostedPaymentButtonOptions&amp;lt;/settingName&amp;gt;
      &amp;lt;settingValue&amp;gt;{"text": "Pay"}&amp;lt;/settingValue&amp;gt;
    &amp;lt;/setting&amp;gt;
    &amp;lt;setting&amp;gt;
      &amp;lt;settingName&amp;gt;hostedPaymentReturnOptions&amp;lt;/settingName&amp;gt;
      &amp;lt;settingValue&amp;gt;{"showReceipt" : false, "url":"https://nexwebhost.com","urlText":"Continue","cancelUrl":"https://nexwebhost.com","cancelUrlText":"Cancel"}&amp;lt;/settingValue&amp;gt;
    &amp;lt;/setting&amp;gt;
  &amp;lt;/hostedPaymentSettings&amp;gt;
&amp;lt;/getHostedPaymentPageRequest&amp;gt;&lt;/PRE&gt;&lt;P&gt;The following script in iCommunicator.html:&lt;/P&gt;&lt;PRE&gt;&amp;lt;script type="text/javascript"&amp;gt;

 function callParentFunction(str) {
   if (str &amp;amp;&amp;amp; str.length &amp;gt; 0 &amp;amp;&amp;amp; window.parent &amp;amp;&amp;amp; window.parent.parent 
     &amp;amp;&amp;amp; window.parent.parent.CommunicationHandler &amp;amp;&amp;amp; window.parent.parent.CommunicationHandler.onReceiveCommunication)
   {
      var referrer = document.domain;
      window.parent.parent.CommunicationHandler.onReceiveCommunication({qstr : str , parent : referrer});
   }
 }
 
 function receiveMessage(event) {
   if (event &amp;amp;&amp;amp; 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 &amp;amp;&amp;amp; window.location.hash.length &amp;gt; 1) {
   callParentFunction(window.location.hash.substring(1));
 }

 &amp;lt;/script&amp;gt;&lt;/PRE&gt;&lt;P&gt;And the following script on the parent page:&lt;/P&gt;&lt;PRE&gt;	&amp;lt;script&amp;gt;
    window.CommunicationHandler = {};
    function parseQueryString(str) {
        var vars = [];
        var arr = str.split('&amp;amp;');
        var pair;
        for (var i = 0; i &amp;lt; arr.length; i++) {
            pair = arr[i].split('=');
            vars[pair[0]] = unescape(pair[1]);
        }
        return vars;
    }
    window.CommunicationHandler.onReceiveCommunication = function (argument) {
        params = parseQueryString(argument.qstr)
        parentFrame = argument.parent.split('/')[4];
        switch (params['action']) {
            case "transactResponse":
                var transResponse = JSON.parse(params['response']);
if (transResponse.transId &amp;gt; 0) {
$('#payform').hide();
$('#payframe').hide();
$('#response').html("Thank you. Your Transaction Id is: "+transResponse.transId);

 }           
                                
        }

    }

&amp;lt;/script&amp;gt;&lt;/PRE&gt;&lt;P&gt;If you have&amp;nbsp;hostedPaymentBillingAddressOptions set to false, then the billing address wll not be passed.&lt;/P&gt;&lt;PRE&gt;&amp;lt;setting&amp;gt;
       &amp;lt;settingName&amp;gt;hostedPaymentBillingAddressOptions&amp;lt;/settingName&amp;gt;
         &amp;lt;settingValue&amp;gt;{"show": false, "required":false}&amp;lt;/settingValue&amp;gt;
        &amp;lt;/setting&amp;gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Sep 2017 14:23:04 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-Form-and-Redirecting/m-p/60044#M34610</guid>
      <dc:creator>NexusSoftware</dc:creator>
      <dc:date>2017-09-27T14:23:04Z</dc:date>
    </item>
    <item>
      <title>Re: Accept Hosted Form and Redirecting</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-Form-and-Redirecting/m-p/60046#M34612</link>
      <description>&lt;PRE&gt;"showReceipt" : false,&lt;/PRE&gt;&lt;P&gt;did the trick to allow the &amp;nbsp;transactResponse messages to start showing. Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So is there anyway to pass the address to the token and NOT allow the customer to change that address in the hosted iframe?&lt;/P&gt;</description>
      <pubDate>Wed, 27 Sep 2017 15:23:28 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-Form-and-Redirecting/m-p/60046#M34612</guid>
      <dc:creator>mwex501</dc:creator>
      <dc:date>2017-09-27T15:23:28Z</dc:date>
    </item>
    <item>
      <title>Re: Accept Hosted Form and Redirecting</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-Form-and-Redirecting/m-p/60047#M34613</link>
      <description>&lt;P&gt;Currently no, but it is one of the product ideas being requested:&amp;nbsp; &lt;A href="https://community.developer.authorize.net/t5/Ideas/Accepted-Hosted-Allow-BillTo-and-ShipTo-to-be-submitted-without/idi-p/59239" target="_blank"&gt;https://community.developer.authorize.net/t5/Ideas/Accepted-Hosted-Allow-BillTo-and-ShipTo-to-be-submitted-without/idi-p/59239&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Sep 2017 15:32:13 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-Form-and-Redirecting/m-p/60047#M34613</guid>
      <dc:creator>NexusSoftware</dc:creator>
      <dc:date>2017-09-27T15:32:13Z</dc:date>
    </item>
    <item>
      <title>Re: Accept Hosted Form and Redirecting</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-Form-and-Redirecting/m-p/62145#M36516</link>
      <description>&lt;P&gt;Could you please advise on which tag should have, "showReceipt": false, value. ??.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We tried putting for "hostedPaymentReturnOptions' still it was not working as expected.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Mar 2018 12:24:20 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-Form-and-Redirecting/m-p/62145#M36516</guid>
      <dc:creator>Sangu123</dc:creator>
      <dc:date>2018-03-16T12:24:20Z</dc:date>
    </item>
  </channel>
</rss>

