I am doing an integration with our own custom payment form. I have followed all the steps to include the library, for both sandbox and live, however in either of them I keep getting this response after executing
Accept.dispatchData(secureData, responseHandler)
Response:
{"messages":{"resultCode":"Error","message":[{"code":"E_WC_03","text":"Accept.js is not loaded correctly"}]}}
I'm using the correct API Login ID and Public Client Key, and included this library:
<script type="text/javascript"
src="https://jstest.authorize.net/v1/Accept.js"
charset="utf-8">
</script>
I get the same error when testing with the apropriate Live credentials and library.
What could be wrong?
For reference, I'm using this function implementation:
function sendPaymentDataToAnet() {
var authData = {};
authData.clientKey = "{{ env('AUTHORIZE_CLIENT_KEY') }}";
authData.apiLoginID = "{{ env('AUTHORIZE_API_KEY') }}";
var cardData = {};
cardData.cardNumber = '{{ $cc_number }}';
cardData.month = '{{ $expmonth }}';
cardData.year = '{{ $expyear }}';
cardData.cardCode = '{{ $cvc }}';
var secureData = {};
secureData.authData = authData;
secureData.cardData = cardData;
Accept.dispatchData(secureData, responseHandler);
}