fix upgrades, fix bogus "Tokenized" paycardtype, RT#71513
authorIvan Kohler <ivan@freeside.biz>
Thu, 26 Jan 2017 01:31:46 +0000 (17:31 -0800)
committerIvan Kohler <ivan@freeside.biz>
Thu, 26 Jan 2017 01:31:46 +0000 (17:31 -0800)
FS/FS/cust_payby.pm

index 53608cf..36f90df 100644 (file)
@@ -356,8 +356,7 @@ sub check {
     validate($payinfo)
       or return gettext('invalid_card'); # . ": ". $self->payinfo;
 
     validate($payinfo)
       or return gettext('invalid_card'); # . ": ". $self->payinfo;
 
-    my $cardtype = cardtype($payinfo);
-    $cardtype = 'Tokenized' if $self->tokenized; #token
+    my $cardtype = $self->paycardtype || cardtype($payinfo);
     
     return gettext('unknown_card_type') if $cardtype eq "Unknown";
     
     
     return gettext('unknown_card_type') if $cardtype eq "Unknown";
     
@@ -547,7 +546,6 @@ sub check_payinfo_cardtype {
   $payinfo =~ s/\D//g;
 
   if ( $self->tokenized($payinfo) ) {
   $payinfo =~ s/\D//g;
 
   if ( $self->tokenized($payinfo) ) {
-    $self->set('paycardtype', 'Tokenized');
     return '';
   }
 
     return '';
   }