<?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: E_WC_14: Accept.js encryption failed? in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/E-WC-14-Accept-js-encryption-failed/m-p/69528#M42534</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.developer.cybersource.com/t5/user/viewprofilepage/user-id/20132"&gt;@kofhearts&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have a payment form as follows&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&amp;lt;body&amp;gt;
    &amp;lt;g:if test="${flash.message}"&amp;gt;
        &amp;lt;div class="message"&amp;gt;${flash.message}&amp;lt;/div&amp;gt;
    &amp;lt;/g:if&amp;gt;
    &amp;lt;div class="content"&amp;gt;
    &amp;lt;h1&amp;gt;Secure Checkout&amp;lt;/h1&amp;gt;

        &amp;lt;g:form name="paymentForm"
              method="POST"
              action="processAcceptPayment" &amp;gt;
            &amp;lt;input type="text" name="cardNumber" id="cardNumber" placeholder="cardNumber"/&amp;gt; &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;
            &amp;lt;input type="text" name="expMonth" id="expMonth" placeholder="expMonth"/&amp;gt; &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;
            &amp;lt;input type="text" name="expYear" id="expYear" placeholder="expYear"/&amp;gt; &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;
            &amp;lt;input type="text" name="cardCode" id="cardCode" placeholder="cardCode"/&amp;gt; &amp;lt;br&amp;gt;&amp;lt;br&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;button type="button" onclick="sendPaymentDataToAnet()"&amp;gt;Pay&amp;lt;/button&amp;gt;
        &amp;lt;/g:form&amp;gt;


    &amp;lt;/div&amp;gt;




&amp;lt;g:javascript&amp;gt;


    function sendPaymentDataToAnet() {
        var authData = {};
        authData.clientKey = "valid key";
        authData.apiLoginID = "valid id";

        var cardData = {};
        cardData.cardNumber = document.getElementById("cardNumber").value;
        cardData.month = document.getElementById("expMonth").value;
        cardData.year = document.getElementById("expYear").value;
        cardData.cardCode = document.getElementById("cardCode").value;

        var secureData = {};
        secureData.authData = authData;
        secureData.cardData = cardData;
        // If using banking information instead of card information,
        // send the bankData object instead of the cardData object.
        //
        // secureData.bankData = bankData;

        Accept.dispatchData(secureData, responseHandler);

    }

    function responseHandler(response) {
        if (response.messages.resultCode === "Error") {
            var i = 0;
            while (i &amp;lt; response.messages.message.length) {
                console.log(
                        response.messages.message[i].code + ": " +
                        response.messages.message[i].text
                );
                i = i + 1;
            }
        } else {
            paymentFormUpdate(response.opaqueData);
        }
    }

    function paymentFormUpdate(opaqueData) {
        document.getElementById("dataDescriptor").value = opaqueData.dataDescriptor;
        document.getElementById("dataValue").value = opaqueData.dataValue;

        document.getElementById("cardNumber").value = "";
        document.getElementById("expMonth").value = "";
        document.getElementById("expYear").value = "";
        document.getElementById("cardCode").value = "";
        document.getElementById("accountNumber").value = "";
        document.getElementById("routingNumber").value = "";
        document.getElementById("nameOnAccount").value = "";
        document.getElementById("accountType").value = "";

        document.getElementById("paymentForm").submit();
    }


