<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: x_line_item integration in PHP in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/x-line-item-integration-in-PHP/m-p/9712#M6349</link>
    <description>&lt;P&gt;No that thread wasn't useful at all, I have read it about 10 times.&amp;nbsp; For one thing why show me an example of a hardcoded array, why not show the PHP code that builds the array from the DB as I am sure that is what most sites are doing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To simplify, this is the structure I am using to request authorization.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$sale&amp;nbsp; = new AuthorizeNetAIM;&lt;/P&gt;&lt;P&gt;$sale-&amp;gt;line_item = "1&amp;lt;|&amp;gt;Some Product Info&amp;lt;|&amp;gt;More Infor&amp;lt;|&amp;gt;1&amp;lt;|&amp;gt;Y&amp;amp;";&lt;/P&gt;&lt;P&gt;$response = $sale-&amp;gt;authorizeAndCapture();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This results in an approval.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Change line 2 to $sale-&amp;gt;line_item = "x_line_item=1&amp;lt;|&amp;gt;Some Product Info&amp;lt;|&amp;gt;More Infor&amp;lt;|&amp;gt;1&amp;lt;|&amp;gt;Y&amp;amp;";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And the result is an approval BUT the text x_line_item=1 is displayed on the Authorize.net receipt, that is to say the whole string, not just the number 1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Change line 2 to any of the following combinations results in an error that line 1 is invalid.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$sale-&amp;gt;line_item = "x_line_item=1&amp;lt;|&amp;gt;Some Product Info&amp;lt;|&amp;gt;More Infor&amp;lt;|&amp;gt;1&amp;lt;|&amp;gt;Y&amp;amp;x_line_item=2&amp;lt;|&amp;gt;Another Product Info&amp;lt;|&amp;gt;More Infor&amp;lt;|&amp;gt;1&amp;lt;|&amp;gt;Y&amp;amp;";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$sale-&amp;gt;line_item = "&amp;amp;x_line_item=1&amp;lt;|&amp;gt;Some Product Info&amp;lt;|&amp;gt;More Infor&amp;lt;|&amp;gt;1&amp;lt;|&amp;gt;Y&amp;amp;x_line_item=2&amp;lt;|&amp;gt;Another Product Info&amp;lt;|&amp;gt;More Infor&amp;lt;|&amp;gt;1&amp;lt;|&amp;gt;Y";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$sale-&amp;gt;line_item = "1&amp;lt;|&amp;gt;Some Product Info&amp;lt;|&amp;gt;More Infor&amp;lt;|&amp;gt;1&amp;lt;|&amp;gt;Y&amp;amp;2&amp;lt;|&amp;gt;Another Product Info&amp;lt;|&amp;gt;More Infor&amp;lt;|&amp;gt;1&amp;lt;|&amp;gt;Y&amp;amp;";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$sale-&amp;gt;line_item = "&amp;amp;1&amp;lt;|&amp;gt;Some Product Info&amp;lt;|&amp;gt;More Infor&amp;lt;|&amp;gt;1&amp;lt;|&amp;gt;Y&amp;amp;2&amp;lt;|&amp;gt;Another Product Info&amp;lt;|&amp;gt;More Infor&amp;lt;|&amp;gt;1&amp;lt;|&amp;gt;Y";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;or even try sending each item seperately&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$sale-&amp;gt;line_item = "1&amp;lt;|&amp;gt;Some Product Info&amp;lt;|&amp;gt;More Infor&amp;lt;|&amp;gt;1&amp;lt;|&amp;gt;Y&amp;amp;";&lt;/P&gt;&lt;P&gt;$sale-&amp;gt;line_item = "2&amp;lt;|&amp;gt;Another Product Info&amp;lt;|&amp;gt;More Infor&amp;lt;|&amp;gt;1&amp;lt;|&amp;gt;Y&amp;amp;";&lt;/P&gt;&lt;P&gt;$sale-&amp;gt;line_item = "3&amp;lt;|&amp;gt;And AnotherProduct Info&amp;lt;|&amp;gt;More Infor&amp;lt;|&amp;gt;1&amp;lt;|&amp;gt;Y&amp;amp;";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;even if I urlencode each string between x_line_item= and the &amp;amp; I still get the same error.&lt;/P&gt;</description>
    <pubDate>Tue, 25 Jan 2011 07:34:41 GMT</pubDate>
    <dc:creator>vijer</dc:creator>
    <dc:date>2011-01-25T07:34:41Z</dc:date>
    <item>
      <title>x_line_item integration in PHP</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/x-line-item-integration-in-PHP/m-p/9654#M6320</link>
      <description>&lt;P&gt;I don't know where I found the original sample code but this is what I am using to submit payaments and generate a detailed receipt for the customer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $customer&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = (object) array();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $customer-&amp;gt;first_name&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = tools::get_field_value("bill_first_name");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $customer-&amp;gt;last_name&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = tools::get_field_value("bill_last_name");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $customer-&amp;gt;address&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = tools::get_field_value("bill_address_1");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $customer-&amp;gt;city&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = tools::get_field_value("bill_city");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $customer-&amp;gt;state&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = $this-&amp;gt;system-&amp;gt;get_state_code(tools::get_field_value("bill_state_id"));&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $customer-&amp;gt;zip&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = tools::get_field_value("bill_zip_code");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $customer-&amp;gt;phone&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = tools::get_field_value("phone_home");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $customer-&amp;gt;email&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = tools::get_field_value("email_address");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $customer-&amp;gt;customer_ip&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = tools::get_client_ip();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $shipping_info&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = (object) array();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $shipping_info-&amp;gt;ship_to_first_name = tools::get_field_value("ship_first_name");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $shipping_info-&amp;gt;ship_to_last_name&amp;nbsp; = tools::get_field_value("ship_last_name");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $shipping_info-&amp;gt;ship_to_address&amp;nbsp;&amp;nbsp;&amp;nbsp; = tools::get_field_value("ship_address_1");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $shipping_info-&amp;gt;ship_to_city&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = tools::get_field_value("ship_city");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $shipping_info-&amp;gt;ship_to_state&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = $this-&amp;gt;system-&amp;gt;get_state_code(tools::get_field_value("ship_state_id"));&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $shipping_info-&amp;gt;ship_to_zip&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = tools::get_field_value("ship_zip_code");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $sale&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = new AuthorizeNetAIM;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $sale-&amp;gt;amount&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = tools::get_field_value("order_total");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $sale-&amp;gt;address&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = tools::get_field_value("bill_address_1");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $sale-&amp;gt;zip&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = tools::get_field_value("bill_zip_code");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $sale-&amp;gt;card_num&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = tools::get_field_value("cc_number");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $sale-&amp;gt;exp_date&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = tools::get_field_value("cc_exp_month") . "/" . tools::get_field_value("cc_exp_year");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $sale-&amp;gt;card_code&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = tools::get_field_value("cc_cvv2");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $sale-&amp;gt;description&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = $company_name_no_space . "com Sales Order: " . tools::get_field_value("order_id");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $sale-&amp;gt;setFields($shipping_info);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $sale-&amp;gt;setFields($customer);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $response = $sale-&amp;gt;authorizeAndCapture();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Everything works great, but I can't find any information on how to integrate line item detail.&amp;nbsp; The x_line_item information in the AIM PDF is useless for this implementation.&amp;nbsp; Any ideas how I should go about this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jan 2011 07:36:14 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/x-line-item-integration-in-PHP/m-p/9654#M6320</guid>
      <dc:creator>vijer</dc:creator>
      <dc:date>2011-01-24T07:36:14Z</dc:date>
    </item>
    <item>
      <title>Re: x_line_item integration in PHP</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/x-line-item-integration-in-PHP/m-p/9656#M6321</link>
      <description>&lt;P&gt;OK I figured out how to get the line item information sent but have encountered another problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I keep getting the error "Line item 1 is invalid".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the string I am sending 1&amp;lt;|&amp;gt;2&amp;amp;quot; Wood Blind&amp;lt;|&amp;gt;&amp;lt;|&amp;gt;1&amp;lt;|&amp;gt;69.00&amp;lt;|&amp;gt;Y&amp;amp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I substitue &amp;amp;quot; with the letters 'in' then it sends fine.&amp;nbsp; Any way to get it to display with double quotes?&amp;nbsp; I would think using &amp;amp;quot; would work but it doesn't.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jan 2011 09:12:03 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/x-line-item-integration-in-PHP/m-p/9656#M6321</guid>
      <dc:creator>vijer</dc:creator>
      <dc:date>2011-01-24T09:12:03Z</dc:date>
    </item>
    <item>
      <title>Re: x_line_item integration in PHP</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/x-line-item-integration-in-PHP/m-p/9658#M6322</link>
      <description>&lt;P&gt;Forgetting the double quote issue for the moment.&amp;nbsp; If I process an order with one item it works but with multiple items it deos not.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am sending this string for a multiple line item&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;amp;x_line_item=1&amp;lt;|&amp;gt;2in Premier Faux Wood Blinds Painted&amp;lt;|&amp;gt;36 0.0000 x 60 0.0000&amp;lt;|&amp;gt;1&amp;lt;|&amp;gt;47.00&amp;lt;|&amp;gt;Y&amp;amp;x_line_item=2&amp;lt;|&amp;gt;Solid Vinyl PVC Verticals&amp;lt;|&amp;gt;36 0.0000 x 60 0.0000&amp;lt;|&amp;gt;1&amp;lt;|&amp;gt;39.00&amp;lt;|&amp;gt;Y&amp;amp;x_line_item=3&amp;lt;|&amp;gt;2in Designer Wood Blinds&amp;lt;|&amp;gt;36 0.0000 x 60 0.0000&amp;lt;|&amp;gt;1&amp;lt;|&amp;gt;64.00&amp;lt;|&amp;gt;Y&amp;amp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And I have tried sending&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1&amp;lt;|&amp;gt;2in Premier Faux Wood Blinds Painted&amp;lt;|&amp;gt;36 0.0000 x 60 0.0000&amp;lt;|&amp;gt;1&amp;lt;|&amp;gt;47.00&amp;lt;|&amp;gt;Y&amp;amp;2&amp;lt;|&amp;gt;Solid Vinyl PVC Verticals&amp;lt;|&amp;gt;36 0.0000 x 60 0.0000&amp;lt;|&amp;gt;1&amp;lt;|&amp;gt;39.00&amp;lt;|&amp;gt;Y&amp;amp;3&amp;lt;|&amp;gt;2in Designer Wood Blinds&amp;lt;|&amp;gt;36 0.0000 x 60 0.0000&amp;lt;|&amp;gt;1&amp;lt;|&amp;gt;64.00&amp;lt;|&amp;gt;Y&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code snip that sends it&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $line_item&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = $order_item-&amp;gt;email_item_list($order_id);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $sale&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; = new AuthorizeNetAIM;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $sale-&amp;gt;amount&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = tools::get_field_value("order_total");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $sale-&amp;gt;tax&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = tools::get_field_value("sales_tax");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $sale-&amp;gt;address&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = tools::get_field_value("bill_address_1");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $sale-&amp;gt;zip&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = tools::get_field_value("bill_zip_code");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $sale-&amp;gt;card_num&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = tools::get_field_value("cc_number");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $sale-&amp;gt;exp_date&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = tools::get_field_value("cc_exp_month") . "/" . tools::get_field_value("cc_exp_year");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $sale-&amp;gt;card_code&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = tools::get_field_value("cc_cvv2");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $sale-&amp;gt;description&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = $company_name_no_space . "com Sales Order: " . tools::get_field_value("order_id");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $sale-&amp;gt;line_item&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = $line_item;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For a single item if I send&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;amp;x_line_item=1&amp;lt;|&amp;gt;2in Premier Faux Wood Blinds Painted&amp;lt;|&amp;gt;36 0.0000 x 60 0.0000&amp;lt;|&amp;gt;1&amp;lt;|&amp;gt;47.00&amp;lt;|&amp;gt;Y&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The receipt I get displays&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;x_line_item=1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And leaving it out or putting it in for multiple items doesn't help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So putting that in the string isn't gettting stripped/interpreted by AIM PHP.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anybody have a solution for this problem as the documentation is not very helpful.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jan 2011 14:36:57 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/x-line-item-integration-in-PHP/m-p/9658#M6322</guid>
      <dc:creator>vijer</dc:creator>
      <dc:date>2011-01-24T14:36:57Z</dc:date>
    </item>
    <item>
      <title>Re: x_line_item integration in PHP</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/x-line-item-integration-in-PHP/m-p/9688#M6337</link>
      <description>&lt;P&gt;You may find the following thread that discusses this at length helpful: &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://community.developer.authorize.net/t5/Integration-and-Testing/Itemized-order-info-with-AIM/td-p/2797" target="_blank" rel="nofollow"&gt;http://community.developer.authorize.net/t5/Integration-and-Testing/Itemized-order-info-with-AIM/td-p/2797&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Elaine&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jan 2011 21:51:38 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/x-line-item-integration-in-PHP/m-p/9688#M6337</guid>
      <dc:creator>Elaine</dc:creator>
      <dc:date>2011-01-24T21:51:38Z</dc:date>
    </item>
    <item>
      <title>Re: x_line_item integration in PHP</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/x-line-item-integration-in-PHP/m-p/9712#M6349</link>
      <description>&lt;P&gt;No that thread wasn't useful at all, I have read it about 10 times.&amp;nbsp; For one thing why show me an example of a hardcoded array, why not show the PHP code that builds the array from the DB as I am sure that is what most sites are doing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To simplify, this is the structure I am using to request authorization.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$sale&amp;nbsp; = new AuthorizeNetAIM;&lt;/P&gt;&lt;P&gt;$sale-&amp;gt;line_item = "1&amp;lt;|&amp;gt;Some Product Info&amp;lt;|&amp;gt;More Infor&amp;lt;|&amp;gt;1&amp;lt;|&amp;gt;Y&amp;amp;";&lt;/P&gt;&lt;P&gt;$response = $sale-&amp;gt;authorizeAndCapture();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This results in an approval.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Change line 2 to $sale-&amp;gt;line_item = "x_line_item=1&amp;lt;|&amp;gt;Some Product Info&amp;lt;|&amp;gt;More Infor&amp;lt;|&amp;gt;1&amp;lt;|&amp;gt;Y&amp;amp;";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And the result is an approval BUT the text x_line_item=1 is displayed on the Authorize.net receipt, that is to say the whole string, not just the number 1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Change line 2 to any of the following combinations results in an error that line 1 is invalid.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$sale-&amp;gt;line_item = "x_line_item=1&amp;lt;|&amp;gt;Some Product Info&amp;lt;|&amp;gt;More Infor&amp;lt;|&amp;gt;1&amp;lt;|&amp;gt;Y&amp;amp;x_line_item=2&amp;lt;|&amp;gt;Another Product Info&amp;lt;|&amp;gt;More Infor&amp;lt;|&amp;gt;1&amp;lt;|&amp;gt;Y&amp;amp;";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$sale-&amp;gt;line_item = "&amp;amp;x_line_item=1&amp;lt;|&amp;gt;Some Product Info&amp;lt;|&amp;gt;More Infor&amp;lt;|&amp;gt;1&amp;lt;|&amp;gt;Y&amp;amp;x_line_item=2&amp;lt;|&amp;gt;Another Product Info&amp;lt;|&amp;gt;More Infor&amp;lt;|&amp;gt;1&amp;lt;|&amp;gt;Y";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$sale-&amp;gt;line_item = "1&amp;lt;|&amp;gt;Some Product Info&amp;lt;|&amp;gt;More Infor&amp;lt;|&amp;gt;1&amp;lt;|&amp;gt;Y&amp;amp;2&amp;lt;|&amp;gt;Another Product Info&amp;lt;|&amp;gt;More Infor&amp;lt;|&amp;gt;1&amp;lt;|&amp;gt;Y&amp;amp;";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$sale-&amp;gt;line_item = "&amp;amp;1&amp;lt;|&amp;gt;Some Product Info&amp;lt;|&amp;gt;More Infor&amp;lt;|&amp;gt;1&amp;lt;|&amp;gt;Y&amp;amp;2&amp;lt;|&amp;gt;Another Product Info&amp;lt;|&amp;gt;More Infor&amp;lt;|&amp;gt;1&amp;lt;|&amp;gt;Y";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;or even try sending each item seperately&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$sale-&amp;gt;line_item = "1&amp;lt;|&amp;gt;Some Product Info&amp;lt;|&amp;gt;More Infor&amp;lt;|&amp;gt;1&amp;lt;|&amp;gt;Y&amp;amp;";&lt;/P&gt;&lt;P&gt;$sale-&amp;gt;line_item = "2&amp;lt;|&amp;gt;Another Product Info&amp;lt;|&amp;gt;More Infor&amp;lt;|&amp;gt;1&amp;lt;|&amp;gt;Y&amp;amp;";&lt;/P&gt;&lt;P&gt;$sale-&amp;gt;line_item = "3&amp;lt;|&amp;gt;And AnotherProduct Info&amp;lt;|&amp;gt;More Infor&amp;lt;|&amp;gt;1&amp;lt;|&amp;gt;Y&amp;amp;";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;even if I urlencode each string between x_line_item= and the &amp;amp; I still get the same error.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jan 2011 07:34:41 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/x-line-item-integration-in-PHP/m-p/9712#M6349</guid>
      <dc:creator>vijer</dc:creator>
      <dc:date>2011-01-25T07:34:41Z</dc:date>
    </item>
    <item>
      <title>Re: x_line_item integration in PHP</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/x-line-item-integration-in-PHP/m-p/9714#M6350</link>
      <description>&lt;P&gt;This is an echo of the encoded string, the structure that I believe would be generated by the code in the AIM PHP sample&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;amp;x_line_item=1%3C%7C%3E1%2F2in+Single+Cell+Honeycomb%3C%7C%3E36+0.0000+x+60+0.0000%3C%7C%3E1%3C%7C%3E101.00%3C%7C%3EY&amp;amp;x_line_item=2%3C%7C%3EWoven+Wood+Shades+-+Series+100%3C%7C%3E36+0.0000+x+60+0.0000%3C%7C%3E1%3C%7C%3E67.00%3C%7C%3EY&amp;amp;x_line_item=3%3C%7C%3E2in+Express+Faux+Wood+Blinds%3C%7C%3E36+0.0000+x+60+0.0000%3C%7C%3E1%3C%7C%3E38.00%3C%7C%3EY&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and echo of the unencoded string&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;amp;x_line_item=1&amp;lt;|&amp;gt;1/2in Single Cell Honeycomb&amp;lt;|&amp;gt;36 0.0000 x 60 0.0000&amp;lt;|&amp;gt;1&amp;lt;|&amp;gt;101.00&amp;lt;|&amp;gt;Y&amp;amp;x_line_item=2&amp;lt;|&amp;gt;Woven Wood Shades - Series 100&amp;lt;|&amp;gt;36 0.0000 x 60 0.0000&amp;lt;|&amp;gt;1&amp;lt;|&amp;gt;67.00&amp;lt;|&amp;gt;Y&amp;amp;x_line_item=3&amp;lt;|&amp;gt;2in Express Faux Wood Blinds&amp;lt;|&amp;gt;36 0.0000 x 60 0.0000&amp;lt;|&amp;gt;1&amp;lt;|&amp;gt;38.00&amp;lt;|&amp;gt;Y&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jan 2011 07:53:29 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/x-line-item-integration-in-PHP/m-p/9714#M6350</guid>
      <dc:creator>vijer</dc:creator>
      <dc:date>2011-01-25T07:53:29Z</dc:date>
    </item>
    <item>
      <title>Resolved</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/x-line-item-integration-in-PHP/m-p/9762#M6373</link>
      <description>&lt;P&gt;Well lets start with Thanks for all the help!&amp;nbsp; Oh crap I didn't get any, Thanks you Bozo's for no help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Second Thanks for crappy examples and information.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To solve this issue I had to download the PHP SDK and review the AIM samples again.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First issue, there is a Precedence in the order the data is submitted.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Initially I was submitting the information in this order AND when submitted with ONE item it works.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$sale-&amp;gt;description = "Sales Order: " . tools::get_field_value("order_id");&lt;/P&gt;&lt;P&gt;$sale-&amp;gt;line_item = "1&amp;lt;|&amp;gt;Info&amp;lt;|&amp;gt;More Info&amp;lt;|&amp;gt;1&amp;lt;|&amp;gt;23.95&amp;lt;|&amp;gt;Y"&lt;/P&gt;&lt;P&gt;$sale-&amp;gt;setFields($shipping_info);&lt;/P&gt;&lt;P&gt;$sale-&amp;gt;setFields($customer);&lt;/P&gt;&lt;P&gt;$response = $sale-&amp;gt;authorizeAndCapture();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now here is the interesting part, looking through the samples it shows to submit multiple line items you have to do the item part this way;&lt;/P&gt;&lt;P&gt;The first line is still the same&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$sale-&amp;gt;line_item = "1&amp;lt;|&amp;gt;Info&amp;lt;|&amp;gt;More Info&amp;lt;|&amp;gt;1&amp;lt;|&amp;gt;23.95&amp;lt;|&amp;gt;Y"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But the subsequent items are done like this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$sale-&amp;gt;addLineItem('2','info','more info','1','39.95','Y')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SERIOUSLY A DIFFERENT FORMAT!!&amp;nbsp; Not $sale-&amp;gt;addLineItem = "2&amp;lt;|&amp;gt;Info&amp;lt;|&amp;gt;More Info&amp;lt;|&amp;gt;1&amp;lt;|&amp;gt;23.95&amp;lt;|&amp;gt;Y" HELL NO THAT WOULD ONLY MAKE SENSE.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyway so I hard coded it and tried and tried and tried, but no it kept giving me the same error; Line 1 is invalid.&amp;nbsp; So I kept looking at the sample for multiple items in the SDK and the $sale-&amp;gt;addLineItem were all JUST BEFORE the $response = $sale-&amp;gt;authorizeAndCapture(); so I changed my order to;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$sale-&amp;gt;description = "Sales Order: " . tools::get_field_value("order_id");&lt;/P&gt;&lt;P&gt;$sale-&amp;gt;setFields($shipping_info);&lt;/P&gt;&lt;P&gt;$sale-&amp;gt;setFields($customer);&lt;/P&gt;&lt;P&gt;$sale-&amp;gt;line_item = "1&amp;lt;|&amp;gt;Info&amp;lt;|&amp;gt;More Info&amp;lt;|&amp;gt;1&amp;lt;|&amp;gt;23.95&amp;lt;|&amp;gt;Y"&lt;/P&gt;&lt;P&gt;$sale-&amp;gt;addLineItem(2,info,more info,1,39.95,Y)&lt;/P&gt;&lt;P&gt;$response = $sale-&amp;gt;authorizeAndCapture();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;AND BAM IT WORKS.&amp;nbsp; YA THINK THAT MIGHT BE USEFULL INFORMATION TO POINT OUT!?!?!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ok so on to live data, and you have to figure this out by yourself because ALL THE EXAMPLES use hardcoded data.&amp;nbsp; Anyway here is what I came up with.&amp;nbsp; The while loop is JUST before the $response = $sale-&amp;gt;authorizeAndCapture();.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Notice I have to evaluate which item is being processed so the structure is changed for the first item and then all subsequent items.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOW HERE IS ANOTHER BITCH, notice the substr($row['product_name'],0,30) well I must have submitted 10 orders and all was great, then all of a sudden I got the error Line x is invalid again.&amp;nbsp; WHAT THE HELL!!!&amp;nbsp; Well it turns out there is a limit to the length of the string Authorize.net can handle, 30 characters, if you pass a string longer than that it craps out.&amp;nbsp; YA THINK THAT IS AN IMPORTANT BIT OF INFO YOU COULD HAVE NOTED IN THE EXAMPLES?!?!?&amp;nbsp; Not to mention Authorize.net could just truncate it on their end and save everyone a lot of heart ache.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$result = $this-&amp;gt;system-&amp;gt;db-&amp;gt;query($sql);&lt;/P&gt;&lt;P&gt;while ($row = mysql_fetch_array($result)) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; if ($row['order_item_id'] == 1) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $sale-&amp;gt;line_item&amp;nbsp; = $row['order_item_id'] . '&amp;lt;|&amp;gt;' . substr($row['product_name'],0,30) . '&amp;lt;|&amp;gt;' . $row['width'] . ' ' . tools::get_fraction_text($row['width_frac']) . ' x ' . $row['height'] . ' ' . tools::get_fraction_text($row['height_frac']) . '&amp;lt;br&amp;gt;Color: ' . $row['option_picklist_name'] . '&amp;lt;|&amp;gt;' . $row['quantity'] . '&amp;lt;|&amp;gt;' . $row['item_total_price'] . '&amp;lt;|&amp;gt;Y';&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp; else {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $sale-&amp;gt;addLineItem($row['order_item_id'], substr($row['product_name'],0,30), $row['width'] . ' ' . tools::get_fraction_text($row['width_frac']) . ' x ' . $row['height'] . ' ' . tools::get_fraction_text($row['height_frac']) . '&amp;lt;br&amp;gt;Color: ' . $row['option_picklist_name'], $row['quantity'], $row['item_total_price'], 'Y');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Again thanks for all the help you clowns. Oh that's right I didn't get any.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jan 2011 21:31:36 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/x-line-item-integration-in-PHP/m-p/9762#M6373</guid>
      <dc:creator>vijer</dc:creator>
      <dc:date>2011-01-25T21:31:36Z</dc:date>
    </item>
    <item>
      <title>Re: Resolved</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/x-line-item-integration-in-PHP/m-p/13788#M8195</link>
      <description>&lt;P&gt;Hey Vince, I hope you're still subcribed to this....I am pulling my hair out with this issue. If you could please email me chris @ dowden . com I will love you forever.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jun 2011 05:18:38 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/x-line-item-integration-in-PHP/m-p/13788#M8195</guid>
      <dc:creator>crdowden</dc:creator>
      <dc:date>2011-06-17T05:18:38Z</dc:date>
    </item>
    <item>
      <title>Re: Resolved</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/x-line-item-integration-in-PHP/m-p/17378#M9719</link>
      <description>&lt;P&gt;Ok.. So I just did the x_line_item integration and it took me forever to figure it out, but I hope that this post here is helpful to others.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;first the format:&lt;/P&gt;&lt;P&gt;x_line_item=1&amp;lt;|&amp;gt;2in Premier Faux Wood Blinds Painted&amp;lt;|&amp;gt;36 0.0000 x 60 0.0000&amp;lt;|&amp;gt;1&amp;lt;|&amp;gt;47.00&amp;lt;|&amp;gt;Y&amp;amp;x_line_item=2&amp;lt;|&amp;gt;Solid Vinyl PVC Verticals&amp;lt;|&amp;gt;36 0.0000 x 60 0.0000&amp;lt;|&amp;gt;1&amp;lt;|&amp;gt;39.00&amp;lt;|&amp;gt;Y&amp;amp;x_line_item=3&amp;lt;|&amp;gt;2in Designer Wood Blinds&amp;lt;|&amp;gt;36 0.0000 x 60 0.0000&amp;lt;|&amp;gt;1&amp;lt;|&amp;gt;64.00&amp;lt;|&amp;gt;Y&amp;amp;﻿&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This submit format is correct, but... yes, there is a but&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Structure:&lt;/P&gt;&lt;P&gt;x_line_item=Item ID﻿&amp;lt;|&amp;gt;item name﻿&amp;lt;|&amp;gt;item description&amp;lt;|&amp;gt;﻿itemX quantity&amp;lt;|&amp;gt;﻿item price (unit cost)&amp;lt;|&amp;gt;﻿itemX taxable﻿&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Notes:&lt;/P&gt;&lt;P&gt;Item ID: This should be a running number integer in a sequence starting with 1 then 2 then 3, etc. So you get item 1, 2, 3 ... etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;item name: This can't be longer than 30 characters! If it is it will not work! You have to do some string modification:&lt;/P&gt;&lt;P&gt;substr(str_replace($item_name,0,30)&lt;/P&gt;&lt;P&gt;Also be sure to replace or filter out any special characters like ™ , ®, &amp;amp;, etc. Oh yes.. also remove all commas!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;item description: This can't be longer than 255 characters! Again, all special characters need to be stripped out and replaced, and remove all commas. That is what worked for me. With commas.. no workie.. without commas.. works like a charm.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;itemX quantity: that should be an integer&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;item price: that should the just the number, no $ sign! &amp;nbsp; &amp;nbsp;9.99 for example, or 5.45&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;itemX taxable: that should be either Y for yes or N for no, or you can write it out Yes or No.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Once you build that item string and add it to the rest of your processing string you still have to urlencode the actual x_line_item values like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;x_line_item=urlencode("1&amp;lt;|&amp;gt;2in Premier Faux Wood Blinds Painted&amp;lt;|&amp;gt;36 0.0000 x 60 0.0000&amp;lt;|&amp;gt;1&amp;lt;|&amp;gt;47.00&amp;lt;|&amp;gt;Y")&amp;amp;x_line_item=urlencode("2&amp;lt;|&amp;gt;Solid Vinyl PVC Verticals&amp;lt;|&amp;gt;36 0.0000 x 60 0.0000&amp;lt;|&amp;gt;1&amp;lt;|&amp;gt;39.00&amp;lt;|&amp;gt;Y")&amp;amp;x_line_item=urlencode("3&amp;lt;|&amp;gt;2in Designer Wood Blinds&amp;lt;|&amp;gt;36 0.0000 x 60 0.0000&amp;lt;|&amp;gt;1&amp;lt;|&amp;gt;64.00&amp;lt;|&amp;gt;Y")&amp;amp;﻿﻿&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If your x_line_item(s) are at the end of your string or in general don't forget to remove the last &amp;amp; before submitting!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That's it. I hope that this will help someone.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Martin&lt;/P&gt;</description>
      <pubDate>Tue, 27 Sep 2011 19:09:31 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/x-line-item-integration-in-PHP/m-p/17378#M9719</guid>
      <dc:creator>mrlerch</dc:creator>
      <dc:date>2011-09-27T19:09:31Z</dc:date>
    </item>
    <item>
      <title>Re: Resolved</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/x-line-item-integration-in-PHP/m-p/17418#M9739</link>
      <description>&lt;P&gt;Um, there's an interface for adding line items. From the AIM.markdown file in the PHP SDK:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;// To add itemized order information use the addLineItem method:

$auth-&amp;gt;addLineItem(
  'item1', // Item Id
  'Golf tees', // Item Name
  'Blue tees', // Item Description
  '2', // Item Quantity
  '5.00', // Item Unit Price
  'N' // Item taxable
);&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Sep 2011 06:42:05 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/x-line-item-integration-in-PHP/m-p/17418#M9739</guid>
      <dc:creator>TJPride</dc:creator>
      <dc:date>2011-09-28T06:42:05Z</dc:date>
    </item>
    <item>
      <title>Re: Resolved</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/x-line-item-integration-in-PHP/m-p/17434#M9747</link>
      <description>&lt;P&gt;Um .. I understand that there is an interface and sample API files. I am mainly saying that you have to possibly filter your Item names and descriptions so they have the correct string length and no special characters. Thank you for your 2 cents though.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Sep 2011 19:28:01 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/x-line-item-integration-in-PHP/m-p/17434#M9747</guid>
      <dc:creator>mrlerch</dc:creator>
      <dc:date>2011-09-28T19:28:01Z</dc:date>
    </item>
    <item>
      <title>Re: Resolved</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/x-line-item-integration-in-PHP/m-p/17446#M9750</link>
      <description>&lt;P&gt;Well, that's one way to address the problem, but the most efficient way in my opinion is to avoid it entirely by using the API and letting it deal with any XML formatting issues. Why anyone would want to mess with XML when there's a nice clean API layer on top, I don't know.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Sep 2011 21:18:38 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/x-line-item-integration-in-PHP/m-p/17446#M9750</guid>
      <dc:creator>TJPride</dc:creator>
      <dc:date>2011-09-28T21:18:38Z</dc:date>
    </item>
    <item>
      <title>Re: Resolved</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/x-line-item-integration-in-PHP/m-p/17468#M9759</link>
      <description>&lt;P&gt;can someone paste the addLineItem() function code? I see it in the markdown file but i can't find it in the class itself... What the heck is the function doing?&lt;/P&gt;</description>
      <pubDate>Thu, 29 Sep 2011 17:13:43 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/x-line-item-integration-in-PHP/m-p/17468#M9759</guid>
      <dc:creator>dadamssg</dc:creator>
      <dc:date>2011-09-29T17:13:43Z</dc:date>
    </item>
    <item>
      <title>Re: Resolved</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/x-line-item-integration-in-PHP/m-p/17488#M9768</link>
      <description>&lt;P&gt;Took me about 5 seconds to find it in the AuthorizeNetAIM.php file in the lib folder:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;    public function addLineItem($item_id, $item_name, $item_description, $item_quantity, $item_unit_price, $item_taxable)
    {
        $line_item = "";
        $delimiter = "";
        foreach (func_get_args() as $key =&amp;gt; $value) {
            $line_item .= $delimiter . $value;
            $delimiter = "&amp;lt;|&amp;gt;";
        }
        $this-&amp;gt;_additional_line_items[] = $line_item;
    }&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;This is a rather inefficient way to say that you want to put together id, name, descriptioon, quantity, price, taxable, separated by &amp;lt;|&amp;gt;. Then those are in turn added to the post string as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;foreach ($this-&amp;gt;_additional_line_items as $key =&amp;gt; $value) {
    $this-&amp;gt;_post_string .= "x_line_item=" . urlencode($value) . "&amp;amp;";
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Sep 2011 08:54:27 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/x-line-item-integration-in-PHP/m-p/17488#M9768</guid>
      <dc:creator>TJPride</dc:creator>
      <dc:date>2011-09-30T08:54:27Z</dc:date>
    </item>
    <item>
      <title>Re: Resolved</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/x-line-item-integration-in-PHP/m-p/20272#M11120</link>
      <description>&lt;P&gt;Use something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;	private function _authN_addLineItem(&amp;amp;$to,$item) {
	
		//wrapper for authNet's crappy addLineItem
		
		for ($i=0,$c=count($item);$i&amp;lt;$c;$i++) {
			$item[$i] = substr($item[$i],0,30);
		}
		
		if (empty($to-&amp;gt;line_item)) $to-&amp;gt;line_item = implode('&amp;lt;|&amp;gt;',$item);
		else {
			list ($item_id, $item_name, $item_desc, $item_quantity, $item_unit_price, $item_taxable) = $item;
			$to-&amp;gt;addLineItem($item_id, $item_name, $item_desc, $item_quantity, $item_unit_price, $item_taxable);
		}
	
	}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It'll cover the dumb $auth-&amp;gt;line_item format and strip your strings to 30 chars.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Dec 2011 17:47:48 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/x-line-item-integration-in-PHP/m-p/20272#M11120</guid>
      <dc:creator>alech28</dc:creator>
      <dc:date>2011-12-19T17:47:48Z</dc:date>
    </item>
    <item>
      <title>Re: Resolved</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/x-line-item-integration-in-PHP/m-p/20304#M11135</link>
      <description>&lt;P&gt;That empty() won't work. Do this instead:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;private function _authN_addLineItem(&amp;amp;$to,$item) {

	//wrapper for authNet's crappy addLineItem
	
	if (!isset($this-&amp;gt;_authN_addLineItem_hash)) $this-&amp;gt;_authN_addLineItem_hash = array();

	for ($i=0,$c=count($item);$i&amp;lt;$c;$i++) {
		$item[$i] = substr($item[$i],0,30);
	}
	
	$id = spl_object_hash($to);
	if (empty($this-&amp;gt;_authN_addLineItem_hash[$id])) {
		$to-&amp;gt;line_item = implode('&amp;lt;|&amp;gt;',$item);
		$this-&amp;gt;_authN_addLineItem_hash[$id] = true;
	} else {
		list ($item_id, $item_name, $item_desc, $item_quantity, $item_unit_price, $item_taxable) = $item;
		$to-&amp;gt;addLineItem($item_id, $item_name, $item_desc, $item_quantity, $item_unit_price, $item_taxable);
	}

}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Dec 2011 21:05:36 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/x-line-item-integration-in-PHP/m-p/20304#M11135</guid>
      <dc:creator>alech28</dc:creator>
      <dc:date>2011-12-19T21:05:36Z</dc:date>
    </item>
    <item>
      <title>Re: Resolved</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/x-line-item-integration-in-PHP/m-p/35529#M19848</link>
      <description>&lt;P&gt;Thanks for posting the answer to this issue. &amp;nbsp;I was having the same problems and your post was just what I needed! Thanks again&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2013 16:57:35 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/x-line-item-integration-in-PHP/m-p/35529#M19848</guid>
      <dc:creator>sjhutton</dc:creator>
      <dc:date>2013-09-05T16:57:35Z</dc:date>
    </item>
  </channel>
</rss>

