summaryrefslogtreecommitdiff
path: root/FS/FS/agent.pm
diff options
context:
space:
mode:
authorChristopher Burger <burgerc@freeside.biz>2018-04-12 14:08:26 -0400
committerChristopher Burger <burgerc@freeside.biz>2019-01-08 12:12:13 -0500
commitc540df7c42e28bc2919141419757041532cb1b67 (patch)
tree1e758bee0d2bce55a61c0925154e198b947f27fe /FS/FS/agent.pm
parent99a89d5e688a70208b961ff190c9d04747a0c0e0 (diff)
RT# 80175 - readded the ability for payment gateway overrides to have an option to be for just ACH
Conflicts: FS/FS/agent.pm
Diffstat (limited to 'FS/FS/agent.pm')
-rw-r--r--FS/FS/agent.pm12
1 files changed, 5 insertions, 7 deletions
diff --git a/FS/FS/agent.pm b/FS/FS/agent.pm
index 8aff96a..bf389de 100644
--- a/FS/FS/agent.pm
+++ b/FS/FS/agent.pm
@@ -294,15 +294,13 @@ sub payment_gateway {
}
}
- my $cardtype_search = "AND ( cardtype IS NULL OR cardtype <> 'ACH')";
- $cardtype_search = "AND ( cardtype IS NULL OR cardtype = 'ACH' )" if $options{method} eq 'ECHECK';
+ my $cardtype = '';
+ if ( $options{method} eq 'ECHECK' ) { $cardtype = 'ACH'; }
my $override =
- qsearchs({
- "table" => 'agent_payment_gateway',
- "hashref" => { agentnum => $self->agentnum, },
- "extra_sql" => $cardtype_search,
- });
+ qsearchs('agent_payment_gateway', { agentnum => $self->agentnum,
+ cardtype => $cardtype, } )
+ || qsearchs('agent_payment_gateway', { agentnum => $self->agentnum } );
my $payment_gateway = FS::payment_gateway->by_key_or_default(
gatewaynum => $override ? $override->gatewaynum : '',