From: Ivan Kohler Date: Wed, 1 Feb 2017 20:16:21 +0000 (-0800) Subject: only tokenize cards X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=2ebfd5c5a550befcd4546edeed8de8300e0c59d2 only tokenize cards --- diff --git a/FS/FS/cust_main/Billing_Realtime.pm b/FS/FS/cust_main/Billing_Realtime.pm index d96b8ba99..f089059aa 100644 --- a/FS/FS/cust_main/Billing_Realtime.pm +++ b/FS/FS/cust_main/Billing_Realtime.pm @@ -2463,7 +2463,7 @@ CUSTLOOP: } if ($require_tokenized && $opt{'daily'}) { - $log->critical("Untokenized card number detected in cust_payby ".$cust_payby->custpaybynum); + $log->info("Untokenized card number detected in cust_payby ".$cust_payby->custpaybynum. '; tokenizing'); $dbh->commit or die $dbh->errstr; # commit log message } @@ -2564,7 +2564,7 @@ CUSTLOOP: } if ($require_tokenized && $opt{'daily'}) { - $log->critical("Untokenized card number detected in $table ".$record->get($record->primary_key)); + $log->info("Untokenized card number detected in $table ".$record->get($record->primary_key). ';tokenizing'); $dbh->commit or die $dbh->errstr; # commit log message } @@ -2706,7 +2706,15 @@ sub _token_check_next_recnum { my $recnum = shift @$recnums; return $recnum if $recnum; my $tclass = 'FS::'.$table; - my $sth = $dbh->prepare('SELECT '.$tclass->primary_key.' FROM '.$table.' ORDER BY '.$tclass->primary_key.' LIMIT '.$step.' OFFSET '.$$offset) or die $dbh->errstr; + my $sth = $dbh->prepare( + 'SELECT '.$tclass->primary_key. + ' FROM '.$table. + " WHERE payby IN ( 'CARD', 'DCRD' ) ". + " AND ( length(payinfo) > 80 OR payinfo NOT LIKE '99%' )". + ' ORDER BY '.$tclass->primary_key. + ' LIMIT '.$step. + ' OFFSET '.$$offset + ) or die $dbh->errstr; $sth->execute() or die $sth->errstr; my @recnums; while (my $rec = $sth->fetchrow_hashref) {