&amp;lt;/g:javascript&amp;gt;
&amp;lt;/body&amp;gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;This generates the payment form and&amp;nbsp;&lt;/SPAN&gt;I enter test credit card numbers and click Pay.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The values i use are&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;no = 370000000000002&lt;/P&gt;&lt;P&gt;month = 12&lt;/P&gt;&lt;P&gt;year = 19&lt;/P&gt;&lt;P&gt;card code = 123&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get the following error in my javascript console. &lt;FONT color="#000000"&gt;&lt;A href="https://faceforpc.com/facetime-for-pc-download-mac-windows-10-8-7/" target="_self"&gt;FaceTime PC&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"E_WC_14: Accept.js encryption failed"&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was just following the accept.js tutorial from the official page.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://developer.authorize.net/api/reference/features/acceptjs.html" target="_blank" rel="nofollow noopener noreferrer"&gt;https://developer.authorize.net/api/reference/features/acceptjs.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="post-text"&gt;&lt;P&gt;I appreciate any help as to the reason for this "Encryption Failed" error? Thanks!&lt;/P&gt;&lt;/DIV&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;having the same issue. Did you now resolve this ?&lt;/P&gt;</description>
    <pubDate>Sat, 26 Oct 2019 08:32:30 GMT</pubDate>
    <dc:creator>karan56</dc:creator>
    <dc:date>2019-10-26T08:32:30Z</dc:date>
    <item>
      <title>E_WC_14: Accept.js encryption failed?</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/E-WC-14-Accept-js-encryption-failed/m-p/62066#M36447</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have a payment form as follows&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&amp;lt;body&amp;gt;
    &amp;lt;g:if test="${flash.message}"&amp;gt;
        &amp;lt;div class="message"&amp;gt;${flash.message}&amp;lt;/div&amp;gt;
    &amp;lt;/g:if&amp;gt;
    &amp;lt;div class="content"&amp;gt;
    &amp;lt;h1&amp;gt;Secure Checkout&amp;lt;/h1&amp;gt;

        &amp;lt;g:form name="paymentForm"
              method="POST"
              action="processAcceptPayment" &amp;gt;
            &amp;lt;input type="text" name="cardNumber" id="cardNumber" placeholder="cardNumber"/&amp;gt; &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;
            &amp;lt;input type="text" name="expMonth" id="expMonth" placeholder="expMonth"/&amp;gt; &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;
            &amp;lt;input type="text" name="expYear" id="expYear" placeholder="expYear"/&amp;gt; &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;
            &amp;lt;input type="text" name="cardCode" id="cardCode" placeholder="cardCode"/&amp;gt; &amp;lt;br&amp;gt;&amp;lt;br&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;button type="button" onclick="sendPaymentDataToAnet()"&amp;gt;Pay&amp;lt;/button&amp;gt;
        &amp;lt;/g:form&amp;gt;


    &amp;lt;/div&amp;gt;




&amp;lt;g:javascript&amp;gt;


    function sendPaymentDataToAnet() {
        var authData = {};
        authData.clientKey = "valid key";
        authData.apiLoginID = "valid id";

        var cardData = {};
        cardData.cardNumber = document.getElementById("cardNumber").value;
        cardData.month = document.getElementById("expMonth").value;
        cardData.year = document.getElementById("expYear").value;
        cardData.cardCode = document.getElementById("cardCode").value;

        var secureData = {};
        secureData.authData = authData;
        secureData.cardData = cardData;
        // If using banking information instead of card information,
        // send the bankData object instead of the cardData object.
        //
        // secureData.bankData = bankData;

        Accept.dispatchData(secureData, responseHandler);

    }

    function responseHandler(response) {
        if (response.messages.resultCode === "Error") {
            var i = 0;
            while (i &amp;lt; response.messages.message.length) {
                console.log(
                        response.messages.message[i].code + ": " +
                        response.messages.message[i].text
                );
                i = i + 1;
            }
        } else {
            paymentFormUpdate(response.opaqueData);
        }
    }

    function paymentFormUpdate(opaqueData) {
        document.getElementById("dataDescriptor").value = opaqueData.dataDescriptor;
        document.getElementById("dataValue").value = opaqueData.dataValue;

        document.getElementById("cardNumber").value = "";
        document.getElementById("expMonth").value = "";
        document.getElementById("expYear").value = "";
        document.getElementById("cardCode").value = "";
        document.getElementById("accountNumber").value = "";
        document.getElementById("routingNumber").value = "";
        document.getElementById("nameOnAccount").value = "";
        document.getElementById("accountType").value = "";

        document.getElementById("paymentForm").submit();
    }


