<?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 getting an error with the new accept.js solution in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/getting-an-error-with-the-new-accept-js-solution/m-p/55070#M30006</link>
    <description>&lt;P&gt;I am trying to test the new accept.js solution. I am copying/pasting the example code. I am just trying to log the results to the console, at this point.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, when I load the page in FF or Chrome, I get the following error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Chrome: Accept.js:1 Uncaught SyntaxError: Invalid or unexpected token&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;FireFox: &amp;nbsp;&lt;SPAN class="errorMessage "&gt;SyntaxError: illegal character&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV class="errorTrace "&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="errorSourceBox errorSource-syntax focusRow subLogRow "&gt;&lt;TABLE cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&lt;PRE&gt;...4&amp;gt;s;s++){var t=q+g.Î£1(n)+g.Ch(n,o,p)+b[s]+r[s],u=g.Î£0(j)+g.Maj(j,k,l);q=p,p=o&lt;/PRE&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the code from the page I'm testing (of course I put my key/api login):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&amp;lt;!DOCTYPE HTML&amp;gt;

&amp;lt;html&amp;gt;

&amp;lt;head&amp;gt;
        &amp;lt;title&amp;gt;Auth.net Accept.js&amp;lt;/title&amp;gt;
        &amp;lt;script type="text/javascript" src="https://jstest.authorize.net/v1/Accept.js"&amp;gt;&amp;lt;/script&amp;gt;
        &amp;lt;script type="text/javascript"&amp;gt;
        function sendPaymentDataToAnet() {
        	var secureData = {}, authData = {}, cardData = {};

        	cardData.cardNumber = document.getElementById('CARDNUMBER_ID').value;
	        cardData.month = document.getElementById('EXPIRY_MONTH_ID').value;
	        cardData.year = document.getElementById('EXPIRY_YEAR_ID').value;
        	secureData.cardData = cardData;

        	authData.clientKey = 'my_client_key';
        	authData.apiLoginID = 'my_api_login';
        	secureData.authData = authData;

        	Accept.dispatchData(secureData, 'responseHandler');
                }

        function  responseHandler(response) {
        	if (response.messages.resultCode === 'Error') {
        		for (var i = 0; i &amp;lt; response.messages.message.length; i++) {
        			console.log(response.messages.message[i].code + ':' + response.messages.message[i].text);
        		        }
        		alert('acceptJS library error!');
        	        }
                else {
        		postBackToMyServer(response.opaqueData);
                        console.log(response.opaque.Data);
        	        }
                }
        &amp;lt;/script&amp;gt;

&amp;lt;/head&amp;gt;

&amp;lt;body&amp;gt;


&amp;lt;form&amp;gt;

CC#: &amp;lt;input type="text" id="CARDNUMBER_ID" /&amp;gt;
MM: &amp;lt;input type="text" id="EXPIRY_MONTH_ID" /&amp;gt;
YY: &amp;lt;input type="text" id="EXPIRY_YEAR_ID" /&amp;gt;
&amp;lt;button type="submit" onclick="sendPaymentDataToAnet()"&amp;gt;Pay&amp;lt;/button&amp;gt;
&amp;lt;/form&amp;gt;


&amp;lt;/body&amp;gt;

&amp;lt;/html&amp;gt;&lt;/PRE&gt;&lt;P&gt;Any ideas?&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;Joe&lt;/P&gt;</description>
    <pubDate>Thu, 30 Jun 2016 02:30:35 GMT</pubDate>
    <dc:creator>joekerns168</dc:creator>
    <dc:date>2016-06-30T02:30:35Z</dc:date>
    <item>
      <title>getting an error with the new accept.js solution</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/getting-an-error-with-the-new-accept-js-solution/m-p/55070#M30006</link>
      <description>&lt;P&gt;I am trying to test the new accept.js solution. I am copying/pasting the example code. I am just trying to log the results to the console, at this point.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, when I load the page in FF or Chrome, I get the following error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Chrome: Accept.js:1 Uncaught SyntaxError: Invalid or unexpected token&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;FireFox: &amp;nbsp;&lt;SPAN class="errorMessage "&gt;SyntaxError: illegal character&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV class="errorTrace "&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="errorSourceBox errorSource-syntax focusRow subLogRow "&gt;&lt;TABLE cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&lt;PRE&gt;...4&amp;gt;s;s++){var t=q+g.Î£1(n)+g.Ch(n,o,p)+b[s]+r[s],u=g.Î£0(j)+g.Maj(j,k,l);q=p,p=o&lt;/PRE&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the code from the page I'm testing (of course I put my key/api login):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&amp;lt;!DOCTYPE HTML&amp;gt;

&amp;lt;html&amp;gt;

&amp;lt;head&amp;gt;
        &amp;lt;title&amp;gt;Auth.net Accept.js&amp;lt;/title&amp;gt;
        &amp;lt;script type="text/javascript" src="https://jstest.authorize.net/v1/Accept.js"&amp;gt;&amp;lt;/script&amp;gt;
        &amp;lt;script type="text/javascript"&amp;gt;
        function sendPaymentDataToAnet() {
        	var secureData = {}, authData = {}, cardData = {};

        	cardData.cardNumber = document.getElementById('CARDNUMBER_ID').value;
	        cardData.month = document.getElementById('EXPIRY_MONTH_ID').value;
	        cardData.year = document.getElementById('EXPIRY_YEAR_ID').value;
        	secureData.cardData = cardData;

        	authData.clientKey = 'my_client_key';
        	authData.apiLoginID = 'my_api_login';
        	secureData.authData = authData;

        	Accept.dispatchData(secureData, 'responseHandler');
                }

        function  responseHandler(response) {
        	if (response.messages.resultCode === 'Error') {
        		for (var i = 0; i &amp;lt; response.messages.message.length; i++) {
        			console.log(response.messages.message[i].code + ':' + response.messages.message[i].text);
        		        }
        		alert('acceptJS library error!');
        	        }
                else {
        		postBackToMyServer(response.opaqueData);
                        console.log(response.opaque.Data);
        	        }
                }
        &amp;lt;/script&amp;gt;

&amp;lt;/head&amp;gt;

&amp;lt;body&amp;gt;


&amp;lt;form&amp;gt;

CC#: &amp;lt;input type="text" id="CARDNUMBER_ID" /&amp;gt;
MM: &amp;lt;input type="text" id="EXPIRY_MONTH_ID" /&amp;gt;
YY: &amp;lt;input type="text" id="EXPIRY_YEAR_ID" /&amp;gt;
&amp;lt;button type="submit" onclick="sendPaymentDataToAnet()"&amp;gt;Pay&amp;lt;/button&amp;gt;
&amp;lt;/form&amp;gt;


&amp;lt;/body&amp;gt;

&amp;lt;/html&amp;gt;&lt;/PRE&gt;&lt;P&gt;Any ideas?&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;Joe&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jun 2016 02:30:35 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/getting-an-error-with-the-new-accept-js-solution/m-p/55070#M30006</guid>
      <dc:creator>joekerns168</dc:creator>
      <dc:date>2016-06-30T02:30:35Z</dc:date>
    </item>
    <item>
      <title>Re: getting an error with the new accept.js solution</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/getting-an-error-with-the-new-accept-js-solution/m-p/55084#M30020</link>
      <description>&lt;P&gt;Make sure you include&amp;nbsp;the UTF-8 charset meta tag:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;lt;meta charset="utf-8"&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Brian&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jun 2016 14:41:49 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/getting-an-error-with-the-new-accept-js-solution/m-p/55084#M30020</guid>
      <dc:creator>brianmc</dc:creator>
      <dc:date>2016-06-30T14:41:49Z</dc:date>
    </item>
    <item>
      <title>Re: getting an error with the new accept.js solution</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/getting-an-error-with-the-new-accept-js-solution/m-p/55163#M30093</link>
      <description>&lt;P&gt;Utf-8 tag seems to&amp;nbsp;be the solution.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Next, can ayone help with&amp;nbsp;this error: &amp;nbsp;E_WC_14:Accept.js encryption failed.&lt;BR /&gt;&lt;BR /&gt;All form validation is working so it appears accept.js is loading but error above is coming on submit.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 10 Jul 2016 18:44:26 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/getting-an-error-with-the-new-accept-js-solution/m-p/55163#M30093</guid>
      <dc:creator>earthskater1</dc:creator>
      <dc:date>2016-07-10T18:44:26Z</dc:date>
    </item>
    <item>
      <title>Re: getting an error with the new accept.js solution</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/getting-an-error-with-the-new-accept-js-solution/m-p/55167#M30097</link>
      <description>Can you post your html/javascript?</description>
      <pubDate>Mon, 11 Jul 2016 05:06:29 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/getting-an-error-with-the-new-accept-js-solution/m-p/55167#M30097</guid>
      <dc:creator>brianmc</dc:creator>
      <dc:date>2016-07-11T05:06:29Z</dc:date>
    </item>
    <item>
      <title>Re: getting an error with the new accept.js solution</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/getting-an-error-with-the-new-accept-js-solution/m-p/55193#M30120</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I'm also getting error&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;E_WC_14:Accept.js encryption failed.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;using https localhost&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;in Chrome, showing this message in the js console on page load:&lt;/P&gt;&lt;P&gt;XMLHttpRequest cannot load &lt;A href="https://jstest.authorize.net/v1/AcceptCore.js" target="_blank"&gt;https://jstest.authorize.net/v1/AcceptCore.js&lt;/A&gt;. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://localhost' is therefore not allowed access.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;anyone have suggestions ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-thanks&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jul 2016 02:03:45 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/getting-an-error-with-the-new-accept-js-solution/m-p/55193#M30120</guid>
      <dc:creator>matt77</dc:creator>
      <dc:date>2016-07-12T02:03:45Z</dc:date>
    </item>
    <item>
      <title>Re: getting an error with the new accept.js solution</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/getting-an-error-with-the-new-accept-js-solution/m-p/55198#M30125</link>
      <description>&lt;P&gt;Hi Matt,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We have some updates to our documentation page coming today which should help greatly. &amp;nbsp;Right now I can tell you that the CORS warning "cannot load" is actually correct behaviour in that it's alerting the fact that the page cannot call our core js library only the Accept.js library. &amp;nbsp;So that will not impact functionality (we are nonetheless looking at ways to stop the browser doing this).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;On the WC_14 error, we have an error in our sample code, if you make the response handler like this it should work:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;function responseHandler(response) {
if (response.messages.resultCode === 'Error') {
for (var i = 0; i &amp;lt; response.messages.message.length; i++) {
console.log(response.messages.message[i].code + ':' + response.messages.message[i].text);
$("#blob").val(response.messages.message[i].code + ':' + response.messages.message[i].text);
}
} else {
useOpaqueData(response.opaqueData)
}
}
function useOpaqueData(responseData) {
console.log(responseData.dataDescriptor);
console.log(responseData.dataValue);
alert(responseData.dataValue);
}&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jul 2016 19:07:26 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/getting-an-error-with-the-new-accept-js-solution/m-p/55198#M30125</guid>
      <dc:creator>brianmc</dc:creator>
      <dc:date>2016-07-12T19:07:26Z</dc:date>
    </item>
    <item>
      <title>Re: getting an error with the new accept.js solution</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/getting-an-error-with-the-new-accept-js-solution/m-p/55234#M30155</link>
      <description>&lt;P&gt;With sandbox and "&lt;A href="https://jstest.authorize.net/v1/Accept.js" target="_blank"&gt;https://jstest.authorize.net/v1/Accept.js&lt;/A&gt;", getting this error:&amp;nbsp;E_WC_03:Accept.js is not loaded correctly.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jul 2016 19:03:33 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/getting-an-error-with-the-new-accept-js-solution/m-p/55234#M30155</guid>
      <dc:creator>ali25000</dc:creator>
      <dc:date>2016-07-18T19:03:33Z</dc:date>
    </item>
    <item>
      <title>Re: getting an error with the new accept.js solution</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/getting-an-error-with-the-new-accept-js-solution/m-p/55235#M30156</link>
      <description>&lt;P&gt;With the same code using sandbox and&amp;nbsp;"&lt;A href="https://jstest.authorize.net/v1/Accept.js" target="_blank"&gt;https://jstest.authorize.net/v1/Accept.js&lt;/A&gt;", most of the times getting error:&amp;nbsp;E_WC_03:Accept.js is not loaded correctly.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jul 2016 19:19:16 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/getting-an-error-with-the-new-accept-js-solution/m-p/55235#M30156</guid>
      <dc:creator>ali25000</dc:creator>
      <dc:date>2016-07-18T19:19:16Z</dc:date>
    </item>
    <item>
      <title>Re: getting an error with the new accept.js solution</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/getting-an-error-with-the-new-accept-js-solution/m-p/55250#M30169</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.developer.cybersource.com/t5/user/viewprofilepage/user-id/20351"&gt;@ali25000﻿&lt;/a&gt;, can you post your code or send it to developer@authorize.net?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, have you looked at our sample app code? &amp;nbsp;&lt;A href="https://github.com/AuthorizeNet/accept-sample-app/blob/master/acceptJSCaller.js" target="_blank"&gt;https://github.com/AuthorizeNet/accept-sample-app/blob/master/acceptJSCaller.js&lt;/A&gt; &amp;nbsp; Lines 68 - 93&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&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;Brian&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2016 16:10:39 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/getting-an-error-with-the-new-accept-js-solution/m-p/55250#M30169</guid>
      <dc:creator>brianmc</dc:creator>
      <dc:date>2016-07-19T16:10:39Z</dc:date>
    </item>
    <item>
      <title>Re: getting an error with the new accept.js solution</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/getting-an-error-with-the-new-accept-js-solution/m-p/55251#M30170</link>
      <description>&lt;P&gt;One more thing to check is that you haven't downloaded or altered the Authorize.Net javascript libraries. &amp;nbsp;That would cause E_WC03&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Brian&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2016 17:00:11 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/getting-an-error-with-the-new-accept-js-solution/m-p/55251#M30170</guid>
      <dc:creator>brianmc</dc:creator>
      <dc:date>2016-07-19T17:00:11Z</dc:date>
    </item>
    <item>
      <title>Re: getting an error with the new accept.js solution</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/getting-an-error-with-the-new-accept-js-solution/m-p/55285#M30199</link>
      <description>&lt;P&gt;Here is what I have, and it always results in an error ("acceptJS library error!"). I've tried the various code suggestions from this post. Anyone have any luck?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, how does one get back the info from authorize (such as card type, response code, etc)? I had mine with a relay response page before.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&amp;lt;!DOCTYPE HTML&amp;gt;
