<?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 Accept.js - E00007/E_WC_21 &amp;quot;User authentication failed due to invalid authentication values.&amp;quot; in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-js-E00007-E-WC-21-quot-User-authentication-failed-due-to/m-p/63382#M37520</link>
    <description>&lt;P&gt;I have developed an online payment page using PHP and jQuery that allows both CIM payment submissions as well manual credit card entry.&lt;BR /&gt;I have no problems submitting the CIM payments to the sandbox but when &lt;STRONG&gt;I use the exact same merchantAuthenticationType values&lt;/STRONG&gt;&lt;BR /&gt;to Accept.dispatchData() I get an E00007/E_WC_21 "User authentication failed due to invalid authentication values." error.&lt;/P&gt;&lt;P&gt;I have been going through the previous posts about this but none of them answered why one method works while the other doesn't when both use the same authentication values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;CIM process&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;client javascript&lt;/FONT&gt;&lt;/P&gt;&lt;PRE&gt;function submitCIMPayment(data) {
        var submission = {
            _token: Billing.token,
            amount: data['amount'], cardCode: data['card-cvv'],
            gateway_id: data['gateway_id'], gateway_ppid: data['gateway_ppid']
        };
        $.post("/billing/payment", submission)
            .done(function (data) {
                ...
            })
            .fail(function(data){
                ...
            });
    }&lt;/PRE&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;server php&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;    public function chargeProfile($authAccount, $amount, $cardCode, $user)
    {
        $profileToCharge = new AnetAPI\CustomerProfilePaymentType();
        $profileToCharge-&amp;gt;setCustomerProfileId($authAccount-&amp;gt;gateway_id);
        $paymentProfile = new AnetAPI\PaymentProfileType();
        $paymentProfile-&amp;gt;setPaymentProfileId($authAccount-&amp;gt;gateway_ppid);
        $paymentProfile-&amp;gt;setCardCode($cardCode);
        $profileToCharge-&amp;gt;setPaymentProfile($paymentProfile);
        $transactionRequestType = new AnetAPI\TransactionRequestType();
        $transactionRequestType-&amp;gt;setTransactionType("authCaptureTransaction");
        $transactionRequestType-&amp;gt;setAmount($amount);
        $transactionRequestType-&amp;gt;setProfile($profileToCharge);
        $request = new AnetAPI\CreateTransactionRequest();
        $merchant = new AnetAPI\MerchantAuthenticationType()
        $merchant-&amp;gt;setName($config['login']);
        $merchant-&amp;gt;setTransactionKey($config['key']);
        $request-&amp;gt;setMerchantAuthentication($merchant)
        $request-&amp;gt;setTransactionRequest($transactionRequestType);
        $controller = new AnetController\CreateTransactionController($request);
        $response = $controller-&amp;gt;executeWithApiResponse('https://apitest.authorize.net');
        ...
    }&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There have been no errors with the CIM process.&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;Accept.JS process&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;client javascript&lt;/FONT&gt;&lt;/P&gt;&lt;PRE&gt;        &amp;lt;script src="https://jstest.authorize.net/v1/Accept.js" type="text/javascript" charset="utf-8"&amp;gt;&amp;lt;/script&amp;gt;

        function sendCardDataToAnet(data) {
            var secureData = {}, authData = {}, cardData = {};

            cardData.cardNumber = data['card-number'];
            cardData.month = data['expiration'][1];
            cardData.year = data['expiration'][0];
            cardData.cardCode = data['card-cvv'];

            authData.clientKey = Billing.clientKey;
            authData.apiLoginID = Billing.apiLoginID;

            secureData.cardData = cardData;
            secureData.authData = authData;

            /* Dispatch Data to Accept.js */
            Accept.dispatchData(secureData, 'anetResponseHandler');
        }

        function anetResponseHandler(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 {
                submitSecurePayment(response.opaqueData);
            }
        }&lt;/PRE&gt;&lt;P&gt;The console output is:&amp;nbsp;E_WC_21: User authentication failed due to invalid authentication values.&lt;/P&gt;</description>
    <pubDate>Wed, 13 Jun 2018 16:57:54 GMT</pubDate>
    <dc:creator>wdbaker54</dc:creator>
    <dc:date>2018-06-13T16:57:54Z</dc:date>
    <item>
      <title>Accept.js - E00007/E_WC_21 "User authentication failed due to invalid authentication values."</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-js-E00007-E-WC-21-quot-User-authentication-failed-due-to/m-p/63382#M37520</link>
      <description>&lt;P&gt;I have developed an online payment page using PHP and jQuery that allows both CIM payment submissions as well manual credit card entry.&lt;BR /&gt;I have no problems submitting the CIM payments to the sandbox but when &lt;STRONG&gt;I use the exact same merchantAuthenticationType values&lt;/STRONG&gt;&lt;BR /&gt;to Accept.dispatchData() I get an E00007/E_WC_21 "User authentication failed due to invalid authentication values." error.&lt;/P&gt;&lt;P&gt;I have been going through the previous posts about this but none of them answered why one method works while the other doesn't when both use the same authentication values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;CIM process&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;client javascript&lt;/FONT&gt;&lt;/P&gt;&lt;PRE&gt;function submitCIMPayment(data) {
        var submission = {
            _token: Billing.token,
            amount: data['amount'], cardCode: data['card-cvv'],
            gateway_id: data['gateway_id'], gateway_ppid: data['gateway_ppid']
        };
        $.post("/billing/payment", submission)
            .done(function (data) {
                ...
            })
            .fail(function(data){
                ...
            });
    }&lt;/PRE&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;server php&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;    public function chargeProfile($authAccount, $amount, $cardCode, $user)
    {
        $profileToCharge = new AnetAPI\CustomerProfilePaymentType();
        $profileToCharge-&amp;gt;setCustomerProfileId($authAccount-&amp;gt;gateway_id);
        $paymentProfile = new AnetAPI\PaymentProfileType();
        $paymentProfile-&amp;gt;setPaymentProfileId($authAccount-&amp;gt;gateway_ppid);
        $paymentProfile-&amp;gt;setCardCode($cardCode);
        $profileToCharge-&amp;gt;setPaymentProfile($paymentProfile);
        $transactionRequestType = new AnetAPI\TransactionRequestType();
        $transactionRequestType-&amp;gt;setTransactionType("authCaptureTransaction");
        $transactionRequestType-&amp;gt;setAmount($amount);
        $transactionRequestType-&amp;gt;setProfile($profileToCharge);
        $request = new AnetAPI\CreateTransactionRequest();
        $merchant = new AnetAPI\MerchantAuthenticationType()
        $merchant-&amp;gt;setName($config['login']);
        $merchant-&amp;gt;setTransactionKey($config['key']);
        $request-&amp;gt;setMerchantAuthentication($merchant)
        $request-&amp;gt;setTransactionRequest($transactionRequestType);
        $controller = new AnetController\CreateTransactionController($request);
        $response = $controller-&amp;gt;executeWithApiResponse('https://apitest.authorize.net');
        ...
    }&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There have been no errors with the CIM process.&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;Accept.JS process&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;client javascript&lt;/FONT&gt;&lt;/P&gt;&lt;PRE&gt;        &amp;lt;script src="https://jstest.authorize.net/v1/Accept.js" type="text/javascript" charset="utf-8"&amp;gt;&amp;lt;/script&amp;gt;

        function sendCardDataToAnet(data) {
            var secureData = {}, authData = {}, cardData = {};

            cardData.cardNumber = data['card-number'];
            cardData.month = data['expiration'][1];
            cardData.year = data['expiration'][0];
            cardData.cardCode = data['card-cvv'];

            authData.clientKey = Billing.clientKey;
            authData.apiLoginID = Billing.apiLoginID;

            secureData.cardData = cardData;
            secureData.authData = authData;

            /* Dispatch Data to Accept.js */
            Accept.dispatchData(secureData, 'anetResponseHandler');
        }

        function anetResponseHandler(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 {
                submitSecurePayment(response.opaqueData);
            }
        }&lt;/PRE&gt;&lt;P&gt;The console output is:&amp;nbsp;E_WC_21: User authentication failed due to invalid authentication values.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jun 2018 16:57:54 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-js-E00007-E-WC-21-quot-User-authentication-failed-due-to/m-p/63382#M37520</guid>
      <dc:creator>wdbaker54</dc:creator>
      <dc:date>2018-06-13T16:57:54Z</dc:date>
    </item>
    <item>
      <title>Re: Accept.js - E00007/E_WC_21 "User authentication failed due to invalid authentication values</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-js-E00007-E-WC-21-quot-User-authentication-failed-due-to/m-p/63397#M37531</link>
      <description>&lt;P&gt;In case someone needs more information, Here is the JSON data for the&amp;nbsp;Accept.dispatchData() secureData parameter:&lt;/P&gt;&lt;PRE&gt;{
    "authData": {
      "apiLoginID": "72RxxxvP",
      "clientKey": "295U3Xxxx7DLQ3dg"
    },
    "cardData": {
      "cardCode": "151",
      "cardNumber": "4111111111111111",
      "month": "07",
      "year": "2024"
    }
}&lt;/PRE&gt;&lt;P&gt;(I don't want to be paranoid but the apiLoginID and clientKey were tweaked even though this is a sandbox account)&lt;/P&gt;&lt;P&gt;and a JSON dump of the merchantAuthenticationType values:&lt;/P&gt;&lt;PRE&gt;{
    "name": "72RxxxvP",
    "transactionKey": "295U3Xxxx7DLQ3dg"
}&lt;/PRE&gt;</description>
      <pubDate>Thu, 14 Jun 2018 16:22:23 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-js-E00007-E-WC-21-quot-User-authentication-failed-due-to/m-p/63397#M37531</guid>
      <dc:creator>wdbaker54</dc:creator>
      <dc:date>2018-06-14T16:22:23Z</dc:date>
    </item>
    <item>
      <title>Re: Accept.js - E00007/E_WC_21 "User authentication failed due to invalid authentication values</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-js-E00007-E-WC-21-quot-User-authentication-failed-due-to/m-p/63400#M37534</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.developer.cybersource.com/t5/user/viewprofilepage/user-id/1928"&gt;@wdbaker54&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The error is with your clientKey in Accept.js, as per the dump you have shared for the authData the authentication values which you are using are incorrect.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please generate a CleintKey by&amp;nbsp;&lt;SPAN&gt;logging into the&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://sandbox.authorize.net/" rel="nofollow" target="_blank"&gt;Merchant Interface&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;and navigating to&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Account --&amp;gt; Security Settings --&amp;gt; Manage Public Client Key,&amp;nbsp;&lt;/STRONG&gt;&lt;SPAN&gt;and use this as&amp;nbsp;&lt;FONT face="terminal,monaco,monospace"&gt;&lt;FONT face="courier new,courier,monospace"&gt;clientKey&lt;/FONT&gt; &lt;/FONT&gt;in &lt;FONT face="courier new,courier,monospace"&gt;authData.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Hope this Helps !&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jun 2018 18:10:05 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-js-E00007-E-WC-21-quot-User-authentication-failed-due-to/m-p/63400#M37534</guid>
      <dc:creator>kikmak42</dc:creator>
      <dc:date>2018-06-14T18:10:05Z</dc:date>
    </item>
    <item>
      <title>Re: Accept.js - E00007/E_WC_21 "User authentication failed due to invalid authentication values</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-js-E00007-E-WC-21-quot-User-authentication-failed-due-to/m-p/63403#M37536</link>
      <description>&lt;P&gt;So what you are saying is that they don't use the same values:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;CIM process uses the API Login ID and Transaction Key pulled from the &lt;U&gt;API Credentials &amp;amp; Keys&lt;/U&gt; page for the merchantAuthenticationType: name and transactionKey&lt;/LI&gt;&lt;LI&gt;Accept.js process uses API Login ID pulled from the &lt;U&gt;API Credentials &amp;amp; Keys&lt;/U&gt; page and Client Key pulled from the &lt;U&gt;Public Client Key&lt;/U&gt; page for: apiLoginID and clientKey&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;My mistake was that I thought that both processes used the same values - only the API Login ID is used for both. I am now beyond that problem but still haven't been successful in completing an accept.js transaction but it is now with the remainder of my code and not my understanding of the API.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for pointing me in the right direction - I read and re-read the APIs and still missed the difference.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jun 2018 20:08:11 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-js-E00007-E-WC-21-quot-User-authentication-failed-due-to/m-p/63403#M37536</guid>
      <dc:creator>wdbaker54</dc:creator>
      <dc:date>2018-06-14T20:08:11Z</dc:date>
    </item>
    <item>
      <title>Re: Accept.js - E00007/E_WC_21 "User authentication failed due to invalid authentication values</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-js-E00007-E-WC-21-quot-User-authentication-failed-due-to/m-p/63408#M37540</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.developer.cybersource.com/t5/user/viewprofilepage/user-id/1928"&gt;@wdbaker54&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope the below link helps&amp;nbsp;&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#Generating_and_Using_the_Public_Client_Key" target="_blank"&gt;https://developer.authorize.net/api/reference/features/acceptjs.html#Generating_and_Using_the_Public_Client_Key&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jun 2018 05:02:00 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-js-E00007-E-WC-21-quot-User-authentication-failed-due-to/m-p/63408#M37540</guid>
      <dc:creator>Anurag</dc:creator>
      <dc:date>2018-06-15T05:02:00Z</dc:date>
    </item>
  </channel>
</rss>

