Returns a payment gateway object (see L<FS::payment_gateway>) for this agent.
-Currently available options are I<nofatal>, I<method>, I<thirdparty>,
-<conf> and I<load_gatewaynum>.
+Currently available options are I<nofatal>, I<method>, I<thirdparty> and I<conf>.
If I<nofatal> is set, and no gateway is available, then the empty string
will be returned instead of throwing a fatal exception.
}
}
- my $override = qsearchs('agent_payment_gateway', { agentnum => $self->agentnum } );
+ my $cardtype = '';
+ if ( $options{method} eq 'ECHECK' ) { $cardtype = 'ACH'; }
+
+ my $override =
+ 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 : '',