<?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 payButton attributes not being passed intermittently in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/payButton-attributes-not-being-passed-intermittently/m-p/63856#M37884</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;HTML - the action should say&amp;nbsp;javascript&amp;amp;colon;handlePayment()&lt;/P&gt;&lt;PRE&gt;  &amp;lt;form id="paymentForm" 
    method="POST" 
    action="javascript&amp;amp;colon;handlePayment()"&amp;gt;
    &amp;lt;input type="hidden" name="dataValue" id="dataValue"/&amp;gt;
    &amp;lt;input type="hidden" name="dataDescriptor" id="dataDescriptor"/&amp;gt;
    &amp;lt;input type="hidden" name="paymentResponse" id="paymentResponse"/&amp;gt;
    &amp;lt;button type="button" 
      data-apiLoginID=""
      data-clientKey=""
      data-responseHandler="responseHandler"
      data-billingAddressOptions='{"show":true, "required":false}' 
      data-acceptUIFormHeaderTxt=""
      data-acceptUIFormBtnTxt="Submit" 
      class="AcceptUI" 
      ID="payButton"&amp;gt;Pay
    &amp;lt;/button&amp;gt;
  &amp;lt;/form&amp;gt;&lt;/PRE&gt;&lt;P&gt;On load, a js file updates the button attributes based on the results of a method (orgCred) inserting credentials for the current client as needed.&amp;nbsp; The apiLoginID, clientKey and&amp;nbsp;acceptUIFormHeaderTxt are all updated based on the current client.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;js - update credentials for payment.&lt;/P&gt;&lt;PRE&gt;var payButton = document.getElementById("payButton");
payButton.setAttribute("data-apiLoginID", orgCred.loginID);
payButton.setAttribute("data-clientKey", orgCred.clientKey);
payButton.setAttribute("data-acceptUIFormHeaderTxt", orgCred.orgName);&lt;/PRE&gt;&lt;P&gt;I can see the button element has the correct credentials after the page loads.&amp;nbsp; If I look at&amp;nbsp;document.getElementById("payButton") in the console everything looks good. When the payButton is clicked the hosted page displays but the updated attributes are not ALLWAYS being passed to A.net.&amp;nbsp; It will work fine&amp;nbsp;for several tests but then fails indicating two errors (E_WC_10: Please provide valid apiloginid.&amp;nbsp;and E_WC_18: Client key is required.)&amp;nbsp; When I view the element in dev tools everything looks good but it seems&amp;nbsp;pass the default (blank) attributes instead of the updated credentials that are updated on load.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sometimes I can click away to another page then back to the payment page and it will work fine but not reliably.&amp;nbsp; Reloading (Alt+reload) the page or restarting the browser also fixes the issue on occasion.&amp;nbsp; I can not seem to find any consistency to the behavior.&amp;nbsp; It feels like it could be a timeing issue but I am at a loss on how to fix it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been testing using the&amp;nbsp;&lt;A href="https://jstest.authorize.net/v3/AcceptUI.js" target="_blank"&gt;https://jstest.authorize.net/v3/AcceptUI.js&lt;/A&gt; library and my sandbox credentials.&amp;nbsp; Testing in Chrome.&amp;nbsp; Currently the form, button, responseHandler, paymentFormUpdate and handlePayment/paymentRequest mehtods are&amp;nbsp;all defined in line within the html file with some basic javascript events.&amp;nbsp; Any help/advice is greatly appreciated.&amp;nbsp; Let me know what else is needed to diagnose the issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 23 Jul 2018 12:09:39 GMT</pubDate>
    <dc:creator>scoeat</dc:creator>
    <dc:date>2018-07-23T12:09:39Z</dc:date>
    <item>
      <title>payButton attributes not being passed intermittently</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/payButton-attributes-not-being-passed-intermittently/m-p/63856#M37884</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;HTML - the action should say&amp;nbsp;javascript&amp;amp;colon;handlePayment()&lt;/P&gt;&lt;PRE&gt;  &amp;lt;form id="paymentForm" 
    method="POST" 
    action="javascript&amp;amp;colon;handlePayment()"&amp;gt;
    &amp;lt;input type="hidden" name="dataValue" id="dataValue"/&amp;gt;
    &amp;lt;input type="hidden" name="dataDescriptor" id="dataDescriptor"/&amp;gt;
    &amp;lt;input type="hidden" name="paymentResponse" id="paymentResponse"/&amp;gt;
    &amp;lt;button type="button" 
      data-apiLoginID=""
      data-clientKey=""
      data-responseHandler="responseHandler"
      data-billingAddressOptions='{"show":true, "required":false}' 
      data-acceptUIFormHeaderTxt=""
      data-acceptUIFormBtnTxt="Submit" 
      class="AcceptUI" 
      ID="payButton"&amp;gt;Pay
    &amp;lt;/button&amp;gt;
  &amp;lt;/form&amp;gt;&lt;/PRE&gt;&lt;P&gt;On load, a js file updates the button attributes based on the results of a method (orgCred) inserting credentials for the current client as needed.&amp;nbsp; The apiLoginID, clientKey and&amp;nbsp;acceptUIFormHeaderTxt are all updated based on the current client.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;js - update credentials for payment.&lt;/P&gt;&lt;PRE&gt;var payButton = document.getElementById("payButton");
payButton.setAttribute("data-apiLoginID", orgCred.loginID);
payButton.setAttribute("data-clientKey", orgCred.clientKey);
payButton.setAttribute("data-acceptUIFormHeaderTxt", orgCred.orgName);&lt;/PRE&gt;&lt;P&gt;I can see the button element has the correct credentials after the page loads.&amp;nbsp; If I look at&amp;nbsp;document.getElementById("payButton") in the console everything looks good. When the payButton is clicked the hosted page displays but the updated attributes are not ALLWAYS being passed to A.net.&amp;nbsp; It will work fine&amp;nbsp;for several tests but then fails indicating two errors (E_WC_10: Please provide valid apiloginid.&amp;nbsp;and E_WC_18: Client key is required.)&amp;nbsp; When I view the element in dev tools everything looks good but it seems&amp;nbsp;pass the default (blank) attributes instead of the updated credentials that are updated on load.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sometimes I can click away to another page then back to the payment page and it will work fine but not reliably.&amp;nbsp; Reloading (Alt+reload) the page or restarting the browser also fixes the issue on occasion.&amp;nbsp; I can not seem to find any consistency to the behavior.&amp;nbsp; It feels like it could be a timeing issue but I am at a loss on how to fix it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been testing using the&amp;nbsp;&lt;A href="https://jstest.authorize.net/v3/AcceptUI.js" target="_blank"&gt;https://jstest.authorize.net/v3/AcceptUI.js&lt;/A&gt; library and my sandbox credentials.&amp;nbsp; Testing in Chrome.&amp;nbsp; Currently the form, button, responseHandler, paymentFormUpdate and handlePayment/paymentRequest mehtods are&amp;nbsp;all defined in line within the html file with some basic javascript events.&amp;nbsp; Any help/advice is greatly appreciated.&amp;nbsp; Let me know what else is needed to diagnose the issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jul 2018 12:09:39 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/payButton-attributes-not-being-passed-intermittently/m-p/63856#M37884</guid>
      <dc:creator>scoeat</dc:creator>
      <dc:date>2018-07-23T12:09:39Z</dc:date>
    </item>
  </channel>
</rss>

