Reply
Contributor
Posts: 10
Registered: ‎09-20-2011

CIM createCustomerPaymentProfileRequest suddenly failing with schema error

[ Edited ]

createCustomerPaymentProfileRequest has suddenly started complaining about invalid elements. I've been sending these requests for weeks, and with no change to their content they're now being rejected. I've verified them against the CIM manual and all seems fine.

 

The following is what I'm sending (data values obscured):

 

<createCustomerPaymentProfileRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
  <merchantAuthentication>
    <name>...</name>
    <transactionKey>...</transactionKey>
  </merchantAuthentication>
  <customerProfileId>...</customerProfileId>
  <paymentProfile>
    <billTo>
      <company>...</company>
      <firstName>...</firstName>
      <lastName>...</lastName>
      <address>...</address>
      <city>...</city>
      <state>...</state>
      <zip>...</zip>
      <country>...</country>
      <phoneNumber>...</phoneNumber>
      <faxNumber>...</faxNumber>
    </billTo>
    <payment>
      <creditCard>
        <cardNumber>...</cardNumber>
        <expirationDate>...</expirationDate>
      </creditCard>
    </payment>
  </paymentProfile>
</createCustomerPaymentProfileRequest>

 

 The following is what I'm getting back:

 

<ErrorResponse xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <messages>
    <resultCode>Error</resultCode>
    <message>
      <code>E00003</code>
      <text>The element 'billTo' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd' has invalid child element 'firstName' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'. List of possible elements expected: 'address, city, state, zip, country, phoneNumber, faxNumber' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'.</text>
    </message>
  </messages>
</ErrorResponse>

 

Any ideas?

Highlighted
Expert
Posts: 4,525
Registered: ‎03-08-2010

Re: CIM createCustomerPaymentProfileRequest suddenly failing with schema error

The sequence matter for their XML interface.

<company/> should be after <lastName />