<?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.js - Exceptions regarding failure to load from CDN and bad CORS headers in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-js-Exceptions-regarding-failure-to-load-from-CDN-and-bad/m-p/56553#M31338</link>
    <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.developer.cybersource.com/t5/user/viewprofilepage/user-id/20695"&gt;@describeit&lt;/a&gt;!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For me, the crucial part to get Accept.js working was the terrible practice of declaring the function on the window object:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;window.handleAuthnetResponse = function(response) {&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 01 Jan 2017 01:14:34 GMT</pubDate>
    <dc:creator>firebird</dc:creator>
    <dc:date>2017-01-01T01:14:34Z</dc:date>
    <item>
      <title>Accept.js - Exceptions regarding failure to load from CDN and bad CORS headers</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-js-Exceptions-regarding-failure-to-load-from-CDN-and-bad/m-p/56175#M30983</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm getting two errors when loading the library:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) &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. Origin 'https://[mydomain]' is therefore not allowed access.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2) Library is not coming from Accept CDN.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;based on some posts from a previous thread here back in August (&lt;A href="https://community.developer.authorize.net/t5/Integration-and-Testing/Accept-js-error-E-WC-14-Accept-js-encryption-failed/td-p/55531/page/2" target="_blank"&gt;https://community.developer.authorize.net/t5/Integration-and-Testing/Accept-js-error-E-WC-14-Accept-js-encryption-failed/td-p/55531/page/2&lt;/A&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried not only loading the script as listed in the official documentation:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;lt;script type="text/javascript" src="&lt;A href="https://jstest.authorize.net/v1/Accept.js" target="_blank"&gt;https://jstest.authorize.net/v1/Accept.js&lt;/A&gt;" charset="utf-8"&amp;gt;&amp;lt;/script&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This generates error #1 above related to the CORS origin headers.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've also tried loading the script dynamically as recommended by the moderator on the thread by doing this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;$(document).ready(function () {
        $.getScript(jsUrl, function (data, textStatus, jqxhr) {&lt;BR /&gt;            &lt;STRONG&gt;dispatchEvent(new Event('load'));&lt;/STRONG&gt;
            GetScriptCallback();
        });
    });&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and this generates both of the errors listed above.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Since both errors appear to be blocking issues, I can't seem to get past it, so at the moment I'm dead in the water.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;From the thread I cited above, it seems these errors just magically stopped happening for some folks and then came back randomly and then stopped again and so on. &amp;nbsp;It seems I'm at a point where they are reappearing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not sure what the status of the Accept.js library but based on the&amp;nbsp;open threads and the errors I'm stills seeing 2 months later it seems like somebody shipped it before it was ready for primetime.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Nonetheless, I've now got a client who is looking to get up and running with it next week and I'm stuck sorting out these errors so I'd appreciate some assistance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any updates on what the latest code or documentation is for this library?&lt;/P&gt;</description>
      <pubDate>Fri, 11 Nov 2016 18:25:00 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-js-Exceptions-regarding-failure-to-load-from-CDN-and-bad/m-p/56175#M30983</guid>
      <dc:creator>describeit</dc:creator>
      <dc:date>2016-11-11T18:25:00Z</dc:date>
    </item>
    <item>
      <title>Re: Accept.js - Exceptions regarding failure to load from CDN and bad CORS headers</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-js-Exceptions-regarding-failure-to-load-from-CDN-and-bad/m-p/56178#M30986</link>
      <description>&lt;P&gt;I'm getting this same CORS error, followed by:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;AcceptCore.js:1 Uncaught TypeError: window[c] is not a function(…)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;...when I try to submit. :-(&lt;/P&gt;</description>
      <pubDate>Mon, 14 Nov 2016 10:53:21 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-js-Exceptions-regarding-failure-to-load-from-CDN-and-bad/m-p/56178#M30986</guid>
      <dc:creator>krisajenkins</dc:creator>
      <dc:date>2016-11-14T10:53:21Z</dc:date>
    </item>
    <item>
      <title>Re: Accept.js - Exceptions regarding failure to load from CDN and bad CORS headers</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-js-Exceptions-regarding-failure-to-load-from-CDN-and-bad/m-p/56179#M30987</link>
      <description>&lt;P&gt;krisajenkins - I'm also seeing that error regarding window[c] as well. &amp;nbsp;It seems to happen only when i actually call the dispatchData method.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any updates from the admins on any of this?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Nov 2016 14:24:12 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-js-Exceptions-regarding-failure-to-load-from-CDN-and-bad/m-p/56179#M30987</guid>
      <dc:creator>describeit</dc:creator>
      <dc:date>2016-11-14T14:24:12Z</dc:date>
    </item>
    <item>
      <title>Re: Accept.js - Exceptions regarding failure to load from CDN and bad CORS headers</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-js-Exceptions-regarding-failure-to-load-from-CDN-and-bad/m-p/56181#M30989</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.developer.cybersource.com/t5/user/viewprofilepage/user-id/20695"&gt;@describeit&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sorry for the delay, it was a holiday for us last Friday. &amp;nbsp;I've notified our product team about your issue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Richard&lt;/P&gt;</description>
      <pubDate>Mon, 14 Nov 2016 15:23:39 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-js-Exceptions-regarding-failure-to-load-from-CDN-and-bad/m-p/56181#M30989</guid>
      <dc:creator>RichardH</dc:creator>
      <dc:date>2016-11-14T15:23:39Z</dc:date>
    </item>
    <item>
      <title>Re: Accept.js - Exceptions regarding failure to load from CDN and bad CORS headers</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-js-Exceptions-regarding-failure-to-load-from-CDN-and-bad/m-p/56184#M30992</link>
      <description>&lt;P&gt;Thanks Richard, I'll keep an eye out for a response.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Nov 2016 16:55:45 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-js-Exceptions-regarding-failure-to-load-from-CDN-and-bad/m-p/56184#M30992</guid>
      <dc:creator>describeit</dc:creator>
      <dc:date>2016-11-14T16:55:45Z</dc:date>
    </item>
    <item>
      <title>Re: Accept.js - Exceptions regarding failure to load from CDN and bad CORS headers</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-js-Exceptions-regarding-failure-to-load-from-CDN-and-bad/m-p/56188#M30996</link>
      <description>&lt;P&gt;&lt;FONT color="#333333"&gt;I am having this same issue. &amp;nbsp;I decided to install the accept-sample-app from the Authorize.net github project, and it has the same issue:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#333399"&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 '&lt;A href="https://cnbrown.cmyaccount.com" target="_blank"&gt;https://cnbrown.cmyaccount.com&lt;/A&gt;' is therefore not allowed access.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#333333"&gt;My project is completely dead in the water due to this bug.&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#333333"&gt;Thank you,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#333333"&gt;&lt;BR /&gt;Jeff&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Nov 2016 15:45:14 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-js-Exceptions-regarding-failure-to-load-from-CDN-and-bad/m-p/56188#M30996</guid>
      <dc:creator>jhoffman20</dc:creator>
      <dc:date>2016-11-15T15:45:14Z</dc:date>
    </item>
    <item>
      <title>Re: Accept.js - Exceptions regarding failure to load from CDN and bad CORS headers</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-js-Exceptions-regarding-failure-to-load-from-CDN-and-bad/m-p/56192#M31000</link>
      <description>&lt;P&gt;Admins any updates on this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is anyone successfully using this library?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;FYI - I received an email from support yesterday asking me to ensure I was declaring UTF-8 charset on the page and the script include. &amp;nbsp;I am doing both already and its still producing the error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&amp;lt;meta http-equiv=“Content-Type” content="text/html; charset=utf-8"&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&amp;lt;script type="text/javascript" src="&lt;A href="https://jstest.authorize.net/v1/Accept.js" target="_blank"&gt;&lt;SPAN class="s2"&gt;https://jstest.authorize.net/v1/Accept.js&lt;/SPAN&gt;&lt;/A&gt;" charset="utf-8"&amp;gt;&amp;lt;/script&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;Still produces:&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;XMLHttpRequest cannot load &lt;A href="https://jstest.authorize.net/v1/AcceptCore.js" target="_blank"&gt;&lt;SPAN class="s2"&gt;https://jstest.authorize.net/v1/AcceptCore.js&lt;/SPAN&gt;&lt;/A&gt;. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin ‘&lt;A href="https://centralserviceswest.lvh.me:3000/" target="_blank"&gt;&lt;SPAN class="s2"&gt;https://central.lvh.me:3000&lt;/SPAN&gt;&lt;/A&gt;' is therefore not allowed access.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Nov 2016 16:19:59 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-js-Exceptions-regarding-failure-to-load-from-CDN-and-bad/m-p/56192#M31000</guid>
      <dc:creator>describeit</dc:creator>
      <dc:date>2016-11-15T16:19:59Z</dc:date>
    </item>
    <item>
      <title>Re: Accept.js - Exceptions regarding failure to load from CDN and bad CORS headers</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-js-Exceptions-regarding-failure-to-load-from-CDN-and-bad/m-p/56195#M31002</link>
      <description>&lt;P&gt;Hi guys,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a very simple test page hosted at&amp;nbsp;&lt;A href="https://brianmc.github.io/test-acceptjs.html" target="_blank"&gt;https://brianmc.github.io/test-acceptjs.html&lt;/A&gt;, the source is on github at&amp;nbsp;&lt;A href="https://github.com/brianmc/brianmc.github.io/blob/master/test-acceptjs.html&amp;nbsp;" target="_blank"&gt;https://github.com/brianmc/brianmc.github.io/blob/master/test-acceptjs.html&amp;nbsp;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that if you open a js console you will see the CORS error on load, that one is due to the internal core library not being available for external access, it does not impact processing but it is unfortunate that the error presents. &amp;nbsp;I have shown this error plus the successful nonce returned in the screen shot below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps but please let me know if not and we can continue troubleshooting,&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;
