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
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;
$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
}
sub tokenized {
my $self = shift;
my $payinfo = scalar(@_) ? shift : $self->payinfo;
+ return 0 unless $payinfo; #avoid uninitialized value error
$payinfo =~ /^99\d{14}$/;
}