[ic] Authorizenet payment module (modifications)
John Young
interchange-users@icdevgroup.org
Thu Jun 5 16:01:01 2003
Philip S. Hempel wrote:
> It seems to put a comma in between the two and authorizenet make use of it to split
> see the output from the logs later.
>
>> if($actual{b_address1}) {
>> $actual{b_address} = "$actual{b_address1}";
>> $actual{b_address} .= ", $actual{b_address2}"
>> if $actual{b_address2};
>> }
Yes, I wasn't paying attention to that earlier. The code above
sorta turns into a bug if you just add all the extra return fields
and do nothing else. I don't think it is a big problem if you
use an alternate delimiter without field encapsulation, though.
I *would have* said that for the Interchange distribution, the code above
from Payment.pm should not have the "," added during concatenation;
however, there is nothing to stop a customer from adding a comma in
their address (unless you filter it out) -- so the risk remains.
For now, I vote for the solution following the next quote:
> This is the output that is sent back from a submission using the : (colon) as a delim.
> It is required to have a field sperator, using the comma default is what I have
> chosen. The field encapsulation chararacter is optionial if wanting to use the
> extended (cvv2 and others) information then it would be required.
Why not use "|" as the delimiter and no field encapsulation? That
strategy should (I think) only entail the following:
* Change AuthorizeNet preferences to use "|" (on AuthorizeNet web site)
* Change AuthorizeNet.pm to use:
= split (/\|/,$page);
instead of:
= split (/,/,$page);
for @result{}.
* Filter "|" out of form input (if it isn't already).
If "|" isn't good, one could use "~" for a pseudo X12 EDI feel ;-)
Fiddling with field encapsulation just seems like a bunch of extra work
to me ('cause you would still have to alter ANet settings, etc.). I
don't believe it buys you anything. Don't be too hard on yourself --
the steps above should work and are pretty simple.
Good luck,
John Young