&amp;lt;meta charset="utf-8"&amp;gt;

&amp;lt;html&amp;gt;

&amp;lt;head&amp;gt;
    &amp;lt;title&amp;gt;Auth.net Accept.js&amp;lt;/title&amp;gt;
    &amp;lt;script type="text/javascript" src="https://js.authorize.net/v1/Accept.js"&amp;gt;&amp;lt;/script&amp;gt;
    &amp;lt;script type="text/javascript"&amp;gt;
        function sendPaymentDataToAnet() {
            var secureData = {}, authData = {}, cardData = {};
            cardData.cardNumber = document.getElementById('creditCardNumber').value;
            //add cvv
            cardData.month = document.getElementById('expiryDateMM').value;
            cardData.year = document.getElementById('expiryDateYY').value;
            secureData.cardData = cardData;
            authData.clientKey = 'clientkeyhere';
            authData.apiLoginID = 'loginidhere';
            secureData.authData = authData;
            Accept.dispatchData(secureData, 'responseHandler');

                }

        function responseHandler(response) {
            if (response.messages.resultCode === 'Error') {
                for (var i = 0; i &amp;lt; response.messages.message.length; i++) {
                    console.log(response.messages.message[i].code + ':' + response.messages.message[i].text);
                }
                alert("acceptJS library error!");
            } else {
                console.log(response.opaqueData.dataDescriptor);
                console.log(response.opaqueData.dataValue);
                createTransact(response.opaqueData);
                alert("2");
            }
        }

      
    &amp;lt;/script&amp;gt;

