Reply
Member
Posts: 9
Registered: ‎05-28-2013
Accepted Solution

E00003 - element 'lineItems' incomplete, expecting unitPrice

[ Edited ]

I'm caught in a wierd situation where I have a live site that's working perfectly, but my developer environment isn't. The only difference I can tell is that my developer copy's transaction queue is longer and is likely trying to process multiple line items whereas my live site runs monthly and processes only a single payment per month. When I run my payment processor cron, this is the error I get:

 

E00003

 

The element 'lineItems' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd' has incomplete content. List of possible elements expected: 'unitPrice' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'.

 

I would post the request XML but I'm not entirely sure how to get to it. I'm using Authnet's CIM PHP library on Codeigniter.

 

Any ideas?

 

Thanks!


Accepted Solutions
Solution
Accepted by topic author GolevelRyan
‎08-21-2015 01:58 AM
Expert
Posts: 4,525
Registered: ‎03-08-2010

Re: E00003 - element 'lineItems' incomplete, expecting unitPrice

[ Edited ]

unit price of zero. I don't think they like zero. or in your code change it to 0.00

View solution in original post


All Replies
Administrator Administrator
Administrator
Posts: 563
Registered: ‎08-03-2011

Re: E00003 - element 'lineItems' incomplete, expecting unitPrice

Hi,
 
The error seems to indicate that you simply aren't specifying a unit price for one or more of your line items. The unit price is a required field and needs to be included in each line item. You can set it to 0 if you want, but you can't leave it blank.
 
Thanks,
Joy
Member
Posts: 9
Registered: ‎05-28-2013

Re: E00003 - element 'lineItems' incomplete, expecting unitPrice

Hey Joy,

 

All of my line items have a unit price. I did a print_r on the transaction object before the transaction and the response object after the transaction. Here's the results:

 

AuthorizeNetTransaction Object
(
    [amount] => 13077.81
    [tax] => stdClass Object
        (
            [amount] => 
            [name] => 
            [description] => 
        )

    [shipping] => stdClass Object
        (
            [amount] => 
            [name] => 
            [description] => 
        )

    [duty] => stdClass Object
        (
            [amount] => 
            [name] => 
            [description] => 
        )

    [lineItems] => Array
        (
            [0] => AuthorizeNetLineItem Object
                (
                    [itemId] => 6
                    [name] => Business Account for Golevel,
                    [description] => 
                    [quantity] => 1
                    [unitPrice] => 5.44
                    [taxable] => 
                )

            [1] => AuthorizeNetLineItem Object
                (
                    [itemId] => 6
                    [name] => Business Account for Golevel,
                    [description] => 
                    [quantity] => 1
                    [unitPrice] => 20
                    [taxable] => 
                )

            [2] => AuthorizeNetLineItem Object
                (
                    [itemId] => 12
                    [name] => Business Account for Ryan's
                    [description] => 
                    [quantity] => 1
                    [unitPrice] => 2.37
                    [taxable] => 
                )

            [3] => AuthorizeNetLineItem Object
                (
                    [itemId] => 6
                    [name] => Business Account for Golevel,
                    [description] => 
                    [quantity] => 1
                    [unitPrice] => 20
                    [taxable] => 
                )

            [4] => AuthorizeNetLineItem Object
                (
                    [itemId] => 12
                    [name] => Business Account for Ryan's
                    [description] => 
                    [quantity] => 1
                    [unitPrice] => 20
                    [taxable] => 
                )

            [5] => AuthorizeNetLineItem Object
                (
                    [itemId] => 6
                    [name] => Business Account for Golevel,
                    [description] => 
                    [quantity] => 1
                    [unitPrice] => 20
                    [taxable] => 
                )

            [6] => AuthorizeNetLineItem Object
                (
                    [itemId] => 6
                    [name] => Business Account for Golevel,
                    [description] => 
                    [quantity] => 1
                    [unitPrice] => 20
                    [taxable] => 
                )

            [7] => AuthorizeNetLineItem Object
                (
                    [itemId] => 12
                    [name] => Business Account for Ryan's
                    [description] => 
                    [quantity] => 1
                    [unitPrice] => 0
                    [taxable] => 
                )

            [8] => AuthorizeNetLineItem Object
                (
                    [itemId] => 6
                    [name] => Business Account for Golevel,
                    [description] => 
                    [quantity] => 1
                    [unitPrice] => 20
                    [taxable] => 
                )

            [9] => AuthorizeNetLineItem Object
                (
                    [itemId] => 12
                    [name] => Business Account for Ryan's
                    [description] => 
                    [quantity] => 1
                    [unitPrice] => 0
                    [taxable] => 
                )

            [10] => AuthorizeNetLineItem Object
                (
                    [itemId] => 13
                    [name] => Business Event for test
                    [description] => 
                    [quantity] => 1
                    [unitPrice] => 12850
                    [taxable] => 
                )

            [11] => AuthorizeNetLineItem Object
                (
                    [itemId] => 15
                    [name] => Business Event for new
                    [description] => 
                    [quantity] => 1
                    [unitPrice] => 60
                    [taxable] => 
                )

            [12] => AuthorizeNetLineItem Object
                (
                    [itemId] => 6
                    [name] => Business Category for
                    [description] => 
                    [quantity] => 1
                    [unitPrice] => 10
                    [taxable] => 
                )

            [13] => AuthorizeNetLineItem Object
                (
                    [itemId] => 6
                    [name] => Business Category for
                    [description] => 
                    [quantity] => 1
                    [unitPrice] => 10
                    [taxable] => 
                )

            [14] => AuthorizeNetLineItem Object
                (
                    [itemId] => 6
                    [name] => Business Category for
                    [description] => 
                    [quantity] => 1
                    [unitPrice] => 10
                    [taxable] => 
                )

            [15] => AuthorizeNetLineItem Object
                (
                    [itemId] => 6
                    [name] => Business Category for
                    [description] => 
                    [quantity] => 1
                    [unitPrice] => 10
                    [taxable] => 
                )

        )

    [customerProfileId] => 9510582
    [customerPaymentProfileId] => 8456479
    [customerShippingAddressId] => 
    [creditCardNumberMasked] => 
    [bankRoutingNumberMasked] => 
    [bankAccountNumberMasked] => 
    [order] => stdClass Object
        (
            [invoiceNumber] => 
            [description] => 
            [purchaseOrderNumber] => 
        )

    [taxExempt] => 
    [recurringBilling] => 
    [cardCode] => 
    [splitTenderId] => 
    [approvalCode] => 
    [transId] => 
)

