I am trying out the Accept.js solution in Sandbox.
I am using
https://jstest.authorize.net/v1/Accept.js
in my web page.
Doing everything as per tutorial (https://developer.authorize.net/api/reference/features/acceptjs.html).
On the first step, where I should get the "opaque data"...
Calling (in javascript):
Accept.dispatchData(secureData, responseHandlerAnet);
Secure data obj contains, as per tutorial, authData and cardData.
Of course, authData looks like this:
var authData = { apiLoginID: "MY_API_LOGIN_ID", clientKey: "MY_CLIENT_KEY", };
The response in Chrome network inspector is:
{"messages":{"resultCode":"Error","message":[{"code":"E00007","text":"User authentication failed due to invalid authentication values."}]}}
but in javascript, in my handler function, is slightly different, shows another error code:
{"messages":{"resultCode":"Error","message":[{"code":"E_WC_21","text":"User authentication failed due to invalid authentication values."}]}}
Now, I have checked and re-checked my apiLoginID and clientKey.
In the Chrome debugger, and network inspector, I see the POST request being sent out (by Accept.js) like this:
{"securePaymentContainerRequest":{"merchantAuthentication":{"name":"MY_API_LOGIN_ID","clientKey":"MY_CLIENT_KEY"},"data":{"type":"TOKEN","id":"351b4720-3c94-53ea-430b-36621f9cd865","token":{"cardNumber":"4012888818888","expirationDate":"122021","cardCode":"1234","zip":"90210","fullName":"Foghorn Leghorn"}}}}
What am I doing wrong?
Edit:
I wanted to mention also, that I can see in Chrome network inspector, another OPTIONS call happening before the POST described above.
From the header:
Request URL: https://apitest.authorize.net/xml/v1/request.api Request Method: OPTIONS Status Code: 200 OK Remote Address: 184.86.39.203:443 Referrer Policy: no-referrer-when-downgrade
And this response is:
{"messages":{"resultCode":"Error","message":[{"code":"E00003","text":"Root element is missing."}]}}
Solved! Go to Solution.
04-19-2018 10:21 AM - edited 04-19-2018 10:27 AM
Well, after one day of scratching my head, I basically kept reading forum posts, and reviewed my code... ALL OF A SUDDEN THE TEST API RESPONDS PROPERLY.
Again, no extra code changes on my side... the test API started responding properly... looks like lots of unstable code on authorize.net side... I'm gonna stop here!
04-19-2018 01:05 PM
Well, after one day of scratching my head, I basically kept reading forum posts, and reviewed my code... ALL OF A SUDDEN THE TEST API RESPONDS PROPERLY.
Again, no extra code changes on my side... the test API started responding properly... looks like lots of unstable code on authorize.net side... I'm gonna stop here!
04-19-2018 01:05 PM