<?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: E00007 - User authentication failed due to invalid authentication values. in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/E00007-User-authentication-failed-due-to-invalid-authentication/m-p/88781#M55955</link>
    <description>&lt;P&gt;Additional information.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;config.py:&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;    # Authorize.net test credentials
    JAVASCRIPT_URL = "https://jstest.authorize.net/v1/Accept.js"
    API_LOGIN_ID = "9..."
    PUBLIC_CLIENT_KEY = (
        "7..."
    )
    TRANSACTION_KEY = "6..."
..........
    # Authorize.net production credentials
    JAVASCRIPT_URL = "https://js.authorize.net/v1/Accept.js"
    API_LOGIN_ID = "8..."
    PUBLIC_CLIENT_KEY = (
        "4..."
    )
    TRANSACTION_KEY = "7..."&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;capture.html (the card information is captured and the payment is prepared):&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;script type="text/javascript" src="{{ JAVASCRIPT_URL }}" charset="utf-8"&amp;gt;
&amp;lt;/script&amp;gt;

&amp;lt;div class="container-narrow"&amp;gt;
  &amp;lt;div class="panel owl50"&amp;gt;
    &amp;lt;div class="justify-center"&amp;gt;
      &amp;lt;h1&amp;gt;Payment information&amp;lt;/h1&amp;gt;
    &amp;lt;/div&amp;gt;
    &amp;lt;form class="owl50" id="paymentForm" method="POST" action="..."&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;div class="owl20"&amp;gt;
        &amp;lt;div&amp;gt;
          &amp;lt;label for="cardNumber"&amp;gt;Card number:&amp;lt;/label&amp;gt;
          &amp;lt;input class="form-input" type="text" name="cardNumber" id="cardNumber" placeholder="card number" /&amp;gt;
          &amp;lt;p class="text-small text-red" id="cardNumberError"&amp;gt;&amp;lt;/p&amp;gt;
        &amp;lt;/div&amp;gt;
        &amp;lt;div&amp;gt;
          &amp;lt;label for="expMonth"&amp;gt;Expiration month:&amp;lt;/label&amp;gt;
          &amp;lt;input class="form-input" type="text" name="expMonth" id="expMonth" placeholder="expiration month" /&amp;gt;
          &amp;lt;p class="text-small text-red" id="expMonthError"&amp;gt;&amp;lt;/p&amp;gt;
        &amp;lt;/div&amp;gt;
        &amp;lt;div&amp;gt;
          &amp;lt;label for="expYear"&amp;gt;Expiration year:&amp;lt;/label&amp;gt;
          &amp;lt;input class="form-input" type="text" name="expYear" id="expYear" placeholder="expiration year" /&amp;gt;
          &amp;lt;p class="text-small text-red" id="expYearError"&amp;gt;&amp;lt;/p&amp;gt;
        &amp;lt;/div&amp;gt;
        &amp;lt;div&amp;gt;
          &amp;lt;label for="cardCode"&amp;gt;CVV code:&amp;lt;/label&amp;gt;
          &amp;lt;input class="form-input" type="text" name="cardCode" id="cardCode" placeholder="cvv code" /&amp;gt;
          &amp;lt;p class="text-small text-red" id="cardCodeError"&amp;gt;&amp;lt;/p&amp;gt;
        &amp;lt;/div&amp;gt;
      &amp;lt;/div&amp;gt;
      &amp;lt;p class="text-red justify-center" id="dataEntryError"&amp;gt;&amp;lt;/p&amp;gt;
      &amp;lt;div class="owl20"&amp;gt;
        &amp;lt;button class="button button-wide button-green" type="button" onclick="sendPaymentDataToAnet()" /&amp;gt;
        Make the payment
        &amp;lt;/button&amp;gt;
        &amp;lt;!-- &amp;lt;input class="button button-wide button-yellow" type="submit" name="submit" value="Cancel" /&amp;gt; --&amp;gt;
        &amp;lt;a class="button button-wide button-yellow" href="/members/cart"&amp;gt;Cancel&amp;lt;/a&amp;gt;
      &amp;lt;/div&amp;gt;
    &amp;lt;/form&amp;gt;
  &amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;

