summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2013-07-02 10:16:25 -0700
committerIvan Kohler <ivan@freeside.biz>2013-07-02 10:16:25 -0700
commitac3b5a577bcd664425b21c51ded61008e2fe8494 (patch)
treeb3f470afab0082eb7377807484eb0b03639544b5
parente7ac4fa24474bd23d32226f8a4c170aee75a645d (diff)
B:OP:AuthorizeNet (and others?) account_name: send company name instead of first+last for business accounts, RT#23586
-rw-r--r--FS/FS/cust_main/Billing_Realtime.pm9
1 files changed, 7 insertions, 2 deletions
diff --git a/FS/FS/cust_main/Billing_Realtime.pm b/FS/FS/cust_main/Billing_Realtime.pm
index 1caa3e5af..6e89f71b8 100644
--- a/FS/FS/cust_main/Billing_Realtime.pm
+++ b/FS/FS/cust_main/Billing_Realtime.pm
@@ -507,8 +507,13 @@ sub realtime_bop {
(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'})