AuthorizeNetCIM_Response Object
(
    [xml] => SimpleXMLElement Object
        (
            [messages] => SimpleXMLElement Object
                (
                    [resultCode] => Error
                    [message] => SimpleXMLElement Object
                        (
                            [code] => E00003
                            [text] => The element 'lineItems' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd' has incomplete content. List of possible elements expected: 'unitPrice' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'.
                        )

                )

        )

    [response] => ErrorE00003The element 'lineItems' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd' has incomplete content. List of possible elements expected: 'unitPrice' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'.
    [xpath_xml] => SimpleXMLElement Object
        (
            [messages] => SimpleXMLElement Object
                (
                    [resultCode] => Error
                    [message] => SimpleXMLElement Object
                        (
                            [code] => E00003
                            [text] => The element 'lineItems' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd' has incomplete content. List of possible elements expected: 'unitPrice' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'.
                        )

                )

        )

)

 I can't see anything that would cause an issue. Any ideas?

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

Re: E00003 - element 'lineItems' incomplete, expecting unitPrice

Since you are using xml, can you get the request xml?

Member
Posts: 9
Registered: ‎05-28-2013

Re: E00003 - element 'lineItems' incomplete, expecting unitPrice

[ Edited ]

How do I do that?

 

Here's what I did to get the output that I just provided:

echo '<pre>';
print_r($oTransaction);
echo '</pre>';
$oResponse = $oCIM->createCustomerProfileTransaction("AuthCapture", $oTransaction);
echo '<pre>';
print_r($oResponse);
echo '</pre>';

 

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

Re: E00003 - element 'lineItems' incomplete, expecting unitPrice

[ Edited ]

probably somewhere in the createCustomerProfileTransaction()

 Are you using the SDKs, might be a bug.

Member
Posts: 9
Registered: ‎05-28-2013

Re: E00003 - element 'lineItems' incomplete, expecting unitPrice

Yes, I am using the SDK. Are there known bugs or are you saying mine might be out of date?

Member
Posts: 9
Registered: ‎05-28-2013

Re: E00003 - element 'lineItems' incomplete, expecting unitPrice

Here's the code from AuthorizeNetCIM.php

 

public function createCustomerProfileTransaction($transactionType, $transaction, $extraOptionsString = "")
    {
        $this->_constructXml("createCustomerProfileTransactionRequest");
        $transactionParent = $this->_xml->addChild("transaction");
        $transactionChild = $transactionParent->addChild("profileTrans" . $transactionType);
        $this->_addObject($transactionChild, $transaction);
        $this->_extraOptions = $extraOptionsString;
        return $this->_sendRequest();
    }

 

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

Re: E00003 - element 'lineItems' incomplete, expecting unitPrice

Are there known bugs or are you saying mine might be out of date?

Look like that latest version is 1.1.8, not sure about it about being a known bugs or not

 

might need to output the xml in anet_php_sdk\lib\shared\AuthorizeNetRequest.php _sendRequest()

Member
Posts: 9
Registered: ‎05-28-2013

Re: E00003 - element 'lineItems' incomplete, expecting unitPrice

Ok, I was just now able to get to the XML and this does very much look like a bug.

 

In my code, I'm settings up the line items like this:

 

        foreach($aLineItems as $aLineItem)
        {
            $oItem = new AuthorizeNetLineItem;

            $oItem->itemId = (string) $aLineItem['item_id'];
            $oItem->name = (string) character_limiter($aLineItem['item_title'], 22, '');
            $oItem->quantity = (string) $aLineItem['quantity'];
            if ($aLineItem['amount'] > 0)
			{
				$oItem->unitPrice = (string) round($aLineItem['amount'], 2);
			}
			else
			{
				$oItem->unitPrice = "0";
			}

            $oTransaction->lineItems[] = $oItem;
        }

 But in the XML, it looks like:

 

<lineItems>
            <itemId>6</itemId>
            <name>Business Account for y</name>
            <quantity>1</quantity>
            <unitPrice>20</unitPrice>
        </lineItems>
        <lineItems>
            <itemId>12</itemId>
            <name>Business Account for x</name>
            <quantity>1</quantity>
        </lineItems>
        <lineItems>
            <itemId>6</itemId>
            <name>Business Account for z</name>
            <quantity>1</quantity>
            <unitPrice>20</unitPrice>
        </lineItems>

 Notice how there's no unitPrice for the second item. You can see from the print_r from my earlier post that I am definiitely setting a unitPrice but it's not being reflected in the XML request.

 

What should I do?