&amp;lt;script type="text/javascript"&amp;gt;

  function sendPaymentDataToAnet() {
    // clear the error messages
    document.getElementById("cardNumberError").innerHTML = "";
    document.getElementById("expMonthError").innerHTML = "";
    document.getElementById("expYearError").innerHTML = "";
    document.getElementById("cardCodeError").innerHTML = "";

    var authData = {};
    authData.clientKey = "{{ PUBLIC_CLIENT_KEY }}";
    authData.apiLoginID = "{{ API_LOGIN_ID }}";

    var cardData = {};
    // cardData.cardNumber = document.getElementById("cardNumber").value;
    // strip blanks from the card number
    cardData.cardNumber = document.getElementById("cardNumber").value.split(" ").join("");
    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;

    Accept.dispatchData(secureData, responseHandler);

    function responseHandler(response) {
      cardCode = document.getElementById("cardCode").value;
      // display authorizenet errors and require the CVV
      if (response.messages.resultCode === "Error" ||
        cardCode == "") {
        // set the dataEntryError message for invalid input
        document.getElementById("dataEntryError").innerHTML = "Data entry error.";
        if (cardCode == "") {
          document.getElementById("cardCodeError").innerHTML = "Please provide valid CVV."
        }
        var i = 0;
        while (i &amp;lt; response.messages.message.length) {
          if (response.messages.message[i].code == "E_WC_05") {
            document.getElementById("cardNumberError").innerHTML = response.messages.message[i].text;
          }
          if (response.messages.message[i].code == "E_WC_06") {
            document.getElementById("expMonthError").innerHTML = response.messages.message[i].text;
          }
          if (response.messages.message[i].code == "E_WC_08") {
            document.getElementById("expMonthError").innerHTML = response.messages.message[i].text;
          }
          if (response.messages.message[i].code == "E_WC_07") {
            document.getElementById("expYearError").innerHTML = response.messages.message[i].text;
          }
          if (response.messages.message[i].code == "E_WC_08") {
            document.getElementById("expYearError").innerHTML = response.messages.message[i].text
          }
          if (response.messages.message[i].code == "E_WC_15") {
            document.getElementById("cardCodeError").innerHTML = response.messages.message[i].text;
          }
          console.log(
            response.messages.message[i].code + ": " +
            response.messages.message[i].text
          );
          i = i + 1;
        }
      } else {
        paymentFormUpdate(response.opaqueData);
      }
    }

    function paymentFormUpdate(opaqueData) {
      document.getElementById("dataEntryError").innerHTML = "";
      document.getElementById("dataDescriptor").value = opaqueData.dataDescriptor;
      document.getElementById("dataValue").value = opaqueData.dataValue;

      // If using your own form to collect the sensitive data from the customer,
      // blank out the fields before submitting them to your server.
      document.getElementById("cardNumber").value = "";
      document.getElementById("expMonth").value = "";
      document.getElementById("expYear").value = "";
      document.getElementById("cardCode").value = "";

      document.getElementById("paymentForm").submit();
    }
  }
&amp;lt;/script&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;The credentials are passed and temporarily printed:&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;    # Create a merchantAuthenticationType object with authentication details
    merchantAuth = apicontractsv1.merchantAuthenticationType()
    merchantAuth.name = app.config["API_LOGIN_ID"]
    merchantAuth.transactionKey = app.config["TRANSACTION_KEY"]
    print(app.config["JAVASCRIPT_URL"])
    print("API login ID: ", app.config["API_LOGIN_ID"])
    print("Transaction key: ", app.config["TRANSACTION_KEY"])&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;From the log using the sandbox credentials:&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;https://jstest.authorize.net/v1/Accept.js
API login ID: 9...
Transaction key: 6...
Successfully created transaction with Transaction ID: ...
Transaction Response Code: 1
Message Code: 1&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;From the log using the production credentials:&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;https://js.authorize.net/v1/Accept.js
API login ID: 8...
Transaction key: 7...
Error Code: E00007
Error Message: User authentication failed due to invalid authentication ...&lt;/LI-CODE&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, 11 Feb 2024 18:56:19 GMT</pubDate>
    <dc:creator>Burke</dc:creator>
    <dc:date>2024-02-11T18:56:19Z</dc:date>
    <item>
      <title>E00007 - User authentication failed due to invalid authentication values.</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/E00007-User-authentication-failed-due-to-invalid-authentication/m-p/88769#M55943</link>
      <description>&lt;DIV class=""&gt;I have a sandbox environment setup and it is working as expected. &amp;nbsp;I am in the process of migrating to the live system, and I am using the example code and my own form.&amp;nbsp; The system is not accepting the authentication credentials.&amp;nbsp; I’ve changed the transaction key a time or two and received the same results. &amp;nbsp;I am not aware of a way to change the API login ID.&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;Could you please share any thoughts or suggestion that could shed light on this issue?&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;Example code: &lt;A href="https://developer.authorize.net/api/reference/features/acceptjs.html#Example_of_the_Complete_HTML_Page" target="_self"&gt;https://developer.authorize.net/api/reference/features/acceptjs.html#Example_of_the_Complete_HTML_Page&lt;/A&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;Production library (own form): &lt;A href="https://js.authorize.net/v1/Accept.js" target="_blank" rel="noopener"&gt;https://js.authorize.net/v1/Accept.js&lt;/A&gt;&lt;/DIV&gt;</description>
      <pubDate>Sat, 10 Feb 2024 00:10:43 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/E00007-User-authentication-failed-due-to-invalid-authentication/m-p/88769#M55943</guid>
      <dc:creator>Burke</dc:creator>
      <dc:date>2024-02-10T00:10:43Z</dc:date>
    </item>
    <item>
      <title>Re: E00007 - User authentication failed due to invalid authentication values.</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/E00007-User-authentication-failed-due-to-invalid-authentication/m-p/88781#M55955</link>
      <description>&lt;P&gt;Additional information.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;config.py:&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;    # Authorize.net test credentials
    JAVASCRIPT_URL = "https://jstest.authorize.net/v1/Accept.js"
    API_LOGIN_ID = "9..."
    PUBLIC_CLIENT_KEY = (
        "7..."
    )
    TRANSACTION_KEY = "6..."
