summaryrefslogtreecommitdiff
path: root/FS/FS/banned_pay.pm
diff options
context:
space:
mode:
authorJonathan Prykop <jonathan@freeside.biz>2017-01-03 17:33:26 -0600
committerJonathan Prykop <jonathan@freeside.biz>2017-01-03 17:33:26 -0600
commitb843454941061c79410d2b0efc8da5124e1021e2 (patch)
tree8b712407a6a3c0e9a70d9a26e2448a74a3120398 /FS/FS/banned_pay.pm
parentb76a31c1e13c4cfc7ce4b781641ab59ae87434f6 (diff)
71513: Card tokenization [banned_pay tweaks]
Diffstat (limited to 'FS/FS/banned_pay.pm')
-rw-r--r--FS/FS/banned_pay.pm10
1 files changed, 9 insertions, 1 deletions
diff --git a/FS/FS/banned_pay.pm b/FS/FS/banned_pay.pm
index 3d51bcd..0afff33 100644
--- a/FS/FS/banned_pay.pm
+++ b/FS/FS/banned_pay.pm
@@ -4,7 +4,7 @@ use base qw( FS::otaker_Mixin FS::Record );
use strict;
use Digest::MD5 qw(md5_base64);
use Digest::SHA qw( sha512_base64 );
-use FS::Record qw( qsearchs dbh );
+use FS::Record qw( qsearch qsearchs dbh );
use FS::CurrentUser;
=head1 NAME
@@ -169,6 +169,14 @@ sub ban_search {
# Used by FS::Upgrade to migrate to a new database.
sub _upgrade_data { # class method
my ($class, %opts) = @_;
+
+ die "Cannot upgrade md5 banned_pay entries"
+ if qsearch({
+ 'table' => 'banned_pay',
+ 'hashref' => {},
+ 'extra_sql' => "WHERE payinfo_hash IS NULL OR payinfo_hash = '' OR payinfo_hash = 'MD5'",
+ });
+
$class->_upgrade_otaker(%opts);
}