cancel
Showing results for 
Search instead for 
Did you mean: 

Error in CREDIT using CIM API

Hi,

 

For Scheduled orders, we are using Authorize.Net Customer Information Manager (CIM) API version anet-java-sdk-1.4.6.jar (downloaded from http://developer.authorize.net/downloads/) . AUTH and CAPTURE calls are made with success but an error is returned while calling CREDIT. (Below is the error)

 

 

Result Code: Error

E00003 - The element 'profileTransRefund' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd' has invalid child element 'taxExempt' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'. List of possible elements expected: 'transId' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'.

 

 

The transaction ID is : 2193359828

 

While investigating, we found that the XML schema definition file (https://api.authorize.net/xml/v1/schema/AnetApiSchema.xsd) doesn’t contain 'taxExempt' as child element of 'profileTransRefund', that’s why its throwing the above error.  

 

<xs:complexType name="profileTransRefundType">

      <xs:complexContent>

            <xs:extension base="anet:profileTransAmountType">

                  <xs:sequence>

                        <xs:element name="customerProfileId" type="anet:numericString" minOccurs="0" />

                        <xs:element name="customerPaymentProfileId" type="anet:numericString" minOccurs="0" />

                        <xs:element name="customerShippingAddressId" type="anet:numericString" minOccurs="0" />

                        <!--

Format of creditCardNumberMasked should be four X's followed by the last four digits.

-->

                        <xs:element name="creditCardNumberMasked" minOccurs="0">

                              <xs:simpleType>

                                    <xs:restriction base="xs:string">

                                          <xs:minLength value="8" />

                                          <xs:maxLength value="8" />

                                    </xs:restriction>

                              </xs:simpleType>

                        </xs:element>

                        <!--

Format of bankRoutingNumberMasked should be four X's followed by the last four digits.

-->

                        <xs:element name="bankRoutingNumberMasked" minOccurs="0">

                              <xs:simpleType>

                                    <xs:restriction base="xs:string">

                                          <xs:minLength value="8" />

                                          <xs:maxLength value="8" />

                                    </xs:restriction>

                              </xs:simpleType>

                        </xs:element>

                        <!--

Format of bankAccountNumberMasked should be four X's followed by the last four digits.

-->

                        <xs:element name="bankAccountNumberMasked" minOccurs="0">

                              <xs:simpleType>

                                    <xs:restriction base="xs:string">

                                          <xs:minLength value="8" />

                                          <xs:maxLength value="8" />

                                    </xs:restriction>

                              </xs:simpleType>

                        </xs:element>

                        <xs:element name="order" type="anet:orderExType" minOccurs="0" />

                        <xs:element name="transId" type="anet:numericString" minOccurs="0" />

                  </xs:sequence>

            </xs:extension>

      </xs:complexContent>

</xs:complexType>

 

We are trying to set the “taxExempt” as TRUE/FALSE in the shipping charges, by calling “shippingCharges.setTaxExempt(taxExempt);”. But it tries to set the taxExempt as child element in 'profileTransRefund', which is wrong as per the definition of XSD. We cross check after looking into the CIM API classes.

 

See at : src\main\java\net\authorize\cim\Transaction.java : Line 613

 

// tax exempt

if(shippingCharges != null) {

                Element tax_exempt_el = document.createElement(AuthNetField.ELEMENT_TAX_EXEMPT.getFieldName());

                tax_exempt_el.appendChild(document.getDocument().createTextNode(

                shippingCharges.isTaxExempt()?TRUE.toLowerCase():FALSE.toLowerCase()));

                profile_trans_x_el.appendChild(tax_exempt_el);

}

 

I am also attaching CREDIT request XML created.

 

<?xml version="1.0" encoding="UTF-8"?>
<createCustomerProfileTransactionRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
<merchantAuthentication>
<name>4G5nFE8pt</name>
<transactionKey>7TsX8F96qw9a6CWF</transactionKey>
</merchantAuthentication>
<refId>REFID:1368724692150</refId>
<transaction>
<profileTransRefund>
<amount>27.36</amount>
<tax>
<amount>2.37</amount>
<name>California Tax</name>
<description>9.5%</description>
</tax>
<shipping>
<amount>5.00</amount>
<name>Shipping</name>
<description>Flat rate</description>
</shipping>
<lineItems>
<itemId>widget_a_1000</itemId>
<name>Widget A</name>
<description>A widget for widgeting.</description>
<quantity>1</quantity>
<unitPrice>19.99</unitPrice>
<taxable>true</taxable>
</lineItems>
<lineItems>
<itemId>mwidget_z_0001</itemId>
<name>Micro Widget Z</name>
<description>A FREE micro widget.</description>
<quantity>1</quantity>
<unitPrice>0.01</unitPrice>
<taxable>false</taxable>
</lineItems>
<lineItems>
<itemId>mwidget_z_0001</itemId>
<name>Micro Widget Z</name>
<description>A FREE micro widget.</description>
<quantity>1</quantity>
<unitPrice>0.01</unitPrice>
<taxable>false</taxable>
</lineItems>
<lineItems>
<itemId>mwidget_z_0001</itemId>
<name>Micro Widget Z</name>
<description>A FREE micro widget.</description>
<quantity>1</quantity>
<unitPrice>0.01</unitPrice>
<taxable>false</taxable>
</lineItems>
<lineItems>
<itemId>mwidget_z_0001</itemId>
<name>Micro Widget Z</name>
<description>A FREE micro widget.</description>
<quantity>1</quantity>
<unitPrice>0.01</unitPrice>
<taxable>false</taxable>
</lineItems>
<customerProfileId>18475726</customerProfileId>
<customerPaymentProfileId>17225272</customerPaymentProfileId>
<customerShippingAddressId>17338729</customerShippingAddressId>
<order>
<invoiceNumber>1368724692296</invoiceNumber>
<description>Widgets</description>
<purchaseOrderNumber>PO-1001</purchaseOrderNumber>
</order>
<taxExempt>false</taxExempt>
<transId>2193359828</transId>
</profileTransRefund>
</transaction>
<extraOptions><![CDATA[ip_address=127.0.0.1]]></extraOptions>
</createCustomerProfileTransactionRequest>

 

 

It looks like an issue with their CIM API for Transaction object. Please let me know if its an issue with API or I am missing something.

 

Thanks and regards,

 

Anuj Jaiswal

1 REPLY 1

If it is an issue, use the source code to fix it.

RaynorC1emen7
Expert