[ic] payment module authorizenet (modifications)

Dwayne interchange-users@icdevgroup.org
Tue May 27 00:53:00 2003


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

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;


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

HTH

- Dwayne