summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormark <mark>2010-08-24 01:59:31 +0000
committermark <mark>2010-08-24 01:59:31 +0000
commitb48548f7e5fb15aacc0040ae0557d05b87fecfb2 (patch)
tree7aeb3093c2da220f745698f03157e966035e6b48
parent1f979608d9a16baa1c9d91e203d1b4d86b3f1276 (diff)
delete CVV when processing batch results, RT#9652
-rw-r--r--FS/FS/cust_main.pm3
-rw-r--r--FS/FS/pay_batch.pm10
2 files changed, 8 insertions, 5 deletions
diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm
index 355687820..2a31a5b44 100644
--- a/FS/FS/cust_main.pm
+++ b/FS/FS/cust_main.pm
@@ -4926,8 +4926,7 @@ sub realtime_bop {
#false laziness w/misc/process/payment.cgi - check both to make sure working
# correctly
- if ( defined $self->dbdef_table->column('paycvv')
- && length($self->paycvv)
+ if ( length($self->paycvv)
&& ! grep { $_ eq cardtype($options{payinfo}) } $conf->config('cvv-save')
) {
my $error = $self->remove_cvv;
diff --git a/FS/FS/pay_batch.pm b/FS/FS/pay_batch.pm
index 0b8c9f79b..9a0b235a9 100644
--- a/FS/FS/pay_batch.pm
+++ b/FS/FS/pay_batch.pm
@@ -356,6 +356,10 @@ sub import_results {
return "error updating status of paybatchnum $hash{'paybatchnum'}: $error\n";
}
+ # purge CVV when the batch is processed
+ $new_cust_pay_batch->cust_main->remove_cvv
+ if ( $payby eq 'CARD' or $payby eq 'DCRD' );
+
if ( $new_cust_pay_batch->status =~ /Approved/i ) {
my $cust_pay = new FS::cust_pay ( {
@@ -402,11 +406,11 @@ sub import_results {
return $error;
}
- }
+ } # foreach $cust_event
- }
+ } # if(status eq 'Approved')
- }
+ } # foreach(@all_values)
$dbh->commit or die $dbh->errstr if $oldAutoCommit;
'';