&amp;lt;/head&amp;gt;

&amp;lt;body&amp;gt;


    &amp;lt;form&amp;gt;

        CC#: &amp;lt;input type="text" id="creditCardNumber" /&amp;gt;
        MM: &amp;lt;input type="text" id="expiryDateMM" /&amp;gt;
        YY: &amp;lt;input type="text" id="expiryDateYY" /&amp;gt;
        &amp;lt;button type="submit" onclick="sendPaymentDataToAnet()"&amp;gt;Pay&amp;lt;/button&amp;gt;
    &amp;lt;/form&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>Sat, 23 Jul 2016 14:46:56 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/getting-an-error-with-the-new-accept-js-solution/m-p/55285#M30199</guid>
      <dc:creator>rockon77</dc:creator>
      <dc:date>2016-07-23T14:46:56Z</dc:date>
    </item>
    <item>
      <title>Re: getting an error with the new accept.js solution</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/getting-an-error-with-the-new-accept-js-solution/m-p/55286#M30200</link>
      <description>&lt;P&gt;Chrome is saying this error: "XMLHttpRequest cannot load &lt;A href="https://js.authorize.net/v1/AcceptCore.js" target="_blank"&gt;https://js.authorize.net/v1/AcceptCore.js&lt;/A&gt;. No 'Access-Control-Allow-Origin' header is present on the requested resource."&lt;/P&gt;</description>
      <pubDate>Sat, 23 Jul 2016 15:26:07 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/getting-an-error-with-the-new-accept-js-solution/m-p/55286#M30200</guid>
      <dc:creator>rockon77</dc:creator>
      <dc:date>2016-07-23T15:26:07Z</dc:date>
    </item>
    <item>
      <title>Re: getting an error with the new accept.js solution</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/getting-an-error-with-the-new-accept-js-solution/m-p/55766#M30606</link>
      <description>&lt;P&gt;Im currently getting the&amp;nbsp;XMLHttpRequest cannot load &lt;A href="https://jstest.authorize.net/v1/AcceptCore.js" target="_blank"&gt;https://jstest.authorize.net/v1/AcceptCore.js&lt;/A&gt;. No 'Access-Control-Allow-Origin' header is present on the requested resource. issue as well and then when i try and submit it tells me that windows[c] is not a function.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;has anyone been able to get this to work yet?&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2016 08:42:03 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/getting-an-error-with-the-new-accept-js-solution/m-p/55766#M30606</guid>
      <dc:creator>danjump24</dc:creator>
      <dc:date>2016-09-16T08:42:03Z</dc:date>
    </item>
    <item>
      <title>Re: getting an error with the new accept.js solution</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/getting-an-error-with-the-new-accept-js-solution/m-p/56551#M31337</link>
      <description>&lt;P&gt;I am also seeing "&lt;SPAN&gt;windows[b] is not a function" and the&amp;nbsp;&lt;SPAN&gt;'Access-Control-Allow-Origin'. &amp;nbsp;Has anyone gotten this working?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 01 Jan 2017 00:05:47 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/getting-an-error-with-the-new-accept-js-solution/m-p/56551#M31337</guid>
      <dc:creator>firebird</dc:creator>
      <dc:date>2017-01-01T00:05:47Z</dc:date>
    </item>
    <item>
      <title>Re: getting an error with the new accept.js solution</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/getting-an-error-with-the-new-accept-js-solution/m-p/57188#M31919</link>
      <description>&lt;P&gt;Just a heads up for you and anyone watching this thread that we've released code in sandbox that fixes many of the issues brought up here, and this code should make it into the production environment within the next couple of days.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Specifically for Accept.js, there's no longer any "Access-Control-Allow-Origin" related error in the console, the accept.js script can now be loaded at any point in the workflow, and the response handler function can be passed directly in the function call instead of having to pass the name.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Of course, please let us know if anything's not working as expected!&lt;/P&gt;</description>
      <pubDate>Wed, 08 Mar 2017 00:06:49 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/getting-an-error-with-the-new-accept-js-solution/m-p/57188#M31919</guid>
      <dc:creator>Aaron</dc:creator>
      <dc:date>2017-03-08T00:06:49Z</dc:date>
    </item>
    <item>
      <title>Re: getting an error with the new accept.js solution</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/getting-an-error-with-the-new-accept-js-solution/m-p/57239#M31968</link>
      <description>&lt;P&gt;&lt;a href="https://community.developer.cybersource.com/t5/user/viewprofilepage/user-id/20843"&gt;@Aaron&lt;/a&gt;&amp;nbsp;Have the fixes&amp;nbsp;made it into the&amp;nbsp;&lt;SPAN&gt;production environment yet?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2017 18:40:51 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/getting-an-error-with-the-new-accept-js-solution/m-p/57239#M31968</guid>
      <dc:creator>ImTheC</dc:creator>
      <dc:date>2017-03-13T18:40:51Z</dc:date>
    </item>
    <item>
      <title>Re: getting an error with the new accept.js solution</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/getting-an-error-with-the-new-accept-js-solution/m-p/57245#M31974</link>
      <description>&lt;P&gt;Yes, these are all now in production.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2017 19:55:38 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/getting-an-error-with-the-new-accept-js-solution/m-p/57245#M31974</guid>
      <dc:creator>Aaron</dc:creator>
      <dc:date>2017-03-13T19:55:38Z</dc:date>
    </item>
    <item>
      <title>Re: getting an error with the new accept.js solution</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/getting-an-error-with-the-new-accept-js-solution/m-p/57484#M32203</link>
      <description>&lt;P&gt;I'm getting the same problem right now using sandbox account. Yesterday it was fine. (&lt;SPAN&gt;E_WC_14:Accept.js encryption failed)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;Here is&amp;nbsp;code, from the example page I'm using (changed only for messages UI and submit)&lt;/P&gt;&lt;PRE&gt;&amp;lt;script type="text/javascript" src="https://jstest.authorize.net/v1/Accept.js" charset="utf-8"&amp;gt;&amp;lt;/script&amp;gt;
    &amp;lt;script type="text/javascript"&amp;gt;
        var $form = $('.payment-form');
        
        $(function() {

            $('.payment-form').submit(function(event) {
                var $form = $(this);

                event.preventDefault();

                // Disable the submit button to prevent repeated clicks
                $form.find('button').prop('disabled', true);
                $('#js-error-message').hide();

                sendPaymentDataToAnet();
            });
        });

        function responseHandler(response) {
            if (response.messages.resultCode === 'Error') {
                
                console.log(response.messages);
                
                var code = response.messages.message[0].code;
                
                // Show the errors on the form
                switch(code){
                    case "E_WC_05":
                        $('#js-error-message').html('{{ trans('texts.invalid_card_number') }}').fadeIn();
                    break;

                    case "E_WC_08":
                        $('#js-error-message').html('{{ trans('texts.invalid_expiry') }}').fadeIn();
                    break;

                    default:
                        $('#js-error-message').html(response.messages.message[0].text).fadeIn();
                    break;
                }

                $form.find('button').prop('disabled', false);

            } else {
                useOpaqueData(response.opaqueData)
            }
        }

        function useOpaqueData(responseData) {
            $form.append($('&amp;lt;input type="hidden" name="sourceToken"/&amp;gt;').val(responseData.dataValue));
            $form.get(0).submit();
        }

        function sendPaymentDataToAnet() {
            var secureData = {}, authData = {}, cardData = {};
            
            cardData.cardNumber = document.getElementById('card_number').value;
            cardData.month = document.getElementById('expiration_month').value;
            cardData.year = document.getElementById('expiration_year').value;
            secureData.cardData = cardData;

            authData.clientKey = '{{env('AUTHORIZE_NET_CLIENT_KEY')}}';
            authData.apiLoginID = '{{env('AUTHORIZE_NET_API_LOGIN')}}';
            secureData.authData = authData;
            
            Accept.dispatchData(secureData, 'responseHandler');
        }
    &amp;lt;/script&amp;gt;&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Mar 2017 10:41:08 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/getting-an-error-with-the-new-accept-js-solution/m-p/57484#M32203</guid>
      <dc:creator>roman_agently</dc:creator>
      <dc:date>2017-03-31T10:41:08Z</dc:date>
    </item>
    <item>
      <title>Re: getting an error with the new accept.js solution</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/getting-an-error-with-the-new-accept-js-solution/m-p/57488#M32207</link>
      <description>&lt;P&gt;I'm getting the same E_WC_14:Accept.js encryption failed error. Just set this up today using mostly code from samples found.&lt;/P&gt;&lt;PRE&gt;&amp;lt;!doctype html&amp;gt;
