hopefully the final fix for the problems using remembered cards in self-service
authorivan <ivan>
Wed, 30 Sep 2009 19:33:09 +0000 (19:33 +0000)
committerivan <ivan>
Wed, 30 Sep 2009 19:33:09 +0000 (19:33 +0000)
fs_selfservice/FS-SelfService/cgi/selfservice.cgi

index 7c5ad83..7071e6c 100644 (file)
@@ -361,7 +361,7 @@ sub make_payment {
 
 sub payment_results {
 
 
 sub payment_results {
 
-  use Business::CreditCard;
+  use Business::CreditCard 0.30;
 
   #we should only do basic checking here for DoS attacks and things
   #that couldn't be constructed by the web form...  let process_payment() do
 
   #we should only do basic checking here for DoS attacks and things
   #that couldn't be constructed by the web form...  let process_payment() do
@@ -372,8 +372,8 @@ sub payment_results {
   my $amount = $1;
 
   my $payinfo = $cgi->param('payinfo');
   my $amount = $1;
 
   my $payinfo = $cgi->param('payinfo');
-  $payinfo =~ s/\D//g;
-  $payinfo =~ /^(\d{13,16})$/
+  $payinfo =~ s/[^\dx]//g;
+  $payinfo =~ /^([\dx]{13,16})$/
     #or $error ||= $init_data->{msgcat}{invalid_card}; #. $self->payinfo;
     or die "illegal card"; #!!!
   $payinfo = $1;
     #or $error ||= $init_data->{msgcat}{invalid_card}; #. $self->payinfo;
     or die "illegal card"; #!!!
   $payinfo = $1;