[ic] Authorizenet payment module (modifications)

Philip S. Hempel interchange-users@icdevgroup.org
Mon Jun 2 12:48:00 2003


I have almost completted the modifications to the authorizenet module for CVV2, I
am running into a situtaion the looks like I may have to do a complete rewrite of
the module if it is true.

I am trying to come up with a regex that will work with the split function.
One of the problems with the original code is that it only cared about the first 6
fields that get kicked back. Now the response code for CVV2 and some of the other
responses do not fall into an order that can be handled correctly.

One problem is if any order has a billing address that covers more than one line it
will have commas added to it. When this happens the order of fields change. Now
authorize allows a field encapsulation character to be used so that you know that
the comma delim area is of the same field.

I did a real hack to try and make this work it looked like this.
 = split (/$fielddelim,$delimchar,$fielddelim/,$page);

Well it worked perfectly except as you may well know that the first or last field
will not be correct since the response would look like this

|code|,|code|,|code|,|stuff,stuff,stuff|,|response info stuff|

and the same for total of 69 fields.

Well the first field gets parsed and then shows as "|code" and the rest works fine
and the last would look like "code|".
If someone could help out with some idea that may not require a full rewrite. I had
been looking at some other perl modules from the
business::onlinepayment::authoriznet
and I like how it was handled there. It was clean and took nothing for granted in
the output.

I appreciate any help that could be given. My limited knowledge of perl "kinda"
gets in my way!

Thanks all.

BTW I have tried numerous forms of regex to parse the fields and I have come to the
conclusion, "This part is beyond me".

-- 
debian/rules