Trim the extra 'ip_addr="1.2.3.4"' added by eProcessingNetwork's AuthorizetNet compat...
[Business-OnlinePayment-AuthorizeNet.git] / AuthorizeNet.pm
index 12ae79b..54f1514 100644 (file)
@@ -9,10 +9,10 @@ use vars qw($VERSION @ISA @EXPORT @EXPORT_OK);
 
 require Exporter;
 
-@ISA = qw(Exporter AutoLoader Business::OnlinePayment);
+@ISA = qw(Exporter Business::OnlinePayment);
 @EXPORT = qw();
 @EXPORT_OK = qw();
-$VERSION = '3.16';
+$VERSION = '3.17';
 
 sub set_defaults {
     my $self = shift;
@@ -143,10 +143,12 @@ sub submit {
 
         push @required_fields, qw(
           amount routing_code account_number account_type bank_name
-          account_name account_type
+          account_name
         );
 
-        if ($self->{_content}->{customer_org} ne '') {
+        if (defined $self->{_content}->{customer_org} and
+            length  $self->{_content}->{customer_org}
+        ) {
           push @required_fields, qw( customer_org customer_ssn );
         } else {
           push @required_fields, qw(license_num license_state license_dob);
@@ -207,6 +209,9 @@ sub submit {
     #escape NULL (binary 0x00) values
     $page =~ s/\x00/\^0/g;
 
+    #trim 'ip_addr="1.2.3.4"' added by eProcessingNetwork Authorize.Net compat
+    $page =~ s/,ip_addr="[\d\.]+"$//;
+
     my $csv = new Text::CSV_XS({ 'binary'=>1 });
     $csv->parse($page);
     my @col = $csv->fields();
@@ -360,6 +365,22 @@ Content required: type, login, password|transaction_key, action, amount, first_n
 
 For detailed information see L<Business::OnlinePayment>.
 
+=head1 METHODS AND FUNCTIONS
+
+See L<Business::OnlinePayment> for the complete list. The following methods either override the methods in L<Business::OnlinePayment> or provide additional functions.
+
+=head2 result_code
+
+Returns the response reason code (this is different than the response code).
+
+=head2 error_message
+
+Returns the response reason text.
+
+=head2 server_response
+
+Returns the complete response from the server.
+
 =head1 NOTE
 
 Unlike Business::OnlinePayment or pre-3.0 verisons of