Showing results for 
Search instead for 
Did you mean: 

Not Getting Payment Nonce

We have tried to get Payment Nonce as defined in example in following URL but we are not getting response, we are using developer sandbox account.


When we give right test credit it’s not giving any response.


<script type="text/javascript" src="" charset="utf-8"></script>

<!-- For Sandbox/Testing use -->

<script type="text/javascript" src="" charset="utf-8"></script>

<script type="text/javascript">


function sendPaymentDataToAnet() {

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


            cardData.cardNumber = document.getElementById('CARDNUMBER_ID').value;

            cardData.month = document.getElementById('EXPIRY_MONTH_ID').value;

            cardData.year = document.getElementById('EXPIRY_YEAR_ID').value;


            secureData.cardData = cardData;

            authData.clientKey = 'OurClientKey';

            authData.apiLoginID = 'OurAPILoginID';

            secureData.authData = authData;

            Accept.dispatchData(secureData, 'responseHandler')





function responseHandler(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);



            } else {







function useOpaqueData(responseData) {


// This is where you would set the data descriptor & data value to be posted back to your server








Can you provide any more details? Are you getting any error messages? What does your html code look like that's calling the script?


Is the nonce showing up in the console or are you getting any other messages there?

All Star