In switching from authorize.net's SIM method over to AIM method of handling credit card transactions the way a LINE-ITEM is sent to the processor is different. In the (SIM) version, I could send line items by looping through the results and echoing the hidden INPUT field and its values with appropriate separators like this:
$qw = mysqli_query($con,"SELECT * FROM XCart WHERE Buyer_ID='xyz' LIMIT 30");
$ctr=0;
while($list = mysqli_fetch_array($qw))
{
++$ctr;
echo "<input type='hidden' name=\"x_line_item\" value=\"".$list['Item_Number']."<|>".substr($list['Item_Title'], 0, 30)."<|><|>".$list['Item_Qty']."<|>".$list['Item_Price']."<|>Y\">
";
}
But now, under the AIM method, the line items are assigned to an ARRAY, I am still in the infancy stages of PHP, but when I try to place a WHILE LOOP inside of the array similar to the above method, it gives me errors:
$line_items = array( WHILE LOOP INSIDE HERE);
The output of the AIM method should output as shown below, but I'm not sure how to loop through the results in a manner that gives me this output below. I'm missing something and/or doing it wrong, but any help would be appreciated.
$line_items = array(
"item1<|>golf balls<|><|>2<|>18.95<|>Y",
"item2<|>golf bag<|>Wilson golf carry bag, red<|>1<|>39.99<|>Y",
"item3<|>book<|>Golf for Dummies<|>1<|>21.99<|>Y"
);