summaryrefslogtreecommitdiff
path: root/FS/FS/agent.pm
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2013-04-25 14:45:49 -0700
committerMark Wells <mark@freeside.biz>2013-04-25 14:46:10 -0700
commita1a0800de7c69fe5ee414b79e408ceacd4a1c2c3 (patch)
tree92589a379a7bd3925139779ad0b0d5cd55df6152 /FS/FS/agent.pm
parentf3e0ac2b009c4edd5692cb587ff709dac2223ebe (diff)
changes to support PayPal, #22395
Diffstat (limited to 'FS/FS/agent.pm')
-rw-r--r--FS/FS/agent.pm20
1 files changed, 12 insertions, 8 deletions
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<method> and I<payinfo> 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<method> is 'CC' then the card number in I<payinfo> 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 =