cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Error trying to build a CIM profile and payment profile

I'm using Authorize.net's jar (provided by maven pom.xml file) and trying to make an API call to create a customer profile with a customer payment profile for a given credit card.

 

I am not directly creating the XML, I am making library calls to the JAR and then calling postTransaction.  LIke so:

 

CustomerProfile profile = CustomerProfile.createCustomerProfile();
profile.addShipToAddress(getShippingInfo(request));

profile.setMerchantCustomerId(myCustomerId);
profile.setEmail(myEmail);
profile.setDescription(nameOnCard);

 

Here is the XML that is produced:

<?xml version="1.0"?>
<createCustomerProfileRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
<merchantAuthentication>
<name>xxxxxxxx</name>
<transactionKey>xxxxxxxxxxxxxxxxxxxxxxx</transactionKey>
</merchantAuthentication>
<refId>REFID:1409590251804</refId>
<profile>
<merchantCustomerId></merchantCustomerId>
<description>Honus Wagner profile</description>
<email>honus@wagner.com</email>
<paymentProfiles>
<customerType>individual</customerType>
<billTo>
<firstName>Honus</firstName>
<lastName>Wagner</lastName>
<company></company>
<address>111 Main Street</address>
<city>Detroit</city>
<state>MN</state>
<zip>44444</zip>
<country>US</country>
<phoneNumber>5555555555</phoneNumber>
<faxNumber></faxNumber>
</billTo>
<payment>
<creditCard>
<cardNumber>4007000000027</cardNumber>
<expirationDate>0015-12</expirationDate>
<cardCode>111</cardCode>
</creditCard>
</payment>
</paymentProfiles>
</profile>
<shipTo>
<firstName>Honus</firstName>
<lastName>Wagner</lastName>
<company></company>
<address>111 Main Street</address>
<city>Detroit</city>
<state>MI</state>
<zip>44444</zip>
<country>US</country>
<phoneNumber>5555555555</phoneNumber>
<faxNumber></faxNumber>
</shipTo>
<validationMode>liveMode</validationMode>
</createCustomerProfileRequest>

 

And here is the error I get:

E00003:The element 'createCustomerProfileRequest' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd' has invalid child element 'shipTo' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'. List of possible elements expected: 'validationMode' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'.


This error sounds like there isn't supposed to be a "shipTo" element but if that's true then why is there a CustomerProfile#addShipToAddress() method?

 

 

 

wavebiddev
Contributor
4 REPLIES 4

look like a bug

https://github.com/AuthorizeNet/sdk-java/blob/e9a71e7c1271c8e7858471a41523a894ecfec2d7/src/main/java...

 

in private void addCustomerProfile(BasicXmlDocument document)

 

addAddress(document, AuthNetField.ELEMENT_SHIP_TO.getFieldName(), this.customerProfile.getShipToAddress(), document.getDocumentElement());

 

should be using the ShipToAddressList

as documentated in the xml doc http://developer.authorize.net/api/cim/

RaynorC1emen7
Expert

Thank you for looking at this, I do appreciate it...I'm not 100% sure what you're saying.  Is there something you're saying I need to change or are you saying this is a bug in the Authorize.net jar file?

 

 

bug in the authorize.net jar file

For now - and to just keep moving forward - I just didn't add any shipTo addresses.  That seems to have got me past this hurdle.

 

Thanks for the help!