How to create customer Profile with multiple payment profiles(CIM)?
Creating customer profile with single payment profile is working fine. But when i try to add two or more payment profile to a customer profile , i am getting the below error.
E00003 - The element 'paymentProfiles' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd' has invalid child element 'customerType' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'. List of possible elements expected: 'driversLicense, taxId' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'.
for (int 1=0;i< n;i++){
list.add (createPaymentProfile());
}
Transaction.setPaymentProfileList(list);
The above code generates xml like below.
<?xml version="1.0" encoding="UTF-8"?>
<createCustomerProfileRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
<merchantAuthentication>
<name>33k7hYV736488Bs8</name>
<transactionKey>86SV776773Ac6tMV22313fE</transactionKey>
</merchantAuthentication>
<refId>1361101257555</refId>
<profile>
<merchantCustomerId>2CLINC056</merchantCustomerId>
<description>hiiiiii.</description>
<email />
<paymentProfiles>
<customerType>individual</customerType>
<billTo>
<firstName>Joe</firstName>
<lastName>Test</lastName>
<company>CompanyA</company>
<address>hello</address>
<city>Bangalore</city>
<state>Delhi</state>
<zip>560078</zip>
<country>IN</country>
<phoneNumber>415-555-1212</phoneNumber>
<faxNumber>415-555-1313</faxNumber>
</billTo>
<payment>
<creditCard>
<cardNumber>370000000000002</cardNumber>
<expirationDate>2029-12</expirationDate>
</creditCard>
</payment>
<customerType>individual</customerType>
<billTo>
<firstName>Joe</firstName>
<lastName>Test</lastName>
<company>CompanyA</company>
<address>vel</address>
<city>Chennai</city>
<state>AK</state>
<zip>560089</zip>
<country>US</country>
<phoneNumber>415-555-1212</phoneNumber>
<faxNumber>415-555-1313</faxNumber>
</billTo>
<payment>
<creditCard>
<cardNumber>38000000000006</cardNumber>
<expirationDate>2029-12</expirationDate>
</creditCard>
</payment>
</paymentProfiles>
</profile>
<validationMode>testMode</validationMode>
</createCustomerProfileRequest>