Authorize.net - 270 line item 2 is invalid

  • Posts: 195
  • Thank you received: 5
  • Hikashop Business
9 years 1 month ago #217208

-- HikaShop version -- : 2.6.0
-- Joomla version -- : 3.4.4
-- PHP version -- : 5.4.45
-- Error-message(debug-mod must be tuned on) -- : There was an error while processing your transaction: 270 Line item 2 is invalid.

We've got a site using Authorize.net.
In the past we've run into a similar error:

270: Line Item 1 is invalid error wAuthorize.net
See previous post here:
hikashop.com/forum/checkout/878231-270-l...rize-net.html#208758

This time it's saying it is 'line 2' that is invalid.

I've double-checked all the product titles and they contain only letters, spaces and hyphens.

We are using AWO Coupon, but I checked the coupon and there aren't any 'strange characters' there either.

The VERY strange thing is that this is not happening all the time. Sometimes we are getting this error on a specific product, with a certain credit card, but at other times other users are checking out with the same product without a problem.

I've tried to track down what might be the problem but it's difficult because I'm not able to reproduce here - only when users are trying to checkout.

Any ideas what this is ... or what 'line item 2' is referring to?

Please Log in or Create an account to join the conversation.

  • Posts: 82867
  • Thank you received: 13374
  • MODERATOR
9 years 1 month ago #217210

Hi,

Hard to say without being able to reproduce indeed.
That error indicates that either:
- you have a problem with the second product of the order
- you have only one product and you have a problem with the coupon
The best would be to add some debug of the variables in the plugin and store that in a log file. So that next time you get the problem, you'll get the data enabling you and us to understand what's the problem.

A simple solution is to turn off the "send order details" setting of the Authorize.net plugin.
without the details of the order sent, that problem won't happen.

Please Log in or Create an account to join the conversation.

  • Posts: 195
  • Thank you received: 5
  • Hikashop Business
9 years 1 month ago #217292

The order (most of them) only have 1 item, but they do have a coupon (provided by AWO).

AWO just provided an update so we're testing that (although it doesn't mention that it resolves anything similar to this).

I didn't know about the option to turn of sending order details.
We might try that as a temporary fix.
I'm guessing that it will then only send the store name to authorize.net.

Please Log in or Create an account to join the conversation.

  • Posts: 116
  • Thank you received: 7
  • Hikashop Business
8 years 11 months ago #223215

We are having the exact same problem...the line number changes to +1 of the total items in the cart... e.g. 1 item, the system reports "There was an error while trying to process your transaction: 270 line item 2 is invalid." and if there are 2 items in the cart, you get "There was an error while trying to process your transaction: 270 line item 3 is invalid.", etc.

All using discount coupon codes. The same order can be processed without a discount code and it works fine, so I don't think it is in the product description or item number (as they are processing just fine on other orders).

We are only using the native Hikashop components (discount codes, gateways, etc.) so obviously there is a combination of events taking place that passes garbage to Authorize.net that isn't getting sanitized to suit them.

Edit: confirmed this only happens with Authorize.net checkout and only if we are trying to use a coupon. To make sure, I updated HS with the latest code, still at 2.6.0 etc. Joomla 3.4.5.

Also, with the use of the coupon, the shopping cart can't add correctly (see below)

Subtotal $28.00
Coupon $-25.00
Shipping $0.00
MO Sales Tax $0.22
Total $5.09

The total should be 3.22 based on the numbers above. This is probably why Authorize.net is having problems--the gateway may being provided with erroneous information. In this test, the coupon is 100% for specific items. If I remove the coupon from the shopping cart, I get correct calculations...

Subtotal $28.00
Shipping $0.00
MO Sales Tax $2.09
Total $30.09

When we use another gateway, it will let you check out, but of course the amount is still wrong.

The difference is coming from Sales Tax calculations. The system is charging sales tax on the original amount, not the coupon/discount amount??

Testing using a 100% coupon...the order before the coupon is applied looks like this:

Subtotal $25.00
MO Sales Tax $1.87
Total $26.87

Then I apply a 100% coupon to the order, and I get this...

Subtotal $25.00
Coupon $-25.00
MO Sales Tax $0.00
Total $1.87

If I try a 50% coupon, I get this...

