cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Accept.js returning E_WC_15:An error occurred during processing. Please try again.

I am trying to test out the Accept.Js and keep receiving an E_WC_15 error.


<input id="CARDNUMBER_ID" type="text" value="4007000000027"><br/>
<input id="EXPIRY_MONTH_ID" type="text" value="12"><br/>
<input id="EXPIRY_YEAR_ID" type="text" value="17"><br/>
<input id="CARD_CODE" type="text" value="178"><br/>
<button type="submit" onclick="sendPaymentDataToAnet()">Pay</button>

 

 

<script type="text/javascript" src="https://jstest.authorize.net/v1/Accept.js" charset="utf-8"></script>
<script>
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;
cardData.cardCode = document.getElementById('CARD_CODE').value;
secureData.cardData = cardData;

authData.clientKey = '2WAXBK4aq7bqP97428EP7PeX8wjr2zvA6pZ253G7G76RUur4947fZG77uv6a5HtG';
authData.apiLoginID = 'API_KEY';
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 {
useOpaqueData(response.opaqueData)
}
}

function useOpaqueData(responseData) {
// This is where you would set the data descriptor & data value to be posted back to your server
console.log(responseData.dataDescriptor);
console.log(responseData.dataValue);
alert(responseData.dataValue);
}
</script>

 

afail
Contributor
4 REPLIES 4

Still seeing this issue today. Any help would be appreciated!

afail
Contributor

Are you sure the apiLoginID in your code is correct?

 

authData.apiLoginID = 'API_KEY';
aamat
Member

Hey there, I have my API Key in my actual code, I just removed it for this post.

 

Any other ideas? Appreciate the response!

I think I figured it out

 

I had to disable the require on the Card Code on the Form Fields section in my settings.