..........
    # Authorize.net production credentials
    JAVASCRIPT_URL = "https://js.authorize.net/v1/Accept.js"
    API_LOGIN_ID = "8..."
    PUBLIC_CLIENT_KEY = (
        "4..."
    )
    TRANSACTION_KEY = "7..."&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;capture.html (the card information is captured and the payment is prepared):&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;script type="text/javascript" src="{{ JAVASCRIPT_URL }}" charset="utf-8"&amp;gt;
&amp;lt;/script&amp;gt;

&amp;lt;div class="container-narrow"&amp;gt;
  &amp;lt;div class="panel owl50"&amp;gt;
    &amp;lt;div class="justify-center"&amp;gt;
      &amp;lt;h1&amp;gt;Payment information&amp;lt;/h1&amp;gt;
    &amp;lt;/div&amp;gt;
    &amp;lt;form class="owl50" id="paymentForm" method="POST" action="..."&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;div class="owl20"&amp;gt;
        &amp;lt;div&amp;gt;
          &amp;lt;label for="cardNumber"&amp;gt;Card number:&amp;lt;/label&amp;gt;
          &amp;lt;input class="form-input" type="text" name="cardNumber" id="cardNumber" placeholder="card number" /&amp;gt;
          &amp;lt;p class="text-small text-red" id="cardNumberError"&amp;gt;&amp;lt;/p&amp;gt;
        &amp;lt;/div&amp;gt;
        &amp;lt;div&amp;gt;
          &amp;lt;label for="expMonth"&amp;gt;Expiration month:&amp;lt;/label&amp;gt;
          &amp;lt;input class="form-input" type="text" name="expMonth" id="expMonth" placeholder="expiration month" /&amp;gt;
          &amp;lt;p class="text-small text-red" id="expMonthError"&amp;gt;&amp;lt;/p&amp;gt;
        &amp;lt;/div&amp;gt;
        &amp;lt;div&amp;gt;
          &amp;lt;label for="expYear"&amp;gt;Expiration year:&amp;lt;/label&amp;gt;
          &amp;lt;input class="form-input" type="text" name="expYear" id="expYear" placeholder="expiration year" /&amp;gt;
          &amp;lt;p class="text-small text-red" id="expYearError"&amp;gt;&amp;lt;/p&amp;gt;
        &amp;lt;/div&amp;gt;
        &amp;lt;div&amp;gt;
          &amp;lt;label for="cardCode"&amp;gt;CVV code:&amp;lt;/label&amp;gt;
          &amp;lt;input class="form-input" type="text" name="cardCode" id="cardCode" placeholder="cvv code" /&amp;gt;
          &amp;lt;p class="text-small text-red" id="cardCodeError"&amp;gt;&amp;lt;/p&amp;gt;
        &amp;lt;/div&amp;gt;
      &amp;lt;/div&amp;gt;
      &amp;lt;p class="text-red justify-center" id="dataEntryError"&amp;gt;&amp;lt;/p&amp;gt;
      &amp;lt;div class="owl20"&amp;gt;
        &amp;lt;button class="button button-wide button-green" type="button" onclick="sendPaymentDataToAnet()" /&amp;gt;
        Make the payment
        &amp;lt;/button&amp;gt;
        &amp;lt;!-- &amp;lt;input class="button button-wide button-yellow" type="submit" name="submit" value="Cancel" /&amp;gt; --&amp;gt;
        &amp;lt;a class="button button-wide button-yellow" href="/members/cart"&amp;gt;Cancel&amp;lt;/a&amp;gt;
      &amp;lt;/div&amp;gt;
    &amp;lt;/form&amp;gt;
  &amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;

