projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
68bd008
)
fix signups for the no-gateway-at-all case, RT#5673
author
ivan
<ivan>
Thu, 25 Jun 2009 19:47:48 +0000
(19:47 +0000)
committer
ivan
<ivan>
Thu, 25 Jun 2009 19:47:48 +0000
(19:47 +0000)
FS/FS/ClientAPI/Signup.pm
patch
|
blob
|
history
FS/FS/agent.pm
patch
|
blob
|
history
diff --git
a/FS/FS/ClientAPI/Signup.pm
b/FS/FS/ClientAPI/Signup.pm
index
02aa580
..
d0ac419
100644
(file)
--- a/
FS/FS/ClientAPI/Signup.pm
+++ b/
FS/FS/ClientAPI/Signup.pm
@@
-286,11
+286,12
@@
sub signup_info {
foreach my $payby (@{$signup_info->{payby}}) {
warn "$me checking $payby payment fields\n" if $DEBUG > 1;
my $hide = 0;
foreach my $payby (@{$signup_info->{payby}}) {
warn "$me checking $payby payment fields\n" if $DEBUG > 1;
my $hide = 0;
- if (
FS::payby->realtime($payby)
) {
+ if (
FS::payby->realtime($payby)
) {
my $payment_gateway =
$agent->payment_gateway( 'method' => FS::payby->payby2bop($payby) );
my $payment_gateway =
$agent->payment_gateway( 'method' => FS::payby->payby2bop($payby) );
- if ($payment_gateway->gateway_namespace eq
- 'Business::OnlineThirdPartyPayment'
+ if ( $payment_gateway
+ && $payment_gateway->gateway_namespace
+ eq 'Business::OnlineThirdPartyPayment'
) {
warn "$me hiding $payby payment fields\n" if $DEBUG > 1;
$hide = 1;
) {
warn "$me hiding $payby payment fields\n" if $DEBUG > 1;
$hide = 1;
diff --git
a/FS/FS/agent.pm
b/FS/FS/agent.pm
index
5fbe2c4
..
28d191a
100644
(file)
--- 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.
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
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;
# 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';
#load up config
my $bop_config = 'business-onlinepayment';