[ic] payment module authorizenet (modifications)

Philip S. Hempel interchange-users@icdevgroup.org
Tue May 27 16:38:01 2003


On Mon, 2003-05-26 at 22:53, Dwayne wrote:
> On Fri, 2003-05-23 at 11:52, Philip S. Hempel wrote:
> > TGIF everyone
> > 
> > I am using 4.9.7 daily
> > 
> > I am working on the authorizenet payment module and I am running into a
> > few glitches. 
> > 
> > I added to the module support for using the transid as per one of the
> > messages in the mailing list. This worked out great no problems.
> > 
> > OK, I want to add cvv2 support and that seemed to be  as simple as doing
> > a remap.
> > 
> > I placed mv_credit_card_cvv2 and a form on the checkout and that worked
> > fine. I do an order and the encrypted card that is emailed get the cvv2
> > number.
> > Ok for the remap I placed the 
> > x_Card_Code => $actual->{mv_credit_card_cvv2}
> > 
> > x_Card_Code does not map. 
> > 
> > So I do some digging and I decide to try something different, I put in
> > my checkout "my_card_code" and replace all of the above with this
> > variable. I then put in Payment.pm the my_card_code and then test.
> > 
> > Changing the above works for some reason. 
> > I also notice that mv_order_number is not remapped. I am thinking that
> > this has something to do with the same problem.
> > 
> > I am far from knowing perl so most of the things going on in the module
> > I do not understand.
> > 
> > I think I understand how cvv2 works, the "mv_credit_card_cvv2" gets
> > mapped by IC into "cvv2" in the Order.pm. The cvv2 then is used by
> > Payment.pm to be processed by whatever payment type it is. 
> > 
> > My confusion comes when I use any other variable and add it to
> > Payment.pm it works just fine. 
> > 
> > What am I seeing or doing that is incorrect? 
> > Also I have been trying to find the "'Payment Settings' heading in the
> > Interchange documentation" to learn something about the remapping of
> > these variables.
> 
> You've probably already figured this out, but just in case, I found a
> few things you might find useful.
> 
> Setup:
> 
> (using 4.9.6)
> 
> In the checkout form (old_browser_payment and new_browser_payment) I put
> an input field named "mv_credit_card_cvv2".
> 
> In the payment module, the usual
> 
> sub payment_module_name {
>     my($user) = @_;
> 
> ...stuff...
> }
> 
> in catalog.cfg:
> 
> Variable MV_PAYMENT_REMAP <<EOF
> 	mv_credit_card_cvv2    mv_credit_card_cvv2
> EOF
> 

I am still not sure why this is even needed to be done since IC is
making use of mv_credit_card_cvv2 already, is it not?


> This gave me the following values in $user:
> 
> $user->{'actual'}{'cvv2'} eq '123'
> $user->{'actual'}{'mv_credit_card_cvv2'} == undef;
> 
> I think you're supposed to be able to assign to different variable names
> with this syntax (see:
> http://www.icdevgroup.org/archive/interchange-users/2001/msg07488.html
> )
> 
> but when I tried:
> Variable MV_PAYMENT_REMAP <<EOF
> 	foo    mv_credit_card_cvv2
> EOF
> 
> $user->{'actual'}{'foo'} was undefined.
> 
> Using routes also works, though slightly differently:
> 
> Route    route_name_here    remap               mv_credit_card_cvv2
> 
> result:
> $user->{'actual'}{'mv_credit_card_cvv2'} eq '123';
> $user->{'actual'}{'cvv2'} == undef;
> 
> 

So why is mv_credit_card_cvv2 defined when the Route remap is supposed
to work the same as the Variable define, or am I not understanding this
correctly?

Mike stated in the email that it was to work the same, did he not?

After some testing, I have found that cvv2 never get mapped into
AuthorizeNet. 


> I'm still playing with this - if I find anything interesting, I'll post
> it.
> 
> HTH

>From all the things I have gone through today I have had problems
completely trying to use 
	Route route_name_here remap variable

I can not get the below to define for anything other than the last remap
and it does not work like MV_PAYMENT_REMAP does.

--
	Route route_name_here remap variable
	Route route_name_here remap variable2
--

Or thinking outside the box

	Route route_name_here remap variable variable.

Does nothing since it gets parsed as

	remap => undef; variable => variable;

I wanted to pass the order number and a few other variables and the only
way to get them to pass was to us this

	<Variable MV_PAYMENT_REMAP>
	mv_credit_card_cvv2 mv_credit_card_cvv2
	mv_order_number	mv_order_number
	</Variable>

These are so far the only variables to map out
I want to add the shipping (or mv_shipping) and salestax as well but the
above usage seems to not apply (I may not be using the proper variables)


I am so very confused as why the need for standard variables to have to
be added to the remap configuration? I would think that cvv2 should just
work like the credit card number would.

I am not happy with the way this to be setup and I would not expect
anyone else using this module who want cvv2 support (cost is reduced for
each transaction when using cvv2, and is supposed to be more secure.)

Is this the same with the other payment modules, having to define the
cvv2 remaps, or is it the way the AuthorizeNet module is written?

Any ideas about why this is, please shed some light on it for me!

Thanks for pointing me in the right direction with this.

More digging and information will follow.


-- 
Philip S. Hempel

Give a man a fish and he will feed himself for a day.
Teach a man to fish and he will feed himself for a lifetime.

http://linuxhardcore.com/