successful spelling, RT#74993
[freeside.git] / httemplate / misc / process / payment.cgi
index 74ca734..717d57c 100644 (file)
@@ -129,13 +129,13 @@ if ( (my $custpaybynum = scalar($cgi->param('custpaybynum'))) > 0 ) {
     $payinfo = $cgi->param('payinfo');
 
     $payinfo =~ s/\D//g;
-    $payinfo =~ /^(\d{13,16}|\d{8,9})$/
+    $payinfo =~ /^(\d{13,19}|\d{8,9})$/
       or errorpage(gettext('invalid_card'));
     $payinfo = $1;
     validate($payinfo)
       or errorpage(gettext('invalid_card'));
 
-    unless ( $payinfo =~ /^99\d{14}$/ ) { #token
+    unless ( $cust_main->tokenized($payinfo) ) { #token
 
       my $cardtype = cardtype($payinfo);
 
@@ -193,6 +193,11 @@ if ( (my $custpaybynum = scalar($cgi->param('custpaybynum'))) > 0 ) {
 
     errorpage("error saving info, payment not processed: $error")
       if $error;       
+
+  } elsif ( $payby eq 'CARD' ) { # not saving
+
+    $paymask = FS::payinfo_Mixin->mask_payinfo('CARD',$payinfo); # for untokenized but tokenizable payinfo
+
   }
 
 }
@@ -251,7 +256,7 @@ if ( $cgi->param('batch') ) {
 
     #and generate an invoice for it now too
     $error = $cust_main->bill( 'pkg_list' => [ $cust_pkg ] );
-    errorpage("payment processed and fee ordered sucessfully, but error billing fee: $error")
+    errorpage("payment processed and fee ordered successfully, but error billing fee: $error")
       if $error;
 
   }