X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=AuthorizeNet.pm;h=028b6d825c9da4f2c6b73328f96ccadd8a742cc8;hb=7b4ea762675c7c24fdce4e0139cb98ba5d2f35ca;hp=569d88dff8d0a7afd62cf2d8c00e3ed122be7b5e;hpb=1a21aa040d676e76c602ab256106b61dee0bf907;p=Business-OnlinePayment-AuthorizeNet.git diff --git a/AuthorizeNet.pm b/AuthorizeNet.pm index 569d88d..028b6d8 100644 --- a/AuthorizeNet.pm +++ b/AuthorizeNet.pm @@ -1,8 +1,9 @@ package Business::OnlinePayment::AuthorizeNet; -# $Id: AuthorizeNet.pm,v 1.9 2002-04-24 02:39:38 ivan Exp $ +# $Id: AuthorizeNet.pm,v 1.11 2002-07-31 14:38:17 ivan Exp $ use strict; +use Carp; use Business::OnlinePayment; use Net::SSLeay qw/make_form post_https/; use Text::CSV_XS; @@ -13,7 +14,7 @@ require Exporter; @ISA = qw(Exporter AutoLoader Business::OnlinePayment); @EXPORT = qw(); @EXPORT_OK = qw(); -$VERSION = '3.11'; +$VERSION = '3.12'; sub set_defaults { my $self = shift; @@ -101,6 +102,7 @@ sub submit { email => 'x_Email', company => 'x_Company', order_number => 'x_Trans_ID', + cvv2 => 'x_Card_Code', ); if($self->transaction_type() eq "ECHECK") { @@ -128,7 +130,8 @@ sub submit { x_Last_Name x_First_Name x_Address x_City x_State x_Zip x_Country x_Phone x_Fax x_Email x_Email_Customer - x_Company x_Country x_Trans_ID/); + x_Company x_Country x_Trans_ID + x_Card_Code /); $post_data{'x_Test_Request'} = $self->test_transaction()?"TRUE":"FALSE"; $post_data{'x_ADC_Delim_Data'} = 'TRUE'; $post_data{'x_ADC_URL'} = 'FALSE'; @@ -139,6 +142,8 @@ sub submit { my $p = $self->port(); my $t = $self->path(); my($page,$server_response,%headers) = post_https($s,$p,$t,'',$pd); + #escape NULL (binary 0x00) values + $page =~ s/\x00/\^0/g; my $csv = new Text::CSV_XS(); $csv->parse($page); @@ -155,7 +160,7 @@ sub submit { $self->result_code($col[2]); $self->error_message($col[3]); unless ( $self->result_code() ) { #additional logging information - $page =~ s/\x00/\^0/g; + #$page =~ s/\x00/\^0/g; $self->error_message($col[3]. " DEBUG: No x_response_code from server, ". "(HTTPS response: $server_response) ". @@ -196,6 +201,7 @@ Business::OnlinePayment::AuthorizeNet - AuthorizeNet backend for Business::Onlin zip => '84058', card_number => '4007000000027', expiration => '09/02', + cvv2 => '1234', #optional ); $tx->submit();