X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_main%2FBilling_Realtime.pm;h=8285cbfdf1f35b693cdfcc7f1054b4377f0ae3aa;hb=7a486dea647f735a9a1d0381443218ad6affe6e1;hp=1caa3e5af55f44ef52236b5c8f28fcde95a3062b;hpb=63973c641c4be00765fa27e55c57cc5b9aa4da19;p=freeside.git diff --git a/FS/FS/cust_main/Billing_Realtime.pm b/FS/FS/cust_main/Billing_Realtime.pm index 1caa3e5af..8285cbfdf 100644 --- a/FS/FS/cust_main/Billing_Realtime.pm +++ b/FS/FS/cust_main/Billing_Realtime.pm @@ -300,10 +300,6 @@ sub _bop_content { ? $options->{country} : $self->country; - #3.0 is a good a time as any to get rid of this... add a config to pass it - # if anyone still needs it - #$content{referer} = 'http://cleanwhisker.420.am/'; - $content{phone} = $self->daytime || $self->night; my $currency = $conf->exists('business-onlinepayment-currency') @@ -507,8 +503,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'}) @@ -1005,8 +1006,9 @@ sub _realtime_bop_result { } else { - my $perror = $payment_gateway->gateway_module. " error: ". - $transaction->error_message; + my $perror = $transaction->error_message; + #$payment_gateway->gateway_module. " error: ". + # removed for conciseness my $jobnum = $cust_pay_pending->jobnum; if ( $jobnum ) { @@ -1104,7 +1106,11 @@ sub _realtime_bop_result { } $cust_pay_pending->status('done'); - $cust_pay_pending->statustext("declined: $perror"); + $cust_pay_pending->statustext($perror); + #'declined:': no, that's failure_status + if ( $transaction->can('failure_status') ) { + $cust_pay_pending->failure_status( $transaction->failure_status ); + } my $cpp_done_err = $cust_pay_pending->replace; if ( $cpp_done_err ) { my $e = "WARNING: $options{method} declined but pending payment not ". @@ -1222,11 +1228,6 @@ sub realtime_botpp_capture { 'amount' => $cust_pay_pending->paid, #'invoice_number' => $options{'invnum'}, 'customer_id' => $self->custnum, - - #3.0 is a good a time as any to get rid of this... add a config to pass it - # if anyone still needs it - #'referer' => 'http://cleanwhisker.420.am/', - 'reference' => $cust_pay_pending->paypendingnum, 'email' => $email, 'phone' => $self->daytime || $self->night, @@ -1436,10 +1437,6 @@ sub realtime_refund_bop { 'password' => $password, 'order_number' => $order_number, 'amount' => $amount, - - #3.0 is a good a time as any to get rid of this... add a config to pass it - # if anyone still needs it - #'referer' => 'http://cleanwhisker.420.am/', ); $content{authorization} = $auth if length($auth); #echeck/ACH transactions have an order # but no auth