&amp;lt;script type="text/javascript"&amp;gt;

  function sendPaymentDataToAnet() {
    // clear the error messages
    document.getElementById("cardNumberError").innerHTML = "";
    document.getElementById("expMonthError").innerHTML = "";
    document.getElementById("expYearError").innerHTML = "";
    document.getElementById("cardCodeError").innerHTML = "";

    var authData = {};
    authData.clientKey = "{{ PUBLIC_CLIENT_KEY }}";
    authData.apiLoginID = "{{ API_LOGIN_ID }}";

    var cardData = {};
    // cardData.cardNumber = document.getElementById("cardNumber").value;
    // strip blanks from the card number
    cardData.cardNumber = document.getElementById("cardNumber").value.split(" ").join("");
    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;

    Accept.dispatchData(secureData, responseHandler);

    function responseHandler(response) {
      cardCode = document.getElementById("cardCode").value;
      // display authorizenet errors and require the CVV
      if (response.messages.resultCode === "Error" ||
        cardCode == "") {
        // set the dataEntryError message for invalid input
        document.getElementById("dataEntryError").innerHTML = "Data entry error.";
        if (cardCode == "") {
          document.getElementById("cardCodeError").innerHTML = "Please provide valid CVV."
        }
        var i = 0;
        while (i &amp;lt; response.messages.message.length) {
          if (response.messages.message[i].code == "E_WC_05") {
            document.getElementById("cardNumberError").innerHTML = response.messages.message[i].text;
          }
          if (response.messages.message[i].code == "E_WC_06") {
            document.getElementById("expMonthError").innerHTML = response.messages.message[i].text;
          }
          if (response.messages.message[i].code == "E_WC_08") {
            document.getElementById("expMonthError").innerHTML = response.messages.message[i].text;
          }
          if (response.messages.message[i].code == "E_WC_07") {
            document.getElementById("expYearError").innerHTML = response.messages.message[i].text;
          }
          if (response.messages.message[i].code == "E_WC_08") {
            document.getElementById("expYearError").innerHTML = response.messages.message[i].text
          }
          if (response.messages.message[i].code == "E_WC_15") {
            document.getElementById("cardCodeError").innerHTML = response.messages.message[i].text;
          }
          console.log(
            response.messages.message[i].code + ": " +
            response.messages.message[i].text
          );
          i = i + 1;
        }
      } else {
        paymentFormUpdate(response.opaqueData);
      }
    }

    function paymentFormUpdate(opaqueData) {
      document.getElementById("dataEntryError").innerHTML = "";
      document.getElementById("dataDescriptor").value = opaqueData.dataDescriptor;
      document.getElementById("dataValue").value = opaqueData.dataValue;

      // If using your own form to collect the sensitive data from the customer,
      // blank out the fields before submitting them to your server.
      document.getElementById("cardNumber").value = "";
      document.getElementById("expMonth").value = "";
      document.getElementById("expYear").value = "";
      document.getElementById("cardCode").value = "";

      document.getElementById("paymentForm").submit();
    }
  }
&amp;lt;/script&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;The credentials are passed and temporarily printed:&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;    # Create a merchantAuthenticationType object with authentication details
    merchantAuth = apicontractsv1.merchantAuthenticationType()
    merchantAuth.name = app.config["API_LOGIN_ID"]
    merchantAuth.transactionKey = app.config["TRANSACTION_KEY"]
    print(app.config["JAVASCRIPT_URL"])
    print("API login ID: ", app.config["API_LOGIN_ID"])
    print("Transaction key: ", app.config["TRANSACTION_KEY"])&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;From the log using the sandbox credentials:&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;https://jstest.authorize.net/v1/Accept.js
API login ID: 9...
Transaction key: 6...
Successfully created transaction with Transaction ID: ...
Transaction Response Code: 1
Message Code: 1&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;From the log using the production credentials:&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;https://js.authorize.net/v1/Accept.js
API login ID: 8...
Transaction key: 7...
Error Code: E00007
Error Message: User authentication failed due to invalid authentication ...&lt;/LI-CODE&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, 11 Feb 2024 18:56:19 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/E00007-User-authentication-failed-due-to-invalid-authentication/m-p/88781#M55955</guid>
      <dc:creator>Burke</dc:creator>
      <dc:date>2024-02-11T18:56:19Z</dc:date>
    </item>
    <item>
      <title>Re: E00007 - User authentication failed due to invalid authentication values.</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/E00007-User-authentication-failed-due-to-invalid-authentication/m-p/89080#M56136</link>
      <description>&lt;P&gt;I have the same issue. Any tips for solution?&lt;/P&gt;</description>
      <pubDate>Tue, 26 Mar 2024 08:58:21 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/E00007-User-authentication-failed-due-to-invalid-authentication/m-p/89080#M56136</guid>
      <dc:creator>eprenrem</dc:creator>
      <dc:date>2024-03-26T08:58:21Z</dc:date>
    </item>
  </channel>
</rss>

