#42638: Update URLs for B::OP AuthorizeNet
[Business-OnlinePayment-AuthorizeNet.git] / AuthorizeNet / ARB.pm
index 294114b..43910a0 100644 (file)
@@ -17,7 +17,7 @@ $me='Business::OnlinePayment::AuthorizeNet::ARB';
 sub set_defaults {
     my $self = shift;
 
-    $self->server('api.authorize.net') unless $self->server;
+    $self->server('api2.authorize.net') unless $self->server;
     $self->port('443') unless $self->port;
     $self->path('/xml/v1/request.api') unless $self->path;
 
@@ -39,7 +39,7 @@ sub map_fields {
                    'cancel recurring authorization'
                       => 'ARBCancelSubscriptionRequest',
                   );
-    $content{'action'} = $actions{lc($content{'action'})} || $content{'action'};
+    $content{'action'} = $actions{lc($content{'action'} || '')} || $content{'action'};
 
     # TYPE MAP
     my %types = ('visa'               => 'CC',
@@ -48,7 +48,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
@@ -57,7 +57,7 @@ sub map_fields {
                          'business checking'   => 'businessChecking',
                          'business savings'    => 'savings',
                         );
-    $content{'account_type'} = $account_types{lc($content{'account_type'})}
+    $content{'account_type'} = $account_types{lc($content{'account_type'} || '')}
                                || $content{'account_type'};
 
     # MASSAGE EXPIRATION