Support

Home Forums Event Espresso Premium Authorize.net Payment Declines. "Line item 1 is invalid. (Reason Code 270)"

Authorize.net Payment Declines. "Line item 1 is invalid. (Reason Code 270)"

Posted: August 23, 2018 at 12:00 pm


PJ Doland

August 23, 2018 at 12:00 pm

One of the tickets on our new event is now causing payments to be declined in Authorize.net. According to Authorize.net, this is a formatting problem with the line item on the transaction. It is not happening for all tickets on the event. As far as I can tell, there aren’t any extra spaces or special characters in the ticket title. There is some basic HTML in the description (

  • ), but the same HTML appears in all of the tickets. I’ve never seen this issue pop up before until after the most recent update, but I have no way of telling whether this is a ticket-specific issue or not. Any help on this would be much appreciated.

    The event in question is https://reason.org/events/reasons-50th-anniversary-gala/ and the ticket causing declines is the “Student Ticket”.


PJ Doland

August 23, 2018 at 12:03 pm

Oops. It won’t let me edit the previous post, but it wasn’t supposed to print the actual HTML. Should have said “There is some basic HTML in the description (<ul><li>)…”


Josh

  • Support Staff

August 23, 2018 at 12:32 pm

Hi,

You could try temporarily removing the contents of the Ticket description field, then test a registration for that ticket to see if that makes any difference.

You can also go to Event Espresso > Payment Methods > Logs and check the log items for the affected transaction. There should be 3 log items per transaction, and one of them will have the AIM Request sent: and another will have the AIM Response received:. The latter will include the breakdown of line items.


PJ Doland

August 23, 2018 at 1:38 pm

After removing the HTML, I still get the same error. I’m not exactly sure which field in the logs represents a “line item”, but if you have an idea what I should be looking for, I can check and report back. I can’t figure out what would make this ticket different from the others, besides the fact that it’s the last active ticket in the list (followed by one inactive ticket), which seems like an unlikely reason, since the order isn’t shared with Auth.net.


Josh

  • Support Staff

August 23, 2018 at 1:49 pm

The line items are labeled “x_line_item” in the log entry.


PJ Doland

August 23, 2018 at 2:04 pm

Hmm ok, well in the response log entry, there isn’t anything labeled that way, but in the preceding log entry for the same transaction, there is this line: ‘x_line_item=1%3C%7C%3EStudent+Ticket+for+Reason%92s+5%3C%7C%3E%28For+Reason%92s+50th+Anniversary+Gala%29%3C%7C%3E1.00%3C%7C%3E250.00%3C%7C%3EN’, which according to urldecoder.org translates to ‘1<|>Student+Ticket+for+Reasons+5<|>(For+Reasons+50th+Anniversary+Gala)<|>1.00<|>250.00<|>N’.

Does that look right? Are you able to spot the issue or validate that string somehow?


Josh

  • Support Staff

August 23, 2018 at 2:17 pm

You could check with Authorize.net and they can explain why it’s invalid.


PJ Doland

August 23, 2018 at 2:23 pm

That’s a bit of a flippant answer. Authorize.net isn’t malforming the line item, Event Espresso is. I will try to get their support team on the line, but either way, the fix will be on the EE side, unless you can point to something about the ticket setup itself that we’ve done wrong.


Josh

  • Support Staff

August 23, 2018 at 3:14 pm

I’m actually trying really hard to help. The thing is, I see no clues from Authnet’s documentation why that line item is invalid.

If there is something in EE that’s causing the line item to be invalid, it will get fixed. I haven’t seen this error reported elsewhere by EE users though, so I’m hesitant to jump to any conclusions about what’s causing this.


PJ Doland

August 23, 2018 at 3:20 pm

OK, fair enough. I’ve started a case with their support team, which got escalated to their tech team. Waiting to hear back.


PJ Doland

August 24, 2018 at 7:44 am

Here’s what Authorize.net says: The errors are generally caused by special characters, with the information you’ve provided there are many special characters listed in the item ID field, can you make sure those are not being passed to us?


Josh

  • Support Staff

August 24, 2018 at 8:27 am

So they want the special characters removed, so apparently the other transactions for other tickets that do not get declined have no special characters?

Do you happen to know if the text that was input for the one ticket, if it was copied in from a word processing document? I wonder if there’s a un-viewable BOM character that was unintentionally copied in.


PJ Doland

August 24, 2018 at 8:38 am

I can’t remember if it was pasted in originally, but I’ve just gone back and re-entered the ticket title manually, making sure there were no extra spaces or characters, and it failed with the same error again. I have a number of questions here, but almost zero answers.
1) When they say “special characters” are they referring to the URL encoding?
2) Do the EE logs print the actual request as it was sent to Anet, or a URLencoded version of the request?
3) Other tickets are transacting fine and seem to have the same encoding, although I haven’t gone through the effort of decoding them…
4) What are the <|> bits in the decoded string from my earlier message? Is it supposed to be a pipe separator? If so, why do they have brackets?
5) Do you or Authorize.net have some way of validating requests?
6) Why is it so hard to find documentation from Anet about what is a VALID line item or what is considered a special character?


