diff options
author | ivan <ivan> | 2010-06-07 17:32:06 +0000 |
---|---|---|
committer | ivan <ivan> | 2010-06-07 17:32:06 +0000 |
commit | a77fb608130055ee1795fb6692acb0296ca69027 (patch) | |
tree | 0088c636a10bbac78dbbe70252e2da3e0af31496 | |
parent | 62d23e804c666adfde3cdfc906a55a5b1c261f39 (diff) |
fix agent payment gateway overrides not working in 2.1, RT#8695
-rw-r--r-- | FS/FS/agent.pm | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/FS/FS/agent.pm b/FS/FS/agent.pm index f17427517..d291ca070 100644 --- a/FS/FS/agent.pm +++ b/FS/FS/agent.pm @@ -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_name; + } 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; } |