&lt;P&gt;&lt;IMG src="https://community.developer.cybersource.com/t5/image/serverpage/image-id/98iC7FE7C456F422A0E/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="acceptjs-console.png" title="acceptjs-console.png" /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Nov 2016 16:21:47 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-js-Exceptions-regarding-failure-to-load-from-CDN-and-bad/m-p/56195#M31002</guid>
      <dc:creator>brianmc</dc:creator>
      <dc:date>2016-11-15T16:21:47Z</dc:date>
    </item>
    <item>
      <title>Re: Accept.js - Exceptions regarding failure to load from CDN and bad CORS headers</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-js-Exceptions-regarding-failure-to-load-from-CDN-and-bad/m-p/56196#M31003</link>
      <description>&lt;P&gt;Hi Brian,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Thanks for the response. &amp;nbsp;I've used your code and gone line by line through it. &amp;nbsp;I'm getting much farther but its still failing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; The error occurs on line 181 in the AcceptCore.js file. &amp;nbsp;In the compressed/minified code it reads as&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;window[b](c);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I put a breakpoint on that line, window[b] is in fact undefined. &amp;nbsp;b itself looks to contain the responseHandler method and c accurately contains a successful response with a payment Nonce included.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Since b is an input parameter to the method, why is it being accessed via window[b] instead of just b? &amp;nbsp;If I call b(c) that works, but unfortunately its happening inside of AcceptCore.js which I can't change.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PS - I'm loading the script tags in the HTML head tag just like in your example, but my execution is a bit more complex than your example. &amp;nbsp;I'm invoking the script from within a RequireJS module in a function that is invoked by an .on('submit') event listener.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it possible that this is causing part of the problem? &amp;nbsp;I don't even know where to begin debugging that, but woudl love to know why your referencing the callback handler from within the window array.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Nov 2016 17:15:03 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-js-Exceptions-regarding-failure-to-load-from-CDN-and-bad/m-p/56196#M31003</guid>
      <dc:creator>describeit</dc:creator>
      <dc:date>2016-11-15T17:15:03Z</dc:date>
    </item>
    <item>
      <title>Re: Accept.js - Exceptions regarding failure to load from CDN and bad CORS headers</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-js-Exceptions-regarding-failure-to-load-from-CDN-and-bad/m-p/56198#M31005</link>
      <description>&lt;P&gt;Thanks for the response brianmc, but I'm afraid it doesn't help. I get that CORS error, ignore it, and when I call dispatchData I get that window[c] error posted above.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My setup is much simpler than describeit's, but it looks like it's broken either way. :-(&lt;/P&gt;</description>
      <pubDate>Tue, 15 Nov 2016 17:18:02 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-js-Exceptions-regarding-failure-to-load-from-CDN-and-bad/m-p/56198#M31005</guid>
      <dc:creator>krisajenkins</dc:creator>
      <dc:date>2016-11-15T17:18:02Z</dc:date>
    </item>
    <item>
      <title>Re: Accept.js - Exceptions regarding failure to load from CDN and bad CORS headers</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-js-Exceptions-regarding-failure-to-load-from-CDN-and-bad/m-p/56199#M31006</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Brian,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;FYI: &amp;nbsp;we are trying this with a sandbox account. &amp;nbsp;Is that the issue? &amp;nbsp;I am not sure how Auth.net routes requests through the back end, but I wonder if perhaps a different server is handling the request when a sandbox account is referenced?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Jeff&lt;/P&gt;</description>
      <pubDate>Tue, 15 Nov 2016 17:24:44 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-js-Exceptions-regarding-failure-to-load-from-CDN-and-bad/m-p/56199#M31006</guid>
      <dc:creator>jhoffman20</dc:creator>
      <dc:date>2016-11-15T17:24:44Z</dc:date>
    </item>
    <item>
      <title>Re: Accept.js - Exceptions regarding failure to load from CDN and bad CORS headers</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-js-Exceptions-regarding-failure-to-load-from-CDN-and-bad/m-p/56200#M31007</link>
      <description>&lt;P&gt;Hi Brian,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; In reviewing your code again, I just realized that instead of passing the actual callback method into dispatchData() your only passing in the name of the callback method and forcing your code to go find it in the window array.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; This seems like a really convoluted way to accomplish this and in my situation where I have a non-trivial js architecture somewhat impossible to actually implement. &amp;nbsp;Is there plans to allow dispatchData() to accept the actual function instead of a string to the function name?&lt;/P&gt;</description>
      <pubDate>Tue, 15 Nov 2016 17:26:11 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-js-Exceptions-regarding-failure-to-load-from-CDN-and-bad/m-p/56200#M31007</guid>
      <dc:creator>describeit</dc:creator>
      <dc:date>2016-11-15T17:26:11Z</dc:date>
    </item>
    <item>
      <title>Re: Accept.js - Exceptions regarding failure to load from CDN and bad CORS headers</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-js-Exceptions-regarding-failure-to-load-from-CDN-and-bad/m-p/56201#M31008</link>
      <description>&lt;P&gt;Kris and Jeff, make sure your passing in a string for the second parameter for dispatchData and not the actual responseHandler method.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm coming from the Stripe world where you just pass in the responseHandler method and your done, but this requires you to pass in the name of the method as a string and then define the responseHandler as a global function that can then be found by window[c].&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind of unorthodox and a pain to deal with, but once i adjusted for that I got it to work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Invoking Call:&lt;/P&gt;&lt;PRE&gt;Accept.dispatchData(secureData, 'handleAuthnetResponse');&lt;/PRE&gt;&lt;P&gt;Note the second parameter is a string, not a variable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ResponseHandler:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;  window.handleAuthnetResponse = function(response) {
    var error_messages = '';
    var error_container = '';

    if (response.messages.resultCode === 'Error') {
      for (var i = 0; i &amp;lt; response.messages.message.length; i++) {
        error_messages = error_messages + response.messages.message[i].code + ':';
        error_messages = error_messages + response.messages.message[i].text + '&amp;lt;br/&amp;gt;';
      }

      error_container = '&amp;lt;div class="alert alert-danger"&amp;gt;&amp;lt;a class="close" data-dismiss="alert"&amp;gt;×&amp;lt;/a&amp;gt;' + error_messages + '&amp;lt;/div&amp;gt;';

      $authnetRoot.find('#processor_error').html(error_container).show();
      $authnetRoot.find('button[type=submit]').prop('disabled', false);
      $authnetRoot = null;
      return false;
    }
    else {
      console.log(response.opaqueData.dataDescriptor);
      console.log(response.opaqueData.dataValue);

      $authnetRoot.find('.authnet-card-token').val(response.opaqueData.dataValue);
      $authnetRoot.find('form.authnet-on')[0].submit();
      return true;
    }
  }&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Nov 2016 17:30:04 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-js-Exceptions-regarding-failure-to-load-from-CDN-and-bad/m-p/56201#M31008</guid>
      <dc:creator>describeit</dc:creator>
      <dc:date>2016-11-15T17:30:04Z</dc:date>
    </item>
    <item>
      <title>Re: Accept.js - Exceptions regarding failure to load from CDN and bad CORS headers</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-js-Exceptions-regarding-failure-to-load-from-CDN-and-bad/m-p/56202#M31009</link>
      <description>&lt;P&gt;I'm afraid lazy loading does not work in this release of Accept.js. &amp;nbsp; This is our number one request for the next version and we hope to get it out soon. &amp;nbsp;Can you try without using require?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Brian&lt;/P&gt;</description>
      <pubDate>Tue, 15 Nov 2016 17:47:27 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-js-Exceptions-regarding-failure-to-load-from-CDN-and-bad/m-p/56202#M31009</guid>
      <dc:creator>brianmc</dc:creator>
      <dc:date>2016-11-15T17:47:27Z</dc:date>
    </item>
    <item>
      <title>Re: Accept.js - Exceptions regarding failure to load from CDN and bad CORS headers</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-js-Exceptions-regarding-failure-to-load-from-CDN-and-bad/m-p/56207#M31014</link>
      <description>&lt;P&gt;Brian,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; I'm using the ruby-sdk version of the Authorize.Net API and I'm a bit unsure how to build the CreateTransactionRequest that you list in your sample application that you linked to above.&lt;/P&gt;&lt;PRE&gt;    transaction = Transaction.new(params[:api_login_id] , params[:transaction_key] , :gateway=&amp;gt;:sandbox)

    request = CreateTransactionRequest.new

    request.transactionRequest = TransactionRequestType.new()
    request.transactionRequest.transactionType = TransactionTypeEnum::AuthCaptureTransaction
    request.transactionRequest.amount = params[:amount]
    request.transactionRequest.payment = PaymentType.new

    request.transactionRequest.payment.creditCard = CreditCardType.new(params[:card_number] , params[:exp_date] , card_code)&lt;/PRE&gt;&lt;P&gt;What do I replace the CreditCardType.new command with to generate the opaqueData structure that you have laid out.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Its unclear in the source code in github how that is being handled. &amp;nbsp;Any advice on that would be much appreciated.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Nov 2016 20:37:45 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-js-Exceptions-regarding-failure-to-load-from-CDN-and-bad/m-p/56207#M31014</guid>
      <dc:creator>describeit</dc:creator>
      <dc:date>2016-11-15T20:37:45Z</dc:date>
    </item>
    <item>
      <title>Re: Accept.js - Exceptions regarding failure to load from CDN and bad CORS headers</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-js-Exceptions-regarding-failure-to-load-from-CDN-and-bad/m-p/56208#M31015</link>
      <description>&lt;P&gt;We have a sample in our Ruby Sample code repo: &amp;nbsp;&lt;A href="https://github.com/AuthorizeNet/sample-code-ruby/blob/master/MobileInappTransactions/create-an-accept-transaction.rb&amp;nbsp;" target="_blank"&gt;https://github.com/AuthorizeNet/sample-code-ruby/blob/master/MobileInappTransactions/create-an-accept-transaction.rb&amp;nbsp;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have just updated it as the data descriptor was incorrect. &amp;nbsp;I'm still testing with a live token but I wanted to get you the sample at least.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Brian&lt;/P&gt;</description>
      <pubDate>Tue, 15 Nov 2016 22:05:31 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-js-Exceptions-regarding-failure-to-load-from-CDN-and-bad/m-p/56208#M31015</guid>
      <dc:creator>brianmc</dc:creator>
      <dc:date>2016-11-15T22:05:31Z</dc:date>
    </item>
    <item>
      <title>Re: Accept.js - Exceptions regarding failure to load from CDN and bad CORS headers</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-js-Exceptions-regarding-failure-to-load-from-CDN-and-bad/m-p/56215#M31022</link>
      <description>&lt;P&gt;Brilliant, thanks describeit! I was passing a string, but the callback function I'd defined wasn't in window scope, so their callback hack couldn't find it. When I put the callback at the top-level (yuck!) it works.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Brianmc, is there a reason for the callback parameter being a globally-scoped string-name-of-a-function? I've never seen anyone else handle callbacks in this way, and it seems like a real hack from here. It's just cost us 3 days progress, so it would be nice to know there's some method in the madness...&lt;/P&gt;</description>
      <pubDate>Wed, 16 Nov 2016 09:27:12 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-js-Exceptions-regarding-failure-to-load-from-CDN-and-bad/m-p/56215#M31022</guid>
      <dc:creator>krisajenkins</dc:creator>
      <dc:date>2016-11-16T09:27:12Z</dc:date>
    </item>
    <item>
      <title>Re: Accept.js - Exceptions regarding failure to load from CDN and bad CORS headers</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-js-Exceptions-regarding-failure-to-load-from-CDN-and-bad/m-p/56553#M31338</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.developer.cybersource.com/t5/user/viewprofilepage/user-id/20695"&gt;@describeit&lt;/a&gt;!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For me, the crucial part to get Accept.js working was the terrible practice of declaring the function on the window object:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;window.handleAuthnetResponse = function(response) {&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 01 Jan 2017 01:14:34 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-js-Exceptions-regarding-failure-to-load-from-CDN-and-bad/m-p/56553#M31338</guid>
      <dc:creator>firebird</dc:creator>
      <dc:date>2017-01-01T01:14:34Z</dc:date>
    </item>
    <item>
      <title>Re: Accept.js - Exceptions regarding failure to load from CDN and bad CORS headers</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-js-Exceptions-regarding-failure-to-load-from-CDN-and-bad/m-p/56882#M31658</link>
      <description>&lt;P&gt;Although this thread is marked with a solution, it sounds like the CORS issue was not resolved?&lt;/P&gt;</description>
      <pubDate>Thu, 09 Feb 2017 17:57:45 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-js-Exceptions-regarding-failure-to-load-from-CDN-and-bad/m-p/56882#M31658</guid>
      <dc:creator>dustin1</dc:creator>
      <dc:date>2017-02-09T17:57:45Z</dc:date>
    </item>
    <item>
      <title>Re: Accept.js - Exceptions regarding failure to load from CDN and bad CORS headers</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-js-Exceptions-regarding-failure-to-load-from-CDN-and-bad/m-p/57174#M31906</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.developer.cybersource.com/t5/user/viewprofilepage/user-id/20972"&gt;@dustin1&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As of today, the CORS issue is resolved in sandbox.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For anyone else watching this thread, we've released code in sandbox that fixes these issues, 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>Tue, 07 Mar 2017 18:10:18 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-js-Exceptions-regarding-failure-to-load-from-CDN-and-bad/m-p/57174#M31906</guid>
      <dc:creator>Aaron</dc:creator>
      <dc:date>2017-03-07T18:10:18Z</dc:date>
    </item>
  </channel>
</rss>

