[ic] authorize.net, 4.7.7, construct

Mike Heins interchange-users@lists.akopia.com
Mon Aug 6 10:59:01 2001


Quoting Pann McCuaig (pann@ourmanpann.com):
> 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.

This should be in the foundation demo already.

> 
> 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},

That shouldn't be necessary -- b_address is supposed to be automatically
composed of b_address1 (and b_address2 if present). I verified that
this is the case when using AuthorizeNet.

>    and
> 	x_Zip => $actual->{zip},
>    with
> 	x_Zip => $actual->{b_zip},

This is correct and was an error. I have made the change, thank you.

> 
> 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?

There is a mapping method, and it should/used-to-be documented. But
if you were using "grep" and didn't find it, I will check on that.
The method is:

Variable MV_PAYMENT_REMAP <<EOF
	new_var  existing_var
EOF

You can also use the "remap" key in the route if you are using
the Route method of configuration.

In any case, it should not be needed when the above changes are
made. Again, I believe you don't need/want to make the b_address <= b_address1
change.

> 
> 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},

Thank you -- I was not aware they used those. The module came from
the authorizenet GlobalSub which was in use by quite a few people,
and that never contained those.

> 
> 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'),
> ###    );
> ###  }

I was not aware you didn't need a secret. I have changed the 
module to tolerate its lack.

> 
> 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

This is all in the POD documentation for the module. "CreditCardAuto No"
is the default, and CreditCardAuto is deprecated. It doesn't need to
be mentioned unless it was set somewhere else in the config file.

> 
> 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.

Thanks very much for the feedback -- I really appreciate well-investigated
criticism and help. The fixes are in CVS and will make it into 4.8.1.

Best,
Mike
-- 
Red Hat, Inc., 3005 Nichols Rd., Hamilton, OH  45013
phone +1.513.523.7621      <mheins@redhat.com>

Fast, reliable, cheap.  Pick two and we'll talk.  -- unknown