cancel
Showing results for 
Search instead for 
Did you mean: 

asp.net AIM Line item 1 is invalid.

I don't see what the problem is in creating the line_items. Line item 1 is invalid. Thanks in advance!

 

My code:

 

Dim stringList As New List(Of String)()

If Session("p1Name") <> "" And Session("p1Amt") <> "" Then
stringList.Add("item1<|>" & Session("p1Name") & "<|>Donation<|>1<|>" & Session("p1Amt") & "<|>")
End If
If Session("p2Name") <> "" And Session("p2Amt") <> "" Then
stringList.Add("item2<|>" & Session("p2Name") & "<|>Donation<|>1<|>" & Session("p2Amt") & "<|>")
End If
If Session("p3Name") <> "" And Session("p3Amt") <> "" Then
stringList.Add("item3<|>" & Session("p3Name") & "<|>Donation<|>1<|>" & Session("p3Amt") & "<|>")
End If
If Session("p4Name") <> "" And Session("p4Amt") <> "" Then
stringList.Add("item4<|>" & Session("p4Name") & "<|>Donation<|>1<|>" & Session("p4Amt") & "<|>")
End If
If Session("p5Name") <> "" And Session("p5Amt") <> "" Then
stringList.Add("item5<|>" & Session("p5Name") & "<|>Donation<|>1<|>" & Session("p5Amt") & "<|>")
End If
If Session("p6Name") <> "" And Session("p6Amt") <> "" Then
stringList.Add("item6<|>" & Session("p6Name") & "<|>Donation<|>1<|>" & Session("p6Amt") & "<|>")
End If
If Session("p7Name") <> "" And Session("p7Amt") <> "" Then
stringList.Add("item7<|>" & Session("p7Name") & "<|>Donation<|>1<|>" & Session("p7Amt") & "<|>")
End If
If Session("p8Name") <> "" And Session("p8Amt") <> "" Then
stringList.Add("item8<|>" & Session("p8Name") & "<|>Donation<|>1<|>" & Session("p8Amt") & "<|>")
End If

Dim line_items As String() = stringList.ToArray()

For Each value As String In line_items
post_string += "&x_line_item=" + HttpUtility.UrlEncode(value)
Next

bt99
Member
14 REPLIES 14

so, using the following:

Dim line_items As String() = stringList.ToArray()
For Each value As String In line_items
post_string += "&x_line_item=" + HttpUtility.UrlEncode(value)
Next

response.write(post_string)

 

i get

 

  1. 270 
  2. (TESTMODE) Line item 1 is invalid. 

 

x_line_item=item1%3c%7c%3eAll+Aboard+Westcliffe%3c%7c%3eDonation%3c%7c%3e1%3c%7c%3e%2410.00%3c%7c%3eN

x_line_item=item1<|>all+aboard+westcliffe<|>donation<|>1<|>%2410.00<|>n

 

x_line_item=item1%3c%7c%3eAll+Aboard+Westcliffe%3c

%7c%3eDonation%3c%7c%3e1%3c%7c%3e%2410.00%3c%7c%3eN

 

look like you have bad data in Session("p1Amt")

Thanks, the amt should be 10.00 not 2410.00. I'll look into the session.

%24 is $

 
Item price (per unit)<|>: Up to two decimal places. Must be a positive number. The dollar sign ($) is not allowed when submitting delimited information. Excludes tax, freight, and duty.

Thanks very much for your help! You saved me a bunch of time.

 

I knew the $ could not be in the amt but it still got in. Here is my item one now, i hope this will help someone else.

 

x_line_item=item1%3c%7c%3eAll+Aboard+Westcliffe%3c%7c%3eDonation%3c%7c%3e1%3c%7c%3e10%3c%7c%3eN