[ic] authorize.net, 4.7.7, construct

Pann McCuaig interchange-users@lists.akopia.com
Mon Aug 6 08:21:01 2001


FWIW, here is how I got authorize.net support functional. Gleaning the
information needed to make this happen was a combination of paying
attention on this list, reading the source of
.../lib/Vend/Payment/Authorizenet.pm, and creative use of grep.  ;->

I'm using interchange 4.7.7 with a catalog based on the construct demo
that shipped with 4.6.5.

1) In order to see any errors that come back from secure.authorize.net,
   I added the following line in .../pages/ord/checkout.html:

   [data session cybercash_error]

   I put it right above this line:

   [if type=explicit compare="[error all=1 show_var=1 keep=1]"]

   checkout.html is otherwise unmodified from the construct demo version.

2) To get the variables in ../lib/Vend/Payment/Authorizenet.pm and
   .../products/mv_metadata.asc lined up it's necessary to make the
   following changes to Authorizenet.pm:

   replace
	x_Address => $actual->{b_address},
   with
	x_Address => $actual->{b_address1},
   and
	x_Zip => $actual->{zip},
   with
	x_Zip => $actual->{b_zip},

2a) Isn't it evil to require congruence between variables used in a
    module global to interchange and those local to a catalog? At least
    without providing a mapping method? Or have I overlooked some
    essential documentation?

3) To make secure.authorize.net stop whining about missing variables
   it's necessary to add the following to Authorizenet.pm:

	x_Country => $actual->{b_country},
	x_Email => $actual->{email},

4) To assuage my paranoia about putting passwords in text files
   on servers connected to the Internet (since my account at
   authrorize.net, at least, doesn't require a password to process a
   charge), comment out lines in Authorizenet.pm as follows:

###  x_Password => $secret,
###  $secret = $opt->{secret} || undef;
###  $secret = $opt->{secret} || undef;

   (yup, the line is duplicated in the original file, shrug)

###  $secret  =  $opt->{secret} if ! $secret;
###  if(! $secret) {
###    $secret    =  charge_param('secret')
###    or return (
###      MStatus => 'failure-hard ',
###      MErrMsg => errmsg('No account id'),
###    );
###  }

5) Add the following line at the end of interchange.cfg:

   Require module Vend::Payment::AuthorizeNet

   Note that either Net::SSLeay or both of LWP::UserAgent and
   Crypt::SSLeay must be installed for the AuthorizeNet module to load
   successfully.

6) Add these lines to catalog.cfg:

   Variable  MV_PAYMENT_MODE     authorizenet
   Variable  MV_PAYMENT_ID       <your authorize.net user id>
   Variable  MV_PAYMENT_REFERER  <your authorize.net referrer URL>
   Variable  MV_PAYMENT_TEST     TRUE
   CreditCardAuto   No

At this point, restart interchange and give it a go. This works for me
(in TEST MODE only, so far; my authorize.net account is live and the
interchange store isn't). YMMV, of course.

Luck,
Pann
-- 
geek by nature, Linux by choice                     L I N U X       .~.
                                                    The Choice      /V\
http://www.ourmanpann.com/linux/                     of a GNU      /( )\
                                                    Generation     ^^-^^