<?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 Authorized.net iframe communicator not return the transaction id. in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Authorized-net-iframe-communicator-not-return-the-transaction-id/m-p/83354#M52573</link>
    <description>&lt;P&gt;&lt;STRONG&gt;i have two problem.&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;if i use iframe in the my code form action not redirected to&amp;nbsp;&lt;A href="https://test.authorize.net/payment/payment" target="_blank" rel="noopener"&gt;https://test.authorize.net/payment/payment&lt;/A&gt;.&lt;BR /&gt;&lt;EM&gt;&amp;lt;&lt;STRONG&gt;iframe&lt;/STRONG&gt; id="load_payment" class="embed-responsive-item" name="load_payment" width="100%" height="650px" frameborder="0" scrolling="no" hidden="true"&amp;gt;&amp;lt;/iframe&amp;gt;&amp;lt;form action="&lt;A href="https://test.authorize.net/payment/payment" target="_blank" rel="noopener"&gt;https://test.authorize.net/payment/payment&lt;/A&gt;" id="formAuthorizeNetTestPage" method="post" target="load_payment" name="formAuthorizeNetTestPage"&amp;gt;&amp;lt;input id="token_val" name="token" type="hidden" value="generated_token"/&amp;gt;&amp;lt;button id="btnContinue"&amp;gt;Pay&amp;lt;/button&amp;gt;&amp;lt;/form&amp;gt;&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;if i remove &lt;STRONG&gt;iframe&lt;/STRONG&gt; it will go to payment form and i'll enter card no,exp date,card code it will show the receipt of the transaction.&amp;nbsp;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;form action="&lt;A href="https://test.authorize.net/payment/payment" target="_blank" rel="noopener"&gt;https://test.authorize.net/payment/payment&lt;/A&gt;" id="formAuthorizeNetTestPage" method="post"&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;target="load_payment" name="formAuthorizeNetTestPage"&amp;gt;&amp;lt;input id="token_val" name="token" type="hidden" value="generated_token"/&amp;gt;&amp;lt;button id="btnContinue"&amp;gt;Pay&amp;lt;/button&amp;gt;&amp;lt;/form&amp;gt;&lt;/EM&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Tested in our site:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Already included the&amp;nbsp;IFrameCommunicator.html script also but script is not loaded.for the testing purpose i added alert in the script but alert also not triggered. Below i'll share my tested script.&lt;/LI&gt;&lt;LI&gt;&amp;lt;Files IFrameCommunicator.html&amp;gt;&lt;BR /&gt;Header set Content-Security-Policy "frame-ancestors 'self' *.&lt;A href="http://localhost/project/" target="_blank" rel="noopener"&gt;http://localhost/project/&lt;/A&gt; *.authorize.net"&lt;BR /&gt;&amp;lt;/Files&amp;gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;STRONG&gt;Need solution for:&lt;/STRONG&gt; Get the transaction id from accepted hosted form and then show into our parent page (our site).&lt;BR /&gt;&lt;BR /&gt;Code sample:&lt;BR /&gt;&lt;STRONG&gt;IFrameCommunicator.html&lt;/STRONG&gt;&lt;BR /&gt;&amp;lt;script&amp;gt;&lt;/P&gt;&lt;P&gt;window.CommunicationHandler = {};&lt;BR /&gt;function parseQueryString(str) {&lt;BR /&gt;alert("iii hee");&lt;BR /&gt;var vars = [];&lt;BR /&gt;var arr = str.split('&amp;amp;');&lt;BR /&gt;var pair;&lt;BR /&gt;for (var i = 0; i &amp;lt; arr.length; i++) {&lt;BR /&gt;pair = arr[i].split('=');&lt;BR /&gt;vars[pair[0]] = unescape(pair[1]);&lt;BR /&gt;}&lt;BR /&gt;return vars;&lt;BR /&gt;}&lt;BR /&gt;window.CommunicationHandler.onReceiveCommunication = function (argument) {&lt;BR /&gt;params = parseQueryString(argument.qstr)&lt;BR /&gt;parentFrame = argument.parent.split('/')[4];&lt;BR /&gt;switch (params['action']) {&lt;BR /&gt;case "transactResponse":&lt;BR /&gt;var transResponse = JSON.parse(params['response']);&lt;BR /&gt;if (transResponse.transId &amp;gt; 0) {&lt;BR /&gt;alert(transResponse.transId);&lt;/P&gt;&lt;P&gt;}&lt;BR /&gt;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;lt;/script&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Mytoken_generation_accepted_host.php&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;$setting3 = new AnetAPI\SettingType();&lt;BR /&gt;$setting3-&amp;gt;setSettingName("hostedPaymentReturnOptions");&lt;BR /&gt;$setting3-&amp;gt;setSettingValue("{\"showReceipt\" : false }");&lt;/P&gt;&lt;P&gt;$commUrl = json_encode(array('url' =&amp;gt; $homeurl."IFrameCommunicator.html" ), JSON_UNESCAPED_SLASHES);&lt;/P&gt;&lt;P&gt;$setting7 = new AnetAPI\SettingType();&lt;BR /&gt;$setting7-&amp;gt;setSettingName("hostedPaymentIFrameCommunicatorUrl");&lt;BR /&gt;$setting7-&amp;gt;setSettingValue($commUrl);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 07 Jul 2022 15:16:55 GMT</pubDate>
    <dc:creator>mounica</dc:creator>
    <dc:date>2022-07-07T15:16:55Z</dc:date>
    <item>
      <title>Authorized.net iframe communicator not return the transaction id.</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Authorized-net-iframe-communicator-not-return-the-transaction-id/m-p/83354#M52573</link>
      <description>&lt;P&gt;&lt;STRONG&gt;i have two problem.&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;if i use iframe in the my code form action not redirected to&amp;nbsp;&lt;A href="https://test.authorize.net/payment/payment" target="_blank" rel="noopener"&gt;https://test.authorize.net/payment/payment&lt;/A&gt;.&lt;BR /&gt;&lt;EM&gt;&amp;lt;&lt;STRONG&gt;iframe&lt;/STRONG&gt; id="load_payment" class="embed-responsive-item" name="load_payment" width="100%" height="650px" frameborder="0" scrolling="no" hidden="true"&amp;gt;&amp;lt;/iframe&amp;gt;&amp;lt;form action="&lt;A href="https://test.authorize.net/payment/payment" target="_blank" rel="noopener"&gt;https://test.authorize.net/payment/payment&lt;/A&gt;" id="formAuthorizeNetTestPage" method="post" target="load_payment" name="formAuthorizeNetTestPage"&amp;gt;&amp;lt;input id="token_val" name="token" type="hidden" value="generated_token"/&amp;gt;&amp;lt;button id="btnContinue"&amp;gt;Pay&amp;lt;/button&amp;gt;&amp;lt;/form&amp;gt;&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;if i remove &lt;STRONG&gt;iframe&lt;/STRONG&gt; it will go to payment form and i'll enter card no,exp date,card code it will show the receipt of the transaction.&amp;nbsp;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;form action="&lt;A href="https://test.authorize.net/payment/payment" target="_blank" rel="noopener"&gt;https://test.authorize.net/payment/payment&lt;/A&gt;" id="formAuthorizeNetTestPage" method="post"&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;target="load_payment" name="formAuthorizeNetTestPage"&amp;gt;&amp;lt;input id="token_val" name="token" type="hidden" value="generated_token"/&amp;gt;&amp;lt;button id="btnContinue"&amp;gt;Pay&amp;lt;/button&amp;gt;&amp;lt;/form&amp;gt;&lt;/EM&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Tested in our site:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Already included the&amp;nbsp;IFrameCommunicator.html script also but script is not loaded.for the testing purpose i added alert in the script but alert also not triggered. Below i'll share my tested script.&lt;/LI&gt;&lt;LI&gt;&amp;lt;Files IFrameCommunicator.html&amp;gt;&lt;BR /&gt;Header set Content-Security-Policy "frame-ancestors 'self' *.&lt;A href="http://localhost/project/" target="_blank" rel="noopener"&gt;http://localhost/project/&lt;/A&gt; *.authorize.net"&lt;BR /&gt;&amp;lt;/Files&amp;gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;STRONG&gt;Need solution for:&lt;/STRONG&gt; Get the transaction id from accepted hosted form and then show into our parent page (our site).&lt;BR /&gt;&lt;BR /&gt;Code sample:&lt;BR /&gt;&lt;STRONG&gt;IFrameCommunicator.html&lt;/STRONG&gt;&lt;BR /&gt;&amp;lt;script&amp;gt;&lt;/P&gt;&lt;P&gt;window.CommunicationHandler = {};&lt;BR /&gt;function parseQueryString(str) {&lt;BR /&gt;alert("iii hee");&lt;BR /&gt;var vars = [];&lt;BR /&gt;var arr = str.split('&amp;amp;');&lt;BR /&gt;var pair;&lt;BR /&gt;for (var i = 0; i &amp;lt; arr.length; i++) {&lt;BR /&gt;pair = arr[i].split('=');&lt;BR /&gt;vars[pair[0]] = unescape(pair[1]);&lt;BR /&gt;}&lt;BR /&gt;return vars;&lt;BR /&gt;}&lt;BR /&gt;window.CommunicationHandler.onReceiveCommunication = function (argument) {&lt;BR /&gt;params = parseQueryString(argument.qstr)&lt;BR /&gt;parentFrame = argument.parent.split('/')[4];&lt;BR /&gt;switch (params['action']) {&lt;BR /&gt;case "transactResponse":&lt;BR /&gt;var transResponse = JSON.parse(params['response']);&lt;BR /&gt;if (transResponse.transId &amp;gt; 0) {&lt;BR /&gt;alert(transResponse.transId);&lt;/P&gt;&lt;P&gt;}&lt;BR /&gt;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;lt;/script&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Mytoken_generation_accepted_host.php&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;$setting3 = new AnetAPI\SettingType();&lt;BR /&gt;$setting3-&amp;gt;setSettingName("hostedPaymentReturnOptions");&lt;BR /&gt;$setting3-&amp;gt;setSettingValue("{\"showReceipt\" : false }");&lt;/P&gt;&lt;P&gt;$commUrl = json_encode(array('url' =&amp;gt; $homeurl."IFrameCommunicator.html" ), JSON_UNESCAPED_SLASHES);&lt;/P&gt;&lt;P&gt;$setting7 = new AnetAPI\SettingType();&lt;BR /&gt;$setting7-&amp;gt;setSettingName("hostedPaymentIFrameCommunicatorUrl");&lt;BR /&gt;$setting7-&amp;gt;setSettingValue($commUrl);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jul 2022 15:16:55 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Authorized-net-iframe-communicator-not-return-the-transaction-id/m-p/83354#M52573</guid>
      <dc:creator>mounica</dc:creator>
      <dc:date>2022-07-07T15:16:55Z</dc:date>
    </item>
    <item>
      <title>Re: Authorized.net iframe communicator not return the transaction id.</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Authorized-net-iframe-communicator-not-return-the-transaction-id/m-p/83361#M52577</link>
      <description>&lt;P&gt;he implementation and use of Accept Hosted follow a basic workflow:&lt;/P&gt;&lt;P&gt;1. You call getHostedPaymentPageRequest to request a form token. This request contains transaction information and form parameter settings.&lt;/P&gt;&lt;P&gt;2. You embed the payment form or redirect the customer to the payment form by sending an HTML POST containing the form token to &lt;A href="https://accept.authorize.net/payment/payment" target="_blank"&gt;https://accept.authorize.net/payment/payment&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;3. Your customer completes and submits the payment form.&lt;/P&gt;&lt;P&gt;4. The API sends the transaction to Authorize.net for processing.&lt;/P&gt;&lt;P&gt;5. The customer is returned to your site, which displays a result page based on the URL followed or the response details sent.&amp;nbsp;&lt;A href="https://www.pfmlogin.org/" target="_self"&gt;PFM Login&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jul 2022 09:51:17 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Authorized-net-iframe-communicator-not-return-the-transaction-id/m-p/83361#M52577</guid>
      <dc:creator>Obrien45050</dc:creator>
      <dc:date>2022-07-08T09:51:17Z</dc:date>
    </item>
  </channel>
</rss>

