I am using Accept.js. Attempting to POST createTransactionRequest. I keep getting the errror:
The element 'merchantAuthentication' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd' has invalid child element 'name' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'. List of possible elements expected: 'mobileDeviceId' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'.
I've carefully checked my JSON and I believe it's correct. Here's my code:
05-07-2020 08:05 PM
I'm trying this with Postman and gettting the same results.
POST to: https://apitest.authorize.net/xml/v1/request.api
Body: "raw", "JSON"
{
"createTransactionRequest": {
"merchantAuthentication": {
"transactionKey": "xxxxxxxxxxxxxxxx",
"name": "xxxxxxxxxxxx"
},
"refId": "FE3-839F030E27EEE7A4",
"transactionRequest": {
"payment": {
"opaqueData": {
"dataDescriptor": "COMMON.ACCEPT.INAPP.PAYMENT",
"dataValue": "eyJ0b2tlbiI6Ijk1ODg5NDEzMDU4NzY5NDE5MDQ2MDIiLCJ2IjoiMS4xIn0="
}
},
"amount": 10,
"transactionType": "authCaptureTransaction"
}
}
}
Same result:
05-08-2020 06:17 AM
Interesting. I changed the request to use XML (with Postman). And it works.
So, it would appear I am doing something wrong with JSON. (?)
05-08-2020 07:31 AM
With JSON, it will fail with that error message just by having the "name" and "transactionKey" in the wrong order. Try:
{
"createTransactionRequest": {
"merchantAuthentication": {
"name": "API_Login",
"transactionKey": "Transaction_key"
}
05-13-2020 03:31 AM
I had seen comments about JSON order in other threads. I changed the order to match. Same result.
05-15-2020 04:08 AM