X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=AuthorizeNet.pm;h=40c01d92159735c5ebccae5130de5506a912d9b6;hb=5cd0df412eb70a04eef6a29b6367d962332586e2;hp=028b6d825c9da4f2c6b73328f96ccadd8a742cc8;hpb=7b4ea762675c7c24fdce4e0139cb98ba5d2f35ca;p=Business-OnlinePayment-AuthorizeNet.git diff --git a/AuthorizeNet.pm b/AuthorizeNet.pm index 028b6d8..40c01d9 100644 --- a/AuthorizeNet.pm +++ b/AuthorizeNet.pm @@ -1,11 +1,11 @@ package Business::OnlinePayment::AuthorizeNet; -# $Id: AuthorizeNet.pm,v 1.11 2002-07-31 14:38:17 ivan Exp $ +# $Id: AuthorizeNet.pm,v 1.14 2002-08-16 06:53:28 ivan Exp $ use strict; use Carp; use Business::OnlinePayment; -use Net::SSLeay qw/make_form post_https/; +use Net::SSLeay qw/make_form post_https make_headers/; use Text::CSV_XS; use vars qw($VERSION @ISA @EXPORT @EXPORT_OK); @@ -49,6 +49,10 @@ sub map_fields { $content{'type'} = $types{lc($content{'type'})} || $content{'type'}; $self->transaction_type($content{'type'}); + $content{'referer'} = defined( $content{'referer'} ) + ? make_headers( 'Referer' => $content{'referer'} ) + : ""; + # stuff it back into %content $self->content(%content); } @@ -103,6 +107,7 @@ sub submit { company => 'x_Company', order_number => 'x_Trans_ID', cvv2 => 'x_Card_Code', + currency => 'x_Currency_Code', ); if($self->transaction_type() eq "ECHECK") { @@ -141,7 +146,8 @@ sub submit { my $s = $self->server(); my $p = $self->port(); my $t = $self->path(); - my($page,$server_response,%headers) = post_https($s,$p,$t,'',$pd); + my $r = $self->{_content}->{referer}; + my($page,$server_response,%headers) = post_https($s,$p,$t,$r,$pd); #escape NULL (binary 0x00) values $page =~ s/\x00/\^0/g; @@ -202,6 +208,7 @@ Business::OnlinePayment::AuthorizeNet - AuthorizeNet backend for Business::Onlin card_number => '4007000000027', expiration => '09/02', cvv2 => '1234', #optional + referer => 'http://valid.referer.url/', ); $tx->submit(); @@ -231,6 +238,13 @@ Unlike Business::OnlinePayment or pre-3.0 verisons of Business::OnlinePayment::AuthorizeNet, 3.1 requires separate first_name and last_name fields. +Business::OnlinePayment::AuthorizeNet uses the ADC direct response method, +and sends a username and password with every transaction. Therefore, +Authorize.Net's referrer "security" is not necessary. In your Authorize.Net +interface at https://secure.authorize.net/ make sure the list of allowable +referers is blank. Alternatively, set the B field in the transaction +content. + To settle an authorization-only transaction (where you set action to 'Authorization Only'), submit the nine-digit transaction id code in the field "order_number" with the action set to "Post Authorization". @@ -263,6 +277,10 @@ Jason Spence contributed support for separate Authorization Only and Post Authorization steps and wrote some docs. OST paid for it. +T.J. Mather sent a patch for the CVV2 field. + +Mike Barry sent in a patch for the referer field. + =head1 SEE ALSO perl(1). L.