&amp;lt;/g:javascript&amp;gt;
&amp;lt;/body&amp;gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;This generates the payment form and&amp;nbsp;&lt;/SPAN&gt;I enter test credit card numbers and click Pay.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The values i use are&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;no = 370000000000002&lt;/P&gt;&lt;P&gt;month = 12&lt;/P&gt;&lt;P&gt;year = 19&lt;/P&gt;&lt;P&gt;card code = 123&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get the following error in my javascript console.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"E_WC_14: Accept.js encryption failed"&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was just following the accept.js tutorial from the official page.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://developer.authorize.net/api/reference/features/acceptjs.html" target="_blank" rel="nofollow noreferrer"&gt;https://developer.authorize.net/api/reference/features/acceptjs.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="post-text"&gt;&lt;P&gt;I appreciate any help as to the reason for this "Encryption Failed" error? Thanks!&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Sun, 11 Mar 2018 07:47:23 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/E-WC-14-Accept-js-encryption-failed/m-p/62066#M36447</guid>
      <dc:creator>kofhearts</dc:creator>
      <dc:date>2018-03-11T07:47:23Z</dc:date>
    </item>
    <item>
      <title>Re: E_WC_14: Accept.js encryption failed?</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/E-WC-14-Accept-js-encryption-failed/m-p/69528#M42534</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.developer.cybersource.com/t5/user/viewprofilepage/user-id/20132"&gt;@kofhearts&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have a payment form as follows&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&amp;lt;body&amp;gt;
    &amp;lt;g:if test="${flash.message}"&amp;gt;
        &amp;lt;div class="message"&amp;gt;${flash.message}&amp;lt;/div&amp;gt;
    &amp;lt;/g:if&amp;gt;
    &amp;lt;div class="content"&amp;gt;
    &amp;lt;h1&amp;gt;Secure Checkout&amp;lt;/h1&amp;gt;

        &amp;lt;g:form name="paymentForm"
              method="POST"
              action="processAcceptPayment" &amp;gt;
            &amp;lt;input type="text" name="cardNumber" id="cardNumber" placeholder="cardNumber"/&amp;gt; &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;
            &amp;lt;input type="text" name="expMonth" id="expMonth" placeholder="expMonth"/&amp;gt; &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;
            &amp;lt;input type="text" name="expYear" id="expYear" placeholder="expYear"/&amp;gt; &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;
            &amp;lt;input type="text" name="cardCode" id="cardCode" placeholder="cardCode"/&amp;gt; &amp;lt;br&amp;gt;&amp;lt;br&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;button type="button" onclick="sendPaymentDataToAnet()"&amp;gt;Pay&amp;lt;/button&amp;gt;
        &amp;lt;/g:form&amp;gt;


    &amp;lt;/div&amp;gt;




&amp;lt;g:javascript&amp;gt;


    function sendPaymentDataToAnet() {
        var authData = {};
        authData.clientKey = "valid key";
        authData.apiLoginID = "valid id";

        var cardData = {};
        cardData.cardNumber = document.getElementById("cardNumber").value;
        cardData.month = document.getElementById("expMonth").value;
        cardData.year = document.getElementById("expYear").value;
        cardData.cardCode = document.getElementById("cardCode").value;

        var secureData = {};
        secureData.authData = authData;
        secureData.cardData = cardData;
        // If using banking information instead of card information,
        // send the bankData object instead of the cardData object.
        //
        // secureData.bankData = bankData;

        Accept.dispatchData(secureData, responseHandler);

    }

    function responseHandler(response) {
        if (response.messages.resultCode === "Error") {
            var i = 0;
            while (i &amp;lt; response.messages.message.length) {
                console.log(
                        response.messages.message[i].code + ": " +
                        response.messages.message[i].text
                );
                i = i + 1;
            }
        } else {
            paymentFormUpdate(response.opaqueData);
        }
    }

    function paymentFormUpdate(opaqueData) {
        document.getElementById("dataDescriptor").value = opaqueData.dataDescriptor;
        document.getElementById("dataValue").value = opaqueData.dataValue;

        document.getElementById("cardNumber").value = "";
        document.getElementById("expMonth").value = "";
        document.getElementById("expYear").value = "";
        document.getElementById("cardCode").value = "";
        document.getElementById("accountNumber").value = "";
        document.getElementById("routingNumber").value = "";
        document.getElementById("nameOnAccount").value = "";
        document.getElementById("accountType").value = "";

        document.getElementById("paymentForm").submit();
    }


&amp;lt;/g:javascript&amp;gt;
&amp;lt;/body&amp;gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;This generates the payment form and&amp;nbsp;&lt;/SPAN&gt;I enter test credit card numbers and click Pay.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The values i use are&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;no = 370000000000002&lt;/P&gt;&lt;P&gt;month = 12&lt;/P&gt;&lt;P&gt;year = 19&lt;/P&gt;&lt;P&gt;card code = 123&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get the following error in my javascript console. &lt;FONT color="#000000"&gt;&lt;A href="https://faceforpc.com/facetime-for-pc-download-mac-windows-10-8-7/" target="_self"&gt;FaceTime PC&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"E_WC_14: Accept.js encryption failed"&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was just following the accept.js tutorial from the official page.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://developer.authorize.net/api/reference/features/acceptjs.html" target="_blank" rel="nofollow noopener noreferrer"&gt;https://developer.authorize.net/api/reference/features/acceptjs.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="post-text"&gt;&lt;P&gt;I appreciate any help as to the reason for this "Encryption Failed" error? Thanks!&lt;/P&gt;&lt;/DIV&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;having the same issue. Did you now resolve this ?&lt;/P&gt;</description>
      <pubDate>Sat, 26 Oct 2019 08:32:30 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/E-WC-14-Accept-js-encryption-failed/m-p/69528#M42534</guid>
      <dc:creator>karan56</dc:creator>
      <dc:date>2019-10-26T08:32:30Z</dc:date>
    </item>
  </channel>
</rss>

