X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=FS%2FFS%2Fpayinfo_Mixin.pm;h=3a51022d3cbe2dc4313b4baaec3109b838e3546b;hb=9a8399783bb9d87ef662b4371bebe983d2781dce;hp=7a3dcf0e7b0a4fdb4a185a93a7d4d27ecb56b11a;hpb=d8844f49839b56eac11ee931f730d6e47f1ef628;p=freeside.git diff --git a/FS/FS/payinfo_Mixin.pm b/FS/FS/payinfo_Mixin.pm index 7a3dcf0e7..3a51022d3 100644 --- a/FS/FS/payinfo_Mixin.pm +++ b/FS/FS/payinfo_Mixin.pm @@ -8,7 +8,8 @@ use FS::UID qw(driver_name); use FS::Cursor; use Time::Local qw(timelocal); -use vars qw($ignore_masked_payinfo); +# allow_closed_replace only relevant to cust_pay/cust_refund, for upgrade tokenizing +use vars qw( $ignore_masked_payinfo $allow_closed_replace ); =head1 NAME @@ -194,8 +195,6 @@ sub payinfo_check { FS::payby->can_payby($self->table, $self->payby) or return "Illegal payby: ". $self->payby; - my $conf = new FS::Conf; - if ( $self->payby eq 'CARD' && ! $self->is_encrypted($self->payinfo) ) { my $payinfo = $self->payinfo; @@ -214,8 +213,6 @@ sub payinfo_check { $self->payinfo($1); validate($self->payinfo) or return "Illegal credit card number"; return "Unknown card type" if $cardtype eq "Unknown"; - return "Card number not tokenized" - if $conf->exists('no_saved_cardnumbers') && !$self->tokenized; } else { $self->payinfo('N/A'); #??? re-masks card } @@ -469,6 +466,7 @@ Optionally, an arbitrary payby and payinfo can be passed. sub tokenized { my $self = shift; my $payinfo = scalar(@_) ? shift : $self->payinfo; + return 0 unless $payinfo; #avoid uninitialized value error $payinfo =~ /^99\d{14}$/; }