cancel
Showing results for 
Search instead for 
Did you mean: 

Accept.js encryption failed

Can we generate the dataDescriptor & dataValue without providing the Credit card details.

 

Im trying to load the function using document.ready.

 

Below is the code.

 

 

<script type="text/javascript">
$(document).ready(function(){
      loadAuthNetKey();
});
</script>


<script type="text/javascript">
function loadAuthNetKey(){
     var secureData = {}, authData = {};


     authData.clientKey = '$hostKey';
     authData.apiLoginID = '$paymentGateWayHostID';
     secureData.authData = authData;
     Accept.dispatchData(secureData, 'responseHandlerSave');
}


function responseHandlerSave(response)

{
  console.log(JSON.stringify(response));
      if (response.messages.resultCode === 'Error') {
             for (var i = 0; i < response.messages.message.length; i++) {
              unBlock();
               //console.log(response.messages.message[i].code + ':' +             response.messages.message[i].text);
     alert(response.messages.message[i].text)
return false;
 }
}
else {
    useOpaqueData(response.opaqueData)
  }
}
</script>

 

 

In response i need the dataDescriptor  and dataValue. But im getting the Accept.js encryption failed.

 

Kindly help me what is wrong in my code.

 

Thanks,

Ganesh

ganeshkunte
Member
1 REPLY 1

Hi @ganeshkunte,

 

No, there's no way to get the token representing the card number without providing the card number that you want the token to be for.

 

What exactly are you hoping to do by getting a token without card details?

Aaron
All Star