Reply
Highlighted
Member
Posts: 5
Registered: ‎01-19-2014

The element 'creditCard' in namespace has invalid child element 'cardCode'

E00003: The element 'creditCard' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd' has invalid child element 'cardCode' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'. List of possible elements expected: 'expirationDate' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'.

Getting the above error.  It makes no sense, because this is a valid element.

I have the XML request and response if there is some way to post that here.

Highlighted
Regular Contributor
Posts: 62
Registered: ‎05-29-2015

Re: The element 'creditCard' in namespace has invalid child element 'cardCode'

I have seen some weird errors if you have fields in the wrong order.

Highlighted
Member
Posts: 5
Registered: ‎01-19-2014

Re: The element 'creditCard' in namespace has invalid child element 'cardCode'

Sorry for the long delay, life got in the way.

 

How can fields be in the wrong order?   I pass an object to Authorize.NET and it serializes the object per the XML in the WSDL?  

 

I am using the same WSDL for both prod and test and prod works fine.   Test (sandbox) does not?

Highlighted
Administrator
Posts: 131
Registered: ‎11-29-2017

Re: The element 'creditCard' in namespace has invalid child element 'cardCode'

If you could add the request (with a test card) that would help in troubleshooting. It should look something like this:

 

<creditCard>

<cardNumber>5424000000000015</cardNumber>

<expirationDate>2020-12</expirationDate>

<cardCode>999</cardCode>

</creditCard>