B:OP:AuthorizeNet (and others?) account_name: send company name instead of first...
authorIvan Kohler <ivan@freeside.biz>
Sun, 18 Aug 2013 05:37:46 +0000 (22:37 -0700)
committerIvan Kohler <ivan@freeside.biz>
Sun, 18 Aug 2013 05:37:46 +0000 (22:37 -0700)
FS/FS/cust_main/Billing_Realtime.pm

index 1caa3e5..6e89f71 100644 (file)
@@ -507,8 +507,13 @@ sub realtime_bop {
         (exists($options{'paytype'}) && $options{'paytype'})
           ? uc($options{'paytype'})
           : uc($self->getfield('paytype')) || 'PERSONAL CHECKING';
         (exists($options{'paytype'}) && $options{'paytype'})
           ? uc($options{'paytype'})
           : uc($self->getfield('paytype')) || 'PERSONAL CHECKING';
-      $content{account_name} = $self->getfield('first'). ' '.
-                               $self->getfield('last');
+
+      if ( $content{account_type} =~ /BUSINESS/i && $self->company ) {
+        $content{account_name} = $self->company;
+      } else {
+        $content{account_name} = $self->getfield('first'). ' '.
+                                 $self->getfield('last');
+      }
 
       $content{customer_org} = $self->company ? 'B' : 'I';
       $content{state_id}       = exists($options{'stateid'})
 
       $content{customer_org} = $self->company ? 'B' : 'I';
       $content{state_id}       = exists($options{'stateid'})