&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
&amp;lt;meta charset="utf-8"&amp;gt;

&amp;lt;?php 
if ($_SERVER["HTTP_HOST"] == "www.myserver.com")
{
    // For Production, use: 
    echo "&amp;lt;script type=\"text/javascript\" src=\"https://js.authorize.net/v1/Accept.js\" charset=\"utf-8\"&amp;gt;&amp;lt;/script&amp;gt;\n"; 
}
else
{
    // For Sandbox/Testing, use: --&amp;gt;
    echo "&amp;lt;script type=\"text/javascript\" src=\"https://jstest.authorize.net/v1/Accept.js\" charset=\"utf-8\"&amp;gt;&amp;lt;/script&amp;gt;\n"; 
}
?&amp;gt;


&amp;lt;script type="text/javascript"&amp;gt;
function sendPaymentDataToAnet() {

    var secureData = {}; authData = {}; cardData = {};

    // Extract the card number, expiration date, and card code.
    cardData.cardNumber = document.getElementById("cardNumberID").value;
    cardData.month = document.getElementById("monthID").value;
    cardData.year = document.getElementById("yearID").value;
    cardData.cardCode = document.getElementById("cardCodeID").value;
    cardData.zip = document.getElementById("zip").value;
    cardData.fullName = document.getElementById("fullName").value;
    secureData.cardData = cardData;

    authData.clientKey = "ClientKey";
    authData.apiLoginID = "APILogin";
    secureData.authData = authData;

    // Pass the card number and expiration date to Accept.js for submission to Authorize.Net.
    Accept.dispatchData(secureData, responseHandler);
    
    // Process the response from Authorize.Net to retrieve the two elements of the payment nonce.
    // If the data looks correct, record the OpaqueData to the console and call the transaction processing function.
    function responseHandler(response) {
        if (response.messages.resultCode === "Error") {
            for (var i = 0; i &amp;lt; response.messages.message.length; i++) {
                console.log(response.messages.message[i].code + ": " + response.messages.message[i].text);
            }
            alert("acceptJS library error!")
        } else {
            console.log(response.opaqueData.dataDescriptor);
            console.log(response.opaqueData.dataValue);
            processTransaction(response.opaqueData);
        }
    }    
    function useOpaqueData(responseData) {
        console.log(responseData.dataDescriptor);
        console.log(responseData.dataValue);
        alert(responseData.dataValue);
    }    
}
&amp;lt;/script&amp;gt;







