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
Solved! Go to Solution.
11-03-2013 07:55 AM
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
|
x_line_item=item1%3c%7c%3eAll+Aboard+Westcliffe%3c%7c%3eDonation%3c%7c%3e1%3c%7c%3e%2410.00%3c%7c%3eN
11-04-2013 12:58 PM
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")
11-04-2013 01:56 PM
Thanks, the amt should be 10.00 not 2410.00. I'll look into the session.
11-04-2013 02:04 PM
%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. |
11-04-2013 02:07 PM - edited 11-04-2013 02:08 PM
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
11-04-2013 02:20 PM