Search code examples
xmlcodeigniterauthorize.netauthorize.net-cim

CodeIgniter and Authorize.net CIM library


I'm trying to use the authorize.net library for CI2.0 from https://github.com/cloudmanic/codeignitor-authorizenet-cim-library

When running fulltest() which is the first function in the controller I get:

Creating Customer Profile - create_customer_profile()

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


Solution

  • That error means one of the XML nodes is in the wrong place. Authorize.Net's API is very picky about the format of any XML sent to it. It's hard to say for sure exactly what the error is without seeing the XML generated but it probably has to do with the validationMode element being placed incorrectly.

    You can see what a valid XML format looks like in the CIM Guide on page 26.