&amp;lt;script type="text/javascript"&amp;gt;
function processTransaction(responseData) {
    
    //create the form and attach to the document
    var transactionForm = document.createElement("form");
    transactionForm.Id = "transactionForm";
    transactionForm.action = "authnet_test_response.php";
    transactionForm.method = "POST";
    document.body.appendChild(transactionForm);

    //create form "input" elements corresponding to each parameter
    amount = document.createElement("input")
    amount.hidden = true;
    amount.value = document.getElementById('AMOUNT').value;
    amount.name = "amount";
    transactionForm.appendChild(amount);

    dataDesc = document.createElement("input")
    dataDesc.hidden = true;
    dataDesc.value = responseData.dataDescriptor;
    dataDesc.name = "dataDesc";
    transactionForm.appendChild(dataDesc);

    dataValue = document.createElement("input")
    dataValue.hidden = true;
    dataValue.value = responseData.dataValue;
    dataValue.name = "dataValue";
    transactionForm.appendChild(dataValue);

    //submit the new form
    transactionForm.submit();
}
&amp;lt;/script&amp;gt;

&amp;lt;title&amp;gt;Untitled Document&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;

&amp;lt;body&amp;gt;
&amp;lt;?php // Step 2. Collect payment data in a form and intercept your form submission: ?&amp;gt;
&amp;lt;form&amp;gt;
    Card Number&amp;lt;br&amp;gt;
    &amp;lt;input type="text" id="cardNumberID" placeholder="5424000000000015" autocomplete="off" /&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;
    Expiration Date (Month)&amp;lt;br&amp;gt;
    &amp;lt;input type="text" id="monthID" placeholder="12" value="12" /&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;
    Expiration Date (Year)&amp;lt;br&amp;gt;
    &amp;lt;input type="text" id="yearID" placeholder="2025" value="2025" /&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;
    Card Security Code&amp;lt;br&amp;gt;
    &amp;lt;input type="text" id="cardCodeID" placeholder="123" /&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;
    Amount&amp;lt;br&amp;gt;
    &amp;lt;input type="text" id="amount" placeholder="10.00" /&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;
    
    Cardholder Name&amp;lt;br&amp;gt;
    &amp;lt;input type="text" id="fullName" /&amp;gt; &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;
    Cardholder Zip&amp;lt;br&amp;gt;
    &amp;lt;input type="text" id="zip" /&amp;gt; &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;
    
    &amp;lt;!-- On submit, cause this data to be sent to the "sendPaymentDataToAnet()" function. --&amp;gt;
    &amp;lt;button type="button" id="submitButton" onClick="sendPaymentDataToAnet()"&amp;gt;Pay&amp;lt;/button&amp;gt;
