summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Prykop <jonathan@freeside.biz>2017-02-01 15:06:52 -0600
committerIvan Kohler <ivan@freeside.biz>2017-02-06 10:32:14 -0800
commit3994fafc85cc15e59f3eb5dda9015e651631f624 (patch)
tree2515c13278b902bfb75d02b2c89c1788a4a5f484
parent81666084b755dcc1a5850f4df4501f300f6b364c (diff)
71513: Card tokenization [bug fix to upgrade]
-rw-r--r--FS/FS/cust_main.pm3
1 files changed, 2 insertions, 1 deletions
diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm
index abf51fa2f..54f561309 100644
--- a/FS/FS/cust_main.pm
+++ b/FS/FS/cust_main.pm
@@ -5817,11 +5817,12 @@ sub _upgrade_next_recnum {
my $recnum = shift @$recnums;
return $recnum if $recnum;
my $tclass = 'FS::'.$table;
+ my $paycardtypecheck = ($table ne 'cust_pay_pending') ? q( OR paycardtype = 'Tokenized') : '';
my $sql = 'SELECT '.$tclass->primary_key.
' FROM '.$table.
' WHERE '.$tclass->primary_key.' > '.$$lastrecnum.
" AND payby IN ( 'CARD', 'DCRD', 'CHEK', 'DCHK' ) ".
- " AND ( length(payinfo) < 80 OR paycardtype = 'Tokenized' ) ".
+ " AND ( length(payinfo) < 80$paycardtypecheck ) ".
' ORDER BY '.$tclass->primary_key.' LIMIT 500';
my $sth = $dbh->prepare($sql) or die $dbh->errstr;
$sth->execute() or die $sth->errstr;