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!
Solved! Go to Solution.
05-28-2013 02:29 PM - edited 05-28-2013 02:30 PM
unit price of zero. I don't think they like zero. or in your code change it to 0.00
06-10-2013 01:54 PM - edited 06-10-2013 01:55 PM
06-03-2013 02:03 PM
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?
06-05-2013 11:28 AM
Since you are using xml, can you get the request xml?
06-05-2013 07:01 PM
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>';
06-06-2013 08:00 AM - edited 06-06-2013 08:01 AM
probably somewhere in the createCustomerProfileTransaction()
Are you using the SDKs, might be a bug.
06-06-2013 08:06 AM - edited 06-06-2013 08:06 AM
Yes, I am using the SDK. Are there known bugs or are you saying mine might be out of date?
06-06-2013 08:51 AM
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(); }
06-06-2013 08:54 AM
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()
06-06-2013 05:35 PM
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?
06-10-2013 01:48 PM