[freeside-commits] freeside/FS/FS/ClientAPI MyAccount.pm, 1.71, 1.72

Ivan,,, ivan at wavetail.420.am
Tue Jul 1 19:55:52 PDT 2008


Update of /home/cvs/cvsroot/freeside/FS/FS/ClientAPI
In directory wavetail.420.am:/tmp/cvs-serv13425

Modified Files:
	MyAccount.pm 
Log Message:
fix errors paying with an on-file card through self-service

Index: MyAccount.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/ClientAPI/MyAccount.pm,v
retrieving revision 1.71
retrieving revision 1.72
diff -u -d -r1.71 -r1.72
--- MyAccount.pm	2 Jun 2008 17:06:09 -0000	1.71
+++ MyAccount.pm	2 Jul 2008 02:55:49 -0000	1.72
@@ -420,6 +420,7 @@
     or return { 'error' => "illegal_payby " . $p->{'payby'} };
   my $payby = $1;
 
+  #false laziness w/process/payment.cgi
   my $payinfo;
   my $paycvv = '';
   if ( $payby eq 'CHEK' || $payby eq 'DCHK' ) {
@@ -438,14 +439,15 @@
   } elsif ( $payby eq 'CARD' || $payby eq 'DCRD' ) {
    
     $payinfo = $p->{'payinfo'};
-    $payinfo =~ s/[^\dx]//g;
-    $payinfo =~ /^(\d{13,16})$/
-      or return { 'error' => gettext('invalid_card') }; # . ": ". $self->payinfo
-    $payinfo = $1;
 
     $payinfo = $cust_main->payinfo
       if $cust_main->paymask eq $payinfo;
 
+    $payinfo =~ s/\D//g;
+    $payinfo =~ /^(\d{13,16})$/
+      or return { 'error' => gettext('invalid_card') }; # . ": ". $self->payinfo
+    $payinfo = $1;
+
     validate($payinfo)
       or return { 'error' => gettext('invalid_card') }; # . ": ". $self->payinfo
     return { 'error' => gettext('unknown_card_type') }



More information about the freeside-commits mailing list