Hello-
I am trying to follow the instructions I found online in terms of formatting with delimiters and am getting the above error with the following syntax.
$lineItem = "x_line_item=item1<|>home3<|>Basic (Reuse)<|>$29.99<|>Y&x_line_item=item2<|>4<|>New Basic<|>$49.99<|>Y&";
echo "<INPUT type='hidden' name='x_line_item' value='$lineItem' />";
All other fields work using PHP so am wondering what is wrong with my syntax or if I am even going about correctly.
Thank you,
Josh
Solved! Go to Solution.
11-04-2010 04:04 PM
<?php
while($x != $i){
$lineItem = $_SESSION['lineItem'][$x];
echo "<INPUT type=\"hidden\" name=\"x_line_item\" value=\"$lineItem\" />";
$x++
}
?>
$i = the number of individual items purchased.
$x = 0
$_SESSION['lineItem'][$x] = looks like your comment #2. but is associated with however many items are purchased
This works for me!!!
Thanks for your help!
Josh
11-07-2010 03:23 PM
Greetings,
You have two things wrong with the format of the line item string below that is easily fixable!
1) quantity parameter is missing from line item string
2) you may not include a "$" sign inside the amount field
Once these items were removed the processing was absolutely flawless.
Correct Format:
item1<|>home3<|>Basic (Reuse)<|>1<|>29.99<|>Y
Also placing (') single quotes around a PHP variable may cause it not to be evaluated, I would use double quotes please, or remove the single quotes entirely.
Thanks!
11-04-2010 07:30 PM
Thank you,
Will give this a try and post back with success or more questions.
Cheers,
Josh
11-05-2010 10:49 AM
item1<|>home3<|>Basic (Reuse)<|>1<|>29.99<|>Y&item2<|>home4<|>Pro (Reuse)<|>1<|>49.99<|>Y&
Does not seem to work for me. What would I need to format to have x_line_item except multiple items in a single string?
11-05-2010 11:22 AM
I am putting the above line into one $variable and passing it along in the 'hidden' field.
11-05-2010 01:01 PM
Please echo this hidden field and see what you receive. I believe the single quotes you original used around the variable name is causing it not to be read properly.
11-06-2010 01:29 PM
I tried using double quotes and I have also tried piping each line into an array and then using a while loop to post each element in the array. What I get when I post with only one item purchased from my site is successful and it looks great on the athorize.net credit card page but when I order more than one item invoking a second or third item then I get the (270) line item 1 is invalid. If I use the while loop and array method I get a (270) per line item vs. just line item 1...
11-06-2010 02:47 PM
Please post your code for review.
Thanks!
11-06-2010 04:54 PM
<?php
while($x != $i){
$lineItem = $_SESSION['lineItem'][$x];
echo "<INPUT type=\"hidden\" name=\"x_line_item\" value=\"$lineItem\" />";
$x++
}
?>
$i = the number of individual items purchased.
$x = 0
$_SESSION['lineItem'][$x] = looks like your comment #2. but is associated with however many items are purchased
This works for me!!!
Thanks for your help!
Josh
11-07-2010 03:23 PM
My site is having the similiar error. I read up on the error and tried to make the necessary corrction, but it is still having the error. Maybe some one can take a look at the web site and advise what exactly needs to be fixed?
08-13-2011 12:02 PM