PJ Doland

August 24, 2018 at 9:30 am

Authorize.net is claiming that these transactions are never making it to their server because the transactions don’t show up at all in our account. I’m pretty sure that’s impossible, since we are getting a response code FROM AUTHORIZE.NET.

But, Josh, I’m gonna need some more detailed help here. They’ve told me repeatedly that whatever the issue is, it’s because the line item isn’t formatted properly. That’s not something I or Anet have control over at this point… Is there any way to get a phone call going, or a live chat of some kind, so we can quicken the pace here? I’ve got a customer waiting for 3 days now to purchase a ticket.


PJ Doland

August 24, 2018 at 10:28 am

OK, I’ve got a major update here. After talking to my 5th Authorize.net representative, I found out that NO SPECIAL CHARACTERS are supposed to be in the line item, even though their documentation just says “String, up to 31 characters”.

Unfortunately, the way Event Espresso builds the line item titles and descriptions is the reason for the Reason Code 270, but you wouldn’t know that based on their documentation. Here’s what is happening.

Our event is called “Reason’s 50th Anniversary” (note the apostrophe). When we sell our Early Bird Individual Ticket, here’s an example of the URLdecoded string that gets sent to Anet as the line item:
1<|>Early Bird Individual Ticket fo<|><ul> <li>Reason Panels and Speakers (lunch included) on Nov. 3</li> <li>50th Anniversary Gala on Nov. 3</li> </ul> (For Reason�s 50th Anniversary Gala)<|>2.00<|>500.00<|>N

When we sell our Student Ticket, here’s what the line item looks like:
`1<|>Student Ticket for Reason�s 5<|><ul>
<li>Reason Panels and Speakers (lunch included) on Nov. 3</li>
<li>50th Anniversary Gala on Nov. 3</li>
</ul> (For Reason�s 50th Anniversary Gala)<|>1.00<|>250.00<|>N`

Notice, in the second block, the ticket title is short, so it concatenates the event title. But the event title contains an apostrophe. THIS is what is causing the failure. The apostrophe is apparently not allowed in the Line Item Title, but is allowed in the description (although it get’s pretty mangled on their end).

There are a few things EE should do to fix the Authorize integration.
1) All line item fields should be stripped of all non-alphanumeric characters before sending to Anet. These values are passed along in a non-HTML-friendly way to the customers in receipt emails, so the customer literally sees all the mangled characters and HTML tags in their receipts 🙁
2) If you’re going to strip HTML from descriptions, it would probably be good to let clients know that HTML isn’t valid in that field, or figure out some way to parse basic HTML tags to a no-special-characters string for receipt purposes.
3) Maybe stop concatenating the event title to the ticket title in the case of short ticket titles, since the event title is already being included in the description field. Seems redundant and created this weird bug that sent me on a 72-hour back-and-forth between you guys and Anet.

I look forward to hopefully seeing the patch for this released soon. In the meantime, if anyone else has this issue, the solution is A) to remove special characters from your ticket titles AND event titles or B) remove special characters from your ticket titles and make the ticket titles long enough that any special characters from the event title don’t get concatenated. I solved this by changing “Student Ticket” to “Student Discount Ticket” hahahahaha.


PJ Doland

August 24, 2018 at 10:29 am

Crap, I messed up the code blocks again… and still no edit button 🙁


Josh

  • Support Staff

August 24, 2018 at 12:17 pm

Hi,

Thanks for taking the time to share this detailed report. One of the developers has already done a pull request to fix this:

https://github.com/eventespresso/event-espresso-core/pull/663


PJ Doland

August 24, 2018 at 1:25 pm

Awesome! Thank you. Here’s the response I got from Anet when I pushed them on the details:

Thank you for your reply, I am happy to clarify our level of support regarding the error responses you are receiving through the API. Though we can go over the Response Reason Code (270), we are not trained developers and do not provide developer support on your code. I would recommend having your developer set up a free Sandbox Account for testing, through the following link: https://developer.authorize.net/sandbox/ They would need to post to our Sandbox environment when using this account for testing (https://test.authorize.net/gateway/transact.dll). They can also use the following API Reference Guide to test different requests submitted to Authorize.Net to figure out what parts of your requests are working, and aren’t working, under “Test Your Authentication Credentials”: https://developer.authorize.net/api/reference/index.html

Haha, so not gonna get much further with these guys. Anyway, thank you for taking this seriously. Glad to see it’ll be addressed soon.


Josh

  • Support Staff

August 25, 2018 at 10:12 am

Haha, yeah we do use their sandbox. To their credit that’s good advice to use the sandbox for developing!

Anyway I’ll update this topic when the pull request has been included in an minor point version release.

The support post ‘Authorize.net Payment Declines. "Line item 1 is invalid. (Reason Code 270)"’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Support forum for Event Espresso 3 and Event Espresso 4.
Documentation for EE3 and EE4
Documentation for Event Espresso 3

Documentation for Event Espresso 4

Status: closed

Updated by  Josh 1 year, 3 months ago ago

Topic Tags

Notifications

This topic is: not resolved
Do NOT follow this link or you will be banned from the site!