diff options
author | Jonathan Prykop <jonathan@freeside.biz> | 2017-01-03 17:33:26 -0600 |
---|---|---|
committer | Jonathan Prykop <jonathan@freeside.biz> | 2017-01-03 21:20:32 -0600 |
commit | a1f5ae700fef217160ca7aca669ca37abb1f9b7f (patch) | |
tree | 90e92c6cb4884efe394e50f8a69170458008dd22 | |
parent | 4d79aed4700a31d339bef938e4b2490ff8f2b9ec (diff) |
71513: Card tokenization [banned_pay tweaks, v3 merge]
-rw-r--r-- | FS/FS/cust_main/Billing_Realtime.pm | 52 |
1 files changed, 21 insertions, 31 deletions
diff --git a/FS/FS/cust_main/Billing_Realtime.pm b/FS/FS/cust_main/Billing_Realtime.pm index a4622f5..3e7a5fb 100644 --- a/FS/FS/cust_main/Billing_Realtime.pm +++ b/FS/FS/cust_main/Billing_Realtime.pm @@ -364,7 +364,6 @@ sub realtime_bop { $options{amount} = $amount; } - ### # optional credit card surcharge ### @@ -403,6 +402,13 @@ sub realtime_bop { $self->_bop_defaults(\%options); + # check for banned credit card/ACH + my $ban = FS::banned_pay->ban_search( + 'payby' => $bop_method2payby{$options{method}}, + 'payinfo' => $options{payinfo}, + ); + return "Banned credit card" if $ban && $ban->bantype ne 'warn'; + # possibly run a separate transaction to tokenize card number, # so that we never store tokenized card info in cust_pay_pending if (($options{method} eq 'CC') && !$self->tokenized($options{'payinfo'})) { @@ -448,16 +454,6 @@ sub realtime_bop { die $@ if $@; ### - # check for banned credit card/ACH - ### - - my $ban = FS::banned_pay->ban_search( - 'payby' => $bop_method2payby{$options{method}}, - 'payinfo' => $options{payinfo}, - ); - return "Banned credit card" if $ban && $ban->bantype ne 'warn'; - - ### # check for term discount validity ### @@ -1801,6 +1797,13 @@ sub realtime_verify_bop { warn " $_ => $options{$_}\n" foreach keys %options; } + # check for banned credit card/ACH + my $ban = FS::banned_pay->ban_search( + 'payby' => $bop_method2payby{'CC'}, + 'payinfo' => $options{payinfo}, + ); + return "Banned credit card" if $ban && $ban->bantype ne 'warn'; + # possibly run a separate transaction to tokenize card number, # so that we never store tokenized card info in cust_pay_pending if (($options{method} eq 'CC') && !$self->tokenized($options{'payinfo'})) { @@ -1821,16 +1824,6 @@ sub realtime_verify_bop { die $@ if $@; ### - # check for banned credit card/ACH - ### - - my $ban = FS::banned_pay->ban_search( - 'payby' => $bop_method2payby{'CC'}, - 'payinfo' => $options{payinfo} || $self->payinfo, - ); - return "Banned credit card" if $ban && $ban->bantype ne 'warn'; - - ### # massage data ### @@ -2257,6 +2250,13 @@ sub realtime_tokenize { return '' unless $options{method} eq 'CC'; return '' if FS::payinfo_Mixin->tokenized($options{payinfo}); #already tokenized + # check for banned credit card/ACH + my $ban = FS::banned_pay->ban_search( + 'payby' => $bop_method2payby{'CC'}, + 'payinfo' => $options{payinfo}, + ); + return "Banned credit card" if $ban && $ban->bantype ne 'warn'; + ### # select a gateway ### @@ -2284,16 +2284,6 @@ sub realtime_tokenize { return '' unless $supported_actions{'CC'} and grep(/^Tokenize$/,@{$supported_actions{'CC'}}); ### - # check for banned credit card/ACH - ### - - my $ban = FS::banned_pay->ban_search( - 'payby' => $bop_method2payby{'CC'}, - 'payinfo' => $options{payinfo}, - ); - return "Banned credit card" if $ban && $ban->bantype ne 'warn'; - - ### # massage data ### |