cancel
Showing results for 
Search instead for 
Did you mean: 

Accept.js unable to process transaction in GoDaddy hosting environment

Heelo Folks, 

I need a little help here. We have implemented the Accept.js in our test environment and testing using the sandbox. However, we moved the program to GoDaddy hosting web server and updated the client key etc from our exisiting production platform. 

Now when we are tring to process a transaction then we are not getting any decline or anyother response (i believe). I looked at the console log and php logs etc and nothing there. 

 

I have the following prosuction declaration under <header> section:

<script type="text/javascript" src="https://js.authorize.net/v1/Accept.js" charset="utf-8"></script>

 

Here is my code: It is the same from sample provided that we used.

function sendPaymentDataToAnet()

    {

            var secureData = {}; authData = {}; cardData = {};

            var arg = document.getElementById('paytype').value;

            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.amount = document.getElementById('amount').value;

            secureData.cardData = cardData;

 

            // The Authorize.Net Client Key is used in place of the traditional Transaction Key. The Transaction Key

            // is a shared secret and must never be exposed. The Client Key is a public key suitable for use where

            // someone outside the merchant might see it.

            authData.clientKey  = "removed";

            authData.apiLoginID = "removed";

            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)

            {

                console.log('This is payment response: '+response) ;              

                if (response.messages.resultCode === "Error")

                {

                    for (var i = 0; i < response.messages.message.length; i++)

                    {

                        console.log(response.messages.message[i].code + ": " + response.messages.message[i].text);

                        alert(response.messages.message[i].text);

                    }

                   

                } else

                {

                    console.log(response.opaqueData.dataDescriptor);

                    console.log(response.opaqueData.dataValue);

                    processTransaction(response.opaqueData,arg);

                }

            }

    }

 

rizwanalam
Member
1 REPLY 1

Hi @rizwanalam,

 

Are you really literally getting nothing at all in the JavaScript console? Like not even the "This is payment response: " part from one of you console.log statements? If so, your script is not running, and you'll need to troubleshoot the browser or the whole page.

 

If you are getting something in the console, what are you getting?

Aaron
All Star