summaryrefslogtreecommitdiff
path: root/FS/FS/agent.pm
diff options
context:
space:
mode:
authorivan <ivan>2009-06-25 19:47:48 +0000
committerivan <ivan>2009-06-25 19:47:48 +0000
commite4a707839edd433eac3f766c6106e06842d7428e (patch)
treee182ac8bcbd9c01f62d9c9958b1aaa15bd20d39e /FS/FS/agent.pm
parent68bd008fa291965cf720e6cc578f98de063e02f2 (diff)
fix signups for the no-gateway-at-all case, RT#5673
Diffstat (limited to 'FS/FS/agent.pm')
-rw-r--r--FS/FS/agent.pm14
1 files changed, 11 insertions, 3 deletions
diff --git a/FS/FS/agent.pm b/FS/FS/agent.pm
index 5fbe2c4..28d191a 100644
--- a/FS/FS/agent.pm
+++ b/FS/FS/agent.pm
@@ -206,7 +206,10 @@ sub ticketing_queue {
Returns a payment gateway object (see L<FS::payment_gateway>) for this agent.
-Currently available options are I<invnum>, I<method>, and I<payinfo>.
+Currently available options are I<nofatal>, I<invnum>, I<method>, and I<payinfo>.
+
+If I<nofatal> is set, and no gateway is available, then the empty string
+will be returned instead of throwing a fatal exception.
If I<invnum> is set to the number of an invoice (see L<FS::cust_bill>) then
an attempt will be made to select a gateway suited for the taxes paid on
@@ -276,8 +279,13 @@ sub payment_gateway {
# agent_payment_gateway referenced payment_gateway
my $conf = new FS::Conf;
- die "Real-time processing not enabled\n"
- unless $conf->exists('business-onlinepayment');
+ unless ( $conf->exists('business-onlinepayment') ) {
+ if ( $options{'nofatal'} ) {
+ return '';
+ } else {
+ die "Real-time processing not enabled\n";
+ }
+ }
#load up config
my $bop_config = 'business-onlinepayment';