X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fagent.pm;h=3794d3f1dc26daf1bfd0b1aafd2a8c357721a444;hp=28d191a153da3fc76f4f07a147a46427ceab126c;hb=da86d5a8af2f915a340a74f6c97772451a1e23ef;hpb=e4a707839edd433eac3f766c6106e06842d7428e diff --git a/FS/FS/agent.pm b/FS/FS/agent.pm index 28d191a15..3794d3f1d 100644 --- a/FS/FS/agent.pm +++ b/FS/FS/agent.pm @@ -247,7 +247,7 @@ sub payment_gateway { #look for an agent gateway override first my $cardtype; - if ( $options{method} && $options{method} eq 'CC' ) { + if ( $options{method} && $options{method} eq 'CC' && $options{payinfo} ) { $cardtype = cardtype($options{payinfo}); } elsif ( $options{method} && $options{method} eq 'ECHECK' ) { $cardtype = 'ACH'; @@ -269,16 +269,20 @@ sub payment_gateway { cardtype => '', taxclass => '', } ); - my $payment_gateway = new FS::payment_gateway; + my $payment_gateway; + my $conf = new FS::Conf; if ( $override ) { #use a payment gateway override $payment_gateway = $override->payment_gateway; + $payment_gateway->gateway_namespace('Business::OnlinePayment') + unless $payment_gateway->gateway_namespace; + } else { #use the standard settings from the config + # the standard settings from the config could be moved to a null agent # agent_payment_gateway referenced payment_gateway - my $conf = new FS::Conf; unless ( $conf->exists('business-onlinepayment') ) { if ( $options{'nofatal'} ) { return ''; @@ -302,6 +306,8 @@ sub payment_gateway { "did you set the business-onlinepayment configuration value?\n" unless $processor; + $payment_gateway = new FS::payment_gateway; + $payment_gateway->gateway_namespace( $conf->config('business-onlinepayment-namespace') || 'Business::OnlinePayment'); $payment_gateway->gateway_module($processor); @@ -312,6 +318,13 @@ sub payment_gateway { } + unless ( $payment_gateway->gateway_namespace ) { + $payment_gateway->gateway_namespace( + scalar($conf->config('business-onlinepayment-namespace')) + || 'Business::OnlinePayment' + ); + } + $payment_gateway; }