Subtotal $25.00
Coupon $-12.50
MO Sales Tax $0.93
Total $14.37

There is another thread www.hikashop.com/support/forum/discount-...-floating-taxes.html that talks about discounts and tax calculation problems.

Our tax settings are:
Detailed tax display: Yes
Type of address...: Billing
Main tax zone: Missouri (7.475%)
VAT number check: no check
Show taxed prices: no tax
Round prices during calculations: NO (it doesn't do it right if we enable this)
Floating tax prices: NO
Apply discounts: Before taxes

Help!!

Last edit: 8 years 11 months ago by stratacorps. Reason: show tax configuration

Please Log in or Create an account to join the conversation.

  • Posts: 82867
  • Thank you received: 13374
  • MODERATOR
8 years 11 months ago #223221

Hi,

It's probably because of this modification we put in the authorize.net payment plugin:
www.hikashop.com/forum/payment-methods/8...guration.html#211520
Revert that change on your website and that should fix the problem.
Next version of HikaShop will introduce a new option in the payment plugin so that it can send the amount that is necessary for all the payment gateways.

Please Log in or Create an account to join the conversation.

  • Posts: 116
  • Thank you received: 7
  • Hikashop Business
8 years 11 months ago #223238

Does that last post fix the shopping cart balance issue as well?

EDIT: No, actually it doesn't. I answered my own question--the shopping cart calculations are wrong with regard to discounts. I think this is related to the post I mentioned above, or at least similar to. When using a coupon code, the tax is not accounted for correctly on items based on the settings.

Also, on the thread Nicolas referred to...that was 4 screens of posts about another payment plugin. I found at least 3 different snippets of changes to make and I'm not sure I should change anything until the calculations issue is resolved. Do I need to post a different thread on this? I just assumed that the wrong totals were causing a problem to the authorize.net plugin because it always refers to a line item that doesn't exist (+1). Tax maybe??

Last edit: 8 years 11 months ago by stratacorps.

Please Log in or Create an account to join the conversation.

  • Posts: 82867
  • Thank you received: 13374
  • MODERATOR
8 years 11 months ago #223257

Hi,

This thread is about the discount value not being accepted by authorize.net and so my answer was regarding this exact issue.
That's the modification you want:
take.ms/SUYKD
www.hikashop.com/forum/payment-methods/8...html?start=60#211068
(kunena has a bug and removes the pagination in the link when you click on the post ID in order to get the anchor added to the current URL)

Regarding the calculation of the discount amount by HikaShop, it's a different matter. You have two things to control how taxes are calculated for the coupons:
- the "apply discount" setting of the HikaShop configuration
- the "product tax category" setting of the coupon
So you need to try the different combinations to get the one you want and that's it.

Please Log in or Create an account to join the conversation.

  • Posts: 116
  • Thank you received: 7
  • Hikashop Business
8 years 11 months ago #223262

I got it, found thread 211068 and will try that.

I will start a new thread on the calculation bug with coupons. As I mentioned earlier, I tried all settings to see if I could alter the behavior and it does not work. a 100% coupon, the system displays $0.00 tax, but the Total includes the original tax amount anyway.

Thanks

Please Log in or Create an account to join the conversation.

  • Posts: 116
  • Thank you received: 7
  • Hikashop Business
8 years 11 months ago #223268

This problem gets worse for me...



The example I gave earlier was for a 100% coupon. We worked around the issue by making the coupon taxable, which correctly states on checkout the amount due.

I worked around Authorize.net payment plug issue by NOT sending the order details to auth.net in the payment plugin settings. This allows the order to be paid, however as you can see from the order acknowledgement, there is something definitely wrong and this is probably why the payment plugin is having problems when we do send the order details.

As you can see...it has the coupon total as a negative number including the taxes (1.87 is $25.00 @ 7.475%).

Then the shipping is shown--which was all that should be due, and then another line item of 1.07 showing up.

The logic in this behavior tells me that when we have the default to send order details to the payment gateway, we are sending garbage and causing auth.net to reject the transaction with the Line 270 error.

There is definitely an issue with coupons and the authorize.net payment gateway plugin.

Attachments:
Last edit: 8 years 11 months ago by stratacorps.

Please Log in or Create an account to join the conversation.

Time to create page: 0.063 seconds
Powered by Kunena Forum