diff options
author | mark <mark> | 2010-08-24 03:03:09 +0000 |
---|---|---|
committer | mark <mark> | 2010-08-24 03:03:09 +0000 |
commit | 8ad28f5361b81fe97654f4b8df8539ff1d2be189 (patch) | |
tree | dfe0843f775a4c153c5b9767a54de0437135e6cf /FS | |
parent | f0bb712b44ff110ce3441a32a5226837d34738fe (diff) |
delete CVV when processing batch results, RT#9652
Diffstat (limited to 'FS')
-rw-r--r-- | FS/FS/pay_batch.pm | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/FS/FS/pay_batch.pm b/FS/FS/pay_batch.pm index 0b8c9f79b..2561d3dc4 100644 --- a/FS/FS/pay_batch.pm +++ b/FS/FS/pay_batch.pm @@ -7,6 +7,7 @@ use Text::CSV_XS; use FS::Record qw( dbh qsearch qsearchs ); use FS::cust_pay; use FS::Conf; +use Business::CreditCard qw(cardtype); @ISA = qw(FS::Record); @@ -198,6 +199,8 @@ sub import_results { my $job = $param->{'job'}; $job->update_statustext(0) if $job; + my $conf = new FS::Conf; + my $filetype = $info->{'filetype'}; # CSV or fixed my @fields = @{ $info->{'fields'}}; my $formatre = $info->{'formatre'}; # for fixed @@ -356,6 +359,15 @@ sub import_results { return "error updating status of paybatchnum $hash{'paybatchnum'}: $error\n"; } + # purge CVV when the batch is processed + if ( $payby =~ /^(CARD|DCRD)$/ ) { + my $payinfo = $hash{'payinfo'} || $cust_pay_batch->payinfo; + if ( ! grep { $_ eq cardtype($payinfo) } + $conf->config('cvv-save') ) { + $new_cust_pay_batch->cust_main->remove_cvv; + } + } + if ( $new_cust_pay_batch->status =~ /Approved/i ) { my $cust_pay = new FS::cust_pay ( { |