unreverse the check for tokenized payinfo, #71291
authorMark Wells <mark@freeside.biz>
Tue, 19 Jul 2016 19:56:06 +0000 (12:56 -0700)
committerMark Wells <mark@freeside.biz>
Thu, 11 Aug 2016 22:34:05 +0000 (15:34 -0700)
FS/FS/cust_main.pm
FS/FS/payinfo_Mixin.pm

index bd46307..8e2fa19 100644 (file)
@@ -1967,7 +1967,7 @@ sub check {
       or return gettext('invalid_card'); # . ": ". $self->payinfo;
 
     my $cardtype = cardtype($payinfo);
-    $cardtype = 'Tokenized' if $self->payinfo !~ /^99\d{14}$/; # token
+    $cardtype = 'Tokenized' if $self->payinfo =~ /^99\d{14}$/; # token
 
     return gettext('unknown_card_type') if $cardtype eq 'Unknown';
 
index b02e98e..4da40e3 100644 (file)
@@ -201,7 +201,7 @@ sub payinfo_check {
 
     my $payinfo = $self->payinfo;
     my $cardtype = cardtype($payinfo);
-    $cardtype = 'Tokenized' if $payinfo !~ /^99\d{14}$/;
+    $cardtype = 'Tokenized' if $payinfo =~ /^99\d{14}$/;
     $self->set('paycardtype', $cardtype);
 
     if ( $ignore_masked_payinfo and $self->mask_payinfo eq $self->payinfo ) {