Reply
Member
Posts: 2
Registered: ‎06-13-2015
Accepted Solution

Line item x is invalid. (270) where amount is a negative value

[ Edited ]

We are hitting the buffers on invalid line item when one line item is a negative number

 

If result = True Then
                        Dim vDebit As Double = Row.Cells(1).Text
                        Dim vCredit As Double = Row.Cells(2).Text
                        Dim vInvNo As Integer = Row.Cells(8).Text
                        Dim vInvoiceDescription As String = Row.Cells(6).ToolTip
                        Dim LineAmount As Double = 0
                        If vCredit > 0 Then
                            Dim CreditString As String = "-" & CType(vCredit, Double)
                            LineAmount = CType(CreditString, String)
                        Else
                            LineAmount = vDebit
                        End If
                        vTotal += LineAmount
                        objInf.Add("x_line_item=item" & vItemNo, "<|>Invoice " & vInvNo & "<|>" & vInvoiceDescription & "<|>1<|>" & LineAmount & "<|>N")
                        vItemNo += 1
                    End If

 

so the line amount will be processed as -10.00 where the customer selects

One invoice $100.00

One Credit $10.00

One Invoice $100.00

 

Total $190.00

 

How should this be configured?

 

Thanks


Accepted Solutions
Solution
Accepted by topic author gchq
‎08-21-2015 01:58 AM
Member
Posts: 2
Registered: ‎06-13-2015

Re: Line item x is invalid. (270) where amount is a negative value

Seems the answer is not to have a negative amount in the values - it will still process as $190.00 if the amounts are

 

$100.00

  $10.00

$100.00

 

Looks like the gateway actually ignores the amounts  provided the correct total is given, so by changing the code to

 

If result = True Then
                        Dim vDebit As Double = Row.Cells(1).Text
                        Dim vCredit As Double = Row.Cells(2).Text
                        Dim vInvNo As Integer = Row.Cells(8).Text
                        Dim vInvoiceDescription As String = Row.Cells(6).ToolTip
                        Dim LineAmount As Double = 0
                        Dim LineBalance As Decimal = 0
                        If vCredit > 0 Then
                            Dim CreditString As String = "-" & CType(vCredit, Double)
                            LineAmount = CType(CreditString, String)
                            LineBalance = vCredit
                        Else
                            LineAmount = vDebit
                            LineBalance = vDebit
                        End If
                        vTotal += LineAmount
                        objInf.Add("x_line_item=item" & vItemNo, "<|>Invoice " & vInvNo & "<|>" & vInvoiceDescription & "<|>1<|>" & LineBalance & "<|>N")
                        vItemNo += 1
                    End If

It will process the line item as a positive number but the total will be correct

 

View solution in original post


All Replies
Solution
Accepted by topic author gchq
‎08-21-2015 01:58 AM
Member
Posts: 2
Registered: ‎06-13-2015

Re: Line item x is invalid. (270) where amount is a negative value

Seems the answer is not to have a negative amount in the values - it will still process as $190.00 if the amounts are

 

$100.00

  $10.00

$100.00

 

Looks like the gateway actually ignores the amounts  provided the correct total is given, so by changing the code to

 

If result = True Then
                        Dim vDebit As Double = Row.Cells(1).Text
                        Dim vCredit As Double = Row.Cells(2).Text
                        Dim vInvNo As Integer = Row.Cells(8).Text
                        Dim vInvoiceDescription As String = Row.Cells(6).ToolTip
                        Dim LineAmount As Double = 0
                        Dim LineBalance As Decimal = 0
                        If vCredit > 0 Then
                            Dim CreditString As String = "-" & CType(vCredit, Double)
                            LineAmount = CType(CreditString, String)
                            LineBalance = vCredit
                        Else
                            LineAmount = vDebit
                            LineBalance = vDebit
                        End If
                        vTotal += LineAmount
                        objInf.Add("x_line_item=item" & vItemNo, "<|>Invoice " & vInvNo & "<|>" & vInvoiceDescription & "<|>1<|>" & LineBalance & "<|>N")
                        vItemNo += 1
                    End If

It will process the line item as a positive number but the total will be correct

 

Administrator Administrator
Administrator
Posts: 558
Registered: ‎08-03-2011

Re: Line item x is invalid. (270) where amount is a negative value

 

Hi gchq,

 

Whatever data you pass for the line item fields are not validated. Authorize.Net will only validate the total amount and process what is submitted as the total amount.

 

Thanks,

Joy

New Member
Posts: 1
Registered: ‎07-10-2017

Re: Line item x is invalid. (270) where amount is a negative value

AuthorizeInvalidError: {'line_items.1.unit_price': u'-5.00 is less than minimum value 0'}

I got This Error whenever i pass line with the negative unit price as discount . 

Highlighted
Administrator
Posts: 419
Registered: ‎11-03-2016

Re: Line item x is invalid. (270) where amount is a negative value

Hi @mahesh_teck,

 

You got that error because a negative amount is not allowed.

-Aaron

Aaron Wright
Developer Advocate - Authorize.Net

Follow Authorize.Net developer news on Twitter!