&amp;lt;/form&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 01 Apr 2017 02:36:16 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/getting-an-error-with-the-new-accept-js-solution/m-p/57488#M32207</guid>
      <dc:creator>JimM</dc:creator>
      <dc:date>2017-04-01T02:36:16Z</dc:date>
    </item>
    <item>
      <title>Re: getting an error with the new accept.js solution</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/getting-an-error-with-the-new-accept-js-solution/m-p/57489#M32208</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.developer.cybersource.com/t5/user/viewprofilepage/user-id/21478"&gt;@JimM&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The way the Accept.js script is written, the E_WC_14 error becomes a sort of fallback error for any error condition that's not caught and reported by some other function.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In your case, your line&lt;/P&gt;&lt;PRE&gt;amount.value = document.getElementById('AMOUNT').value;&lt;/PRE&gt;&lt;P&gt;is failing, because it's looking for an element with ID "AMOUNT", but your form field has the ID "amount". Change one or the other case to match and all should be well. It appears that error comes right from one of our samples, so we'll fix that right away.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also noticed you have a "useOpaqueData()" function that's not being called anywhere. Feel free to remove that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 01 Apr 2017 07:33:15 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/getting-an-error-with-the-new-accept-js-solution/m-p/57489#M32208</guid>
      <dc:creator>Aaron</dc:creator>
      <dc:date>2017-04-01T07:33:15Z</dc:date>
    </item>
  </channel>
</rss>

