X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fagent.pm;h=9b322093b394eeab678433a7a6c5e1eeea6c1e15;hb=a1a0800de7c69fe5ee414b79e408ceacd4a1c2c3;hp=3794d3f1dc26daf1bfd0b1aafd2a8c357721a444;hpb=fb4ab1073f0d15d660c6cdc4e07afebf68ef3924;p=freeside.git diff --git a/FS/FS/agent.pm b/FS/FS/agent.pm index 3794d3f1d..9b322093b 100644 --- a/FS/FS/agent.pm +++ b/FS/FS/agent.pm @@ -216,7 +216,7 @@ an attempt will be made to select a gateway suited for the taxes paid on the invoice. The I and I options can be used to influence the choice -as well. Presently only 'CC' and 'ECHECK' methods are meaningful. +as well. Presently only 'CC', 'ECHECK', and 'PAYPAL' methods are meaningful. When the I is 'CC' then the card number in I can direct this routine to route to a gateway suited for that type of card. @@ -246,13 +246,17 @@ sub payment_gateway { } #look for an agent gateway override first - my $cardtype; - if ( $options{method} && $options{method} eq 'CC' && $options{payinfo} ) { - $cardtype = cardtype($options{payinfo}); - } elsif ( $options{method} && $options{method} eq 'ECHECK' ) { - $cardtype = 'ACH'; - } else { - $cardtype = $options{method} || ''; + my $cardtype = ''; + if ( $options{method} ) { + if ( $options{method} eq 'CC' && $options{payinfo} ) { + $cardtype = cardtype($options{payinfo}); + } elsif ( $options{method} eq 'ECHECK' ) { + $cardtype = 'ACH'; + } elsif ( $options{method} eq 'PAYPAL' ) { + $cardtype = 'PayPal'; + } else { + $cardtype = $options{method} + } } my $override =