[freeside-commits] branch FREESIDE_4_BRANCH updated. 238d6ec0e724981f7142ec6eff8b39da9b2d02fb
Ivan
ivan at 420.am
Wed Feb 1 09:31:02 PST 2017
The branch, FREESIDE_4_BRANCH has been updated
via 238d6ec0e724981f7142ec6eff8b39da9b2d02fb (commit)
from b7eced75ed18c5cf4ef3f120295ec74b5a19218d (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 238d6ec0e724981f7142ec6eff8b39da9b2d02fb
Author: Ivan Kohler <ivan at freeside.biz>
Date: Wed Feb 1 09:31:02 2017 -0800
fix upgrades so they don't try to tokenize non-cards, RT#71513
diff --git a/FS/FS/cust_main/Billing_Realtime.pm b/FS/FS/cust_main/Billing_Realtime.pm
index 8b1a60a..ab2e39c 100644
--- a/FS/FS/cust_main/Billing_Realtime.pm
+++ b/FS/FS/cust_main/Billing_Realtime.pm
@@ -2462,7 +2462,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
}
@@ -2563,7 +2563,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
}
@@ -2705,7 +2705,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) {
-----------------------------------------------------------------------
Summary of changes:
FS/FS/cust_main/Billing_Realtime.pm | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
More information about the freeside-commits
mailing list