cancel
Showing results for 
Search instead for 
Did you mean: 

PHP API: Capturing ErrorResponse

In our logs we've got errors something like this:

 

<ErrorResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
<messages>

    <resultCode>Error</resultCode>
    <message>

         <code>E00003</code>
         <text>The 'AnetApi/xml/v1/schema/AnetApiSchema.xsd:cardNumber' element is invalid - The value XX is invalid according to its datatype 'String' - The actual length is less than the MinLength value.</text>

</message></messages></ErrorResponse>

 

The other one I've got was actually a maxLength error for the cardNumber, there were 19 X's depicting the card number.

 

Does the XML parser add characters on to the string when it replace sensitive data?

Could the fact that there are 2 X's mean the string was actually empty?

 

In the API docs I don't see info on a response object called ErrorResponse.

How would I capture that? The only class I can find in the SDK called ErrorResponse is basiclly an empty class.

 

Thank you,

 

Don

fifty-git
Regular Contributor
1 REPLY 1

 

Hi,

 

With the response you are getting it looks like you are only sending "XX" in the credit card field which is invalid. You will need to make sure to send valid information with the API request you are sending.

 

Thanks,

Joy

Joy
Administrator Administrator
Administrator