<?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: Advice for developers using getHostedPaymentPageRequest, with an Embedded IFrame Communicator in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Advice-for-developers-using-getHostedPaymentPageRequest-with-an/m-p/87412#M54986</link>
    <description>&lt;P&gt;got it. I am clear now&lt;/P&gt;</description>
    <pubDate>Sun, 27 Aug 2023 14:09:22 GMT</pubDate>
    <dc:creator>spectra</dc:creator>
    <dc:date>2023-08-27T14:09:22Z</dc:date>
    <item>
      <title>Advice for developers using getHostedPaymentPageRequest, with an Embedded IFrame Communicator</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Advice-for-developers-using-getHostedPaymentPageRequest-with-an/m-p/87385#M54971</link>
      <description>&lt;P&gt;I read every previous post on IFrame Communicator, read the documentation, but had to use the DEVELOPER TOOLS, debugging features of CHROME, and also very importantly a "posted messaging monitor" that would show the line code execution when the posted payment result was returned in the IFrameCommunicator form. This allowed me to trace the javascript to see what was broken and quickly fix it.&lt;/P&gt;&lt;P&gt;From previous posts and my experience, Auhorize Net seems to change some things that impact how the posted code works, without updating their posted code.&lt;/P&gt;&lt;P&gt;This line of code in the IFrameCommunicator receives the call-back response from AuthorizeNet:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;callParentFunction(window.location.hash.substring(1));&lt;/LI-CODE&gt;&lt;P&gt;Because I copied the IFrameCommunicator page from the GitHub app, it did not match the Container form javascript objects published on the website,&amp;nbsp;&lt;A title="Authorize Net Accept Hosted Documentation" href="https://developer.authorize.net/api/reference/features/accept-hosted.html" target="_blank" rel="noopener"&gt;Authorize Net Accept Hosted Documentation&lt;/A&gt;&amp;nbsp;,&amp;nbsp;some elements were named differently. In the IFrameCommunicator the ContainerForm parent elements must all be defined, named the same as how they are referenced in the IFrameCommunicator:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(... window.parent &amp;amp;&amp;amp; window.parent.parent 
     &amp;amp;&amp;amp; window.parent.parent.AuthorizeNetIFrame  &amp;amp;&amp;amp; window.parent.parent.AuthorizeNetIFrame.onReceiveCommunication)&lt;/LI-CODE&gt;&lt;P&gt;Here in the IFrameCommunicator, Authorize Net changed the type passed to the ContainerForm from string to object:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;window.parent.parent.AuthorizeNetIFrame.onReceiveCommunication({qstr : str , parent : referrer});&lt;/LI-CODE&gt;&lt;P&gt;So in the ContainerForm, in the&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;function parseQueryString(str) {
	var vars = [];
	var arr = str.qstr.split('&amp;amp;');  &amp;lt;&amp;lt;&amp;lt;--- add dot notation referencing the .qstr property&lt;/LI-CODE&gt;&lt;P&gt;Also, make sure that you have enabled cross iframe communication with the use of a cookie in the response header of your IFrameCommunicator form:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;'Set-Cookie'; 'CROSS_SITE_PERMISSION=YES; Path=/; HttpOnly; SameSite=None; Secure'&lt;/LI-CODE&gt;&lt;P&gt;The cookie name above is arbitrary.&lt;/P&gt;&lt;P&gt;These were the Authorize Net hurdles I have encountered so far.&lt;/P&gt;&lt;P&gt;Example body for requesting the TOKEN:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;$HTTP_Request_Body_ob:=New object("getHostedPaymentPageRequest"; \
New object(\
"merchantAuthentication"; New object("name"; Merchant_Name_t; "transactionKey"; Merchant_Key_t); \
"transactionRequest"; New object("transactionType"; "authCaptureTransaction"; "amount"; String([Payment]Amount); \
"profile"; New object("customerProfileId"; String([Payment]AccountNo)); \
"billTo"; New object(\
"firstName"; [Account]Bill_To_First_Name; \
"lastName"; [Account]Bill_To_Last_Name; \
"address"; [Account]Bill_To_Address; \
"city"; [Account]Bill_To_City; \
"state"; [Account]Bill_To_State; \
"zip"; [Account]Bill_To_Zip; \
"country"; "US")); \
"hostedPaymentSettings"; \
New object("setting"; New collection(\
New object("settingName"; "hostedPaymentReturnOptions"; "settingValue"; "{\"showReceipt\": false, \"url\": \"https://"+$SubDomain_t+"/"+$Iteration_Remote_Path_t+"/AN_HostedPaymentForm_Receipt.a4d\"}"); \
New object("settingName"; "hostedPaymentButtonOptions"; "settingValue"; "{\"text\": \"Enter Payment Info\"}"); \
New object("settingName"; "hostedPaymentStyleOptions"; "settingValue"; "{\"bgColor\": \"blue\"}"); \
New object("settingName"; "hostedPaymentPaymentOptions"; "settingValue"; "{\"cardCodeRequired\": false, \"showCreditCard\": true, \"showBankAccount\": true}"); \
New object("settingName"; "hostedPaymentSecurityOptions"; "settingValue"; "{\"captcha\": false}"); \
New object("settingName"; "hostedPaymentShippingAddressOptions"; "settingValue"; "{\"show\": false, \"required\": false}"); \
New object("settingName"; "hostedPaymentBillingAddressOptions"; "settingValue"; "{\"show\": true, \"required\": false}"); \
New object("settingName"; "hostedPaymentCustomerOptions"; "settingValue"; "{\"showEmail\": false, \"requiredEmail\": false, \"addPaymentProfile\": true}"); \
New object("settingName"; "hostedPaymentOrderOptions"; "settingValue"; "{\"show\": false}"); \
New object("settingName"; "hostedPaymentIFrameCommunicatorUrl"; "settingValue"; "{\"url\": \"https://"+$SubDomain_t+"/"+$Iteration_Remote_Path_t+"/AN_HostedPaymentForm_IFrameCommunicator.a4d\"}")\
))))&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 23 Aug 2023 16:33:03 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Advice-for-developers-using-getHostedPaymentPageRequest-with-an/m-p/87385#M54971</guid>
      <dc:creator>marine2026</dc:creator>
      <dc:date>2023-08-23T16:33:03Z</dc:date>
    </item>
    <item>
      <title>Re: Advice for developers using getHostedPaymentPageRequest, with an Embedded IFrame Communicator</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Advice-for-developers-using-getHostedPaymentPageRequest-with-an/m-p/87388#M54974</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As per your post i beliveing in this post i got same query so i really search every ware but no result found finnaly i am came here to solve my query.. I hope some one can help us.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Aug 2023 06:32:59 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Advice-for-developers-using-getHostedPaymentPageRequest-with-an/m-p/87388#M54974</guid>
      <dc:creator>harrnhy1</dc:creator>
      <dc:date>2023-08-24T06:32:59Z</dc:date>
    </item>
    <item>
      <title>Re: Advice for developers using getHostedPaymentPageRequest, with an Embedded IFrame Communicator</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Advice-for-developers-using-getHostedPaymentPageRequest-with-an/m-p/87395#M54979</link>
      <description>&lt;P&gt;My post describes how to solve the bug.&lt;BR /&gt;&lt;BR /&gt;If you have not yet solved it, please start a new post, and I'll try to help you.&lt;BR /&gt;&lt;BR /&gt;Thanks!!&lt;/P&gt;</description>
      <pubDate>Thu, 24 Aug 2023 17:00:40 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Advice-for-developers-using-getHostedPaymentPageRequest-with-an/m-p/87395#M54979</guid>
      <dc:creator>marine2026</dc:creator>
      <dc:date>2023-08-24T17:00:40Z</dc:date>
    </item>
    <item>
      <title>Re: Advice for developers using getHostedPaymentPageRequest, with an Embedded IFrame Communicator</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Advice-for-developers-using-getHostedPaymentPageRequest-with-an/m-p/87412#M54986</link>
      <description>&lt;P&gt;got it. I am clear now&lt;/P&gt;</description>
      <pubDate>Sun, 27 Aug 2023 14:09:22 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Advice-for-developers-using-getHostedPaymentPageRequest-with-an/m-p/87412#M54986</guid>
      <dc:creator>spectra</dc:creator>
      <dc:date>2023-08-27T14:09:22Z</dc:date>
    </item>
  </channel>
</rss>

