[bop-devel] Text::CSV_XS and errors

Mike Barry MBarry at cos.com
Mon May 15 07:44:53 PDT 2006


All,
   I just had an issue where Business::OnlinePayment::AuthorizeNet
was choking on a successful auth due to some quoting issues. Basically,
I had a customer that put their ship_to name in quotes so the return
looked something like this:

"1","1","1","This transaction has been 
approved.","123456","N","1234567890","123456","Foo",
"35.00","CC","auth_capture","1234567",
"J","User","Foo","123 Main 
Street","Anywhere","ST","90210","US","555-5555","","joe at user.com",
"Joe","Joe "User"","Foo","123 Main 
Street","Anywhere","ST","90210","United States",
"","","","","","md5hash","P","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""

The real problem is that  4th line with the  "Joe "User"" entry. 
Text::CSV_XS barfs on that line
since User is also inside quotes (they way my end-user entered the data).

My question(s) to this list is -
  a. is this something I can only handle from my front-end code
     (strip out or replace double quotes)?
  b. do you think this is an AuthorizeNet bug
     (since returning a field as "foo "bar"" is inherently bad - they
      should escape that as "foo \"bar\"")
  c. This is a Text::CSV_XS bug (since the escape char is set to ")


Thanks, MikeB.  


More information about the bop-devel mailing list