#42638: Update URLs for B::OP AuthorizeNet
[Business-OnlinePayment-AuthorizeNet.git] / AuthorizeNet / AIM.pm
index 0039502..e7ecd56 100644 (file)
@@ -9,12 +9,12 @@ use Text::CSV_XS;
 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK);
 
 @ISA = qw(Business::OnlinePayment::AuthorizeNet Business::OnlinePayment::HTTPS);
-$VERSION = '3.22';
+$VERSION = '3.24';
 
 sub set_defaults {
     my $self = shift;
 
-    $self->server('secure.authorize.net') unless $self->server;
+    $self->server('secure2.authorize.net') unless $self->server;
     $self->port('443') unless $self->port;
     $self->path('/gateway/transact.dll') unless $self->path;
 
@@ -35,7 +35,7 @@ sub map_fields {
                    'post authorization'   => 'PRIOR_AUTH_CAPTURE',
                    'void'                 => 'VOID',
                   );
-    $content{'action'} = $actions{lc($content{'action'})} || $content{'action'};
+    $content{'action'} = $actions{lc($content{'action'} || '')} || $content{'action'};
 
     # TYPE MAP
     my %types = ('visa'               => 'CC',
@@ -44,7 +44,7 @@ sub map_fields {
                  'discover'           => 'CC',
                  'check'              => 'ECHECK',
                 );
-    $content{'type'} = $types{lc($content{'type'})} || $content{'type'};
+    $content{'type'} = $types{lc($content{'type'} || '')} || $content{'type'};
     $self->transaction_type($content{'type'});
 
     # ACCOUNT TYPE MAP
@@ -53,7 +53,7 @@ sub map_fields {
                          'business checking'   => 'CHECKING',
                          'business savings'    => 'SAVINGS',
                         );
-    $content{'account_type'} = $account_types{lc($content{'account_type'})}
+    $content{'account_type'} = $account_types{lc($content{'account_type'} || '')}
                                || $content{'account_type'};
 
     if (length $content{'password'} == 15) {
@@ -166,7 +166,10 @@ sub submit {
             length  $self->{_content}->{customer_org}
         ) {
           push @required_fields, qw( customer_org customer_ssn );
-        } else {
+        }
+        elsif ( defined $self->{_content}->{license_num} and
+                length  $self->{_content}->{license_num}
+        ) {
           push @required_fields, qw(license_num license_state license_dob);
         }
 
@@ -312,34 +315,6 @@ __END__
 
 Business::OnlinePayment::AuthorizeNet::AIM - AuthorizeNet AIM backend for Business::OnlinePayment
 
-=head1 AUTHOR
-
-Jason Kohles, jason@mediabang.com
-
-Ivan Kohler <ivan-authorizenet@420.am> updated it for Authorize.Net protocol
-3.0/3.1 and is the current maintainer.  Please send patches as unified diffs
-(diff -u).
-
-Jason Spence <jspence@lightconsulting.com> contributed support for separate
-Authorization Only and Post Authorization steps and wrote some docs.
-OST <services@ostel.com> paid for it.
-
-T.J. Mather <tjmather@maxmind.com> sent a number of CVV2 patches.
-
-Mike Barry <mbarry@cos.com> sent in a patch for the referer field.
-
-Yuri V. Mkrtumyan <yuramk@novosoft.ru> sent in a patch to add the void action.
-
-Paul Zimmer <AuthorizeNetpm@pzimmer.box.bepress.com> sent in a patch for
-card-less post authorizations.
-
-Daemmon Hughes <daemmon@daemmonhughes.com> sent in a patch for "transaction
-key" authentication as well support for the recurring_billing flag and the md5
-method that returns the MD5 hash which is returned by the gateway.
-
-Steve Simitzis contributed a patch for better compatibility with
-eProcessingNetwork's AuthorizeNet compatability mode.
-
 =head1 SEE ALSO
 
 perl(1). L<Business::OnlinePayment> L<Business::OnlinePayment::AuthorizeNet>.