Reply
Member
Posts: 8
Registered: ‎07-12-2010

Accept.js OPTIONS E00003 Root element is missing.

[ Edited ]

I followed the example shown on https://developer.authorize.net/api/reference/features/acceptjs.html into my php page form but when I process the form with

Accept.dispatchData(secureData, responseHandler);

It generates an OPTIONS error response of :

{
  "messages": {
    "resultCode": "Error",
    "message": [
      "code": "E00003",
      "text": "Root element is missing."
    ]
  }
}

 The secureData being submitted (in case it matters) is:

{
  "cardData": {
    "cardNumber": "4111111111111111",
    "month": "02",
    "year": "2018",
    "zip": "83854",
    "fullname": "Lisa Smith �"
  },
  "authData": {
    "clientKey": "2w77y4wpDGw89R8bM2VcRS4Bm69tQ6qLYT5ACbq9E2uBW9wgVqPAzXADfdC8kqLz",
    "apiLoginID": "72R9aMvP"
  }
}

I checked and made sure the sandbox key and login id are correct.

I also get a POST response from apitest.authorize.net:

{
  "opaqueData": {
    "dataDescriptor": "COMMON.ACCEPT.INAPP.PAYMENT",
    "dataValue": "9486742822834605004604"
  },
  "messages": {
    "resultCode": "Ok",
    "message": [
      "code": "I00001",
      "text": "Successful."
    ]
  }
}

but since the OPTIONS returned an error it does not call the responseHandler() routine.

I hope I have included enough information for someone to see and help with a solution.

 

One other thing. The console also shows a message:

TypeError: window[b] is not a function  AcceptCore.js:1:3956
  n  https://jstest.authorize.net/v1/AcceptCore.js:1:3956
  o/c.onload/<  https://jstest.authorize.net/v1/AcceptCore.js:1:4265
Member
Posts: 8
Registered: ‎07-12-2010

Re: Accept.js OPTIONS E00003 Root element is missing.

I did a bit more fiddling and realized that the function being called in Accept.dispatchData() needed to be quoted - it isn't supposed to be a pointer. It now calls the response handler but I still get that OPTIONS error but I assume that it will not interfere with the process.

The OPTIONS error is something I will ignore for now.