Hello,
I want to pay to some product using my own API, (because wroted SDKs isn't supported for my project type), but I get E00003 and that error shows information about "merchantAuthentication", but that attribute contains that element, and data look's correct.
Example request:
{
"createTransactionRequest": {
"transactionRequest": {
"transactionType": "authCaptureTransaction",
"amount": "90.55",
"payment": {
"creditCard": {
"cardNumber": "4111111111111111",
"expirationDate": "2019-02",
"cardCode": "111"
}
}
},
"merchantAuthentication": {
"name": "5KP3u95bQpv",
"transactionKey": "346HZ32z3fP4hTG2"
}
}
}
And I don't know what that request returns:
{
"messages": {
"resultCode": "Error",
"message": [{
"code": "E00003",
"text": "The element 'createTransactionRequest' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd' has invalid child element 'transactionRequest' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'. List of possible elements expected: 'merchantAuthentication' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'."
}
]
}
}
In my opinion that request looks good when I check it with documentation.
Have you any tips for that problem?
I had tried change od expirationDate to format MMYY, and change merchantAuthentication to my test account, but It's still doesn't work.
Solved! Go to Solution.
06-01-2018 02:02 AM
Problems:
1. Order of Json properties has metter
2. refId must be sent (even as empty string)
Working JSON:
{
"createTransactionRequest": {
"merchantAuthentication": {
"name": "xxxx",
"transactionKey": "xxxxxxx"
},
"refId": "",
"transactionRequest": {
"transactionType": "authOnlyTransaction",
"amount": 140.0,
"payment": {
"creditCard": {
"cardNumber": "4111111111111111",
"expirationDate": "2019-02",
"cardCode": "111"
}
}
}
}
}
06-01-2018 05:20 AM
I find only 2 diffrent with request when I get correct result.
1. Request containes "Application Insights" headers likes:
Request-Context: appId=cid-v1:xxxxxx-xxxx-xxxx-xxxx-xxxxx
Request-Id: |xxxxxxx-xxxxx.
x-ms-request-id: |xxxxxxx-xxxxx.
x-ms-request-root-id: xxxxxxx-xxxxx
but I can't remove that from particular request :/
2. And serialized model has diffrent order of properties (i change that but still doesn't work)
06-01-2018 03:19 AM
Problems:
1. Order of Json properties has metter
2. refId must be sent (even as empty string)
Working JSON:
{
"createTransactionRequest": {
"merchantAuthentication": {
"name": "xxxx",
"transactionKey": "xxxxxxx"
},
"refId": "",
"transactionRequest": {
"transactionType": "authOnlyTransaction",
"amount": 140.0,
"payment": {
"creditCard": {
"cardNumber": "4111111111111111",
"expirationDate": "2019-02",
"cardCode": "111"
}
}
}
}
}
06-01-2018 05:20 AM