cust_main.cgi and Credit Card Number Display

Stephen D. Bechard steve at destek.net
Thu Jun 27 09:05:42 PDT 2002


This recommendation comes from the Accounting Department. :)

Credit Cards are normally tracked and verified by the
last 4 digits of not the first 4, so they wanted to see
xxxxxxxxxxx8906 instead of 1234xxxxxxxxxxx

They also informed me that not all Credit Card numbers have the
same amount of digits, so I used the length of $payinfo to get
the start and end points of sbstr. Seems to work okay.

What do you think?

Here is the possible diff to change this:

--- /CVS/freeside/httemplate/view/cust_main.cgi    Thu Jun 27 11:30:52 2002
+++ /acpdocs/view/cust_main.cgi       Thu Jun 27 11:53:26 2002
@@ -206,7 +206,7 @@

   if ( $cust_main->payby eq 'CARD' ) {
     my $payinfo = $cust_main->payinfo;
-    $payinfo = substr($payinfo,0,4). 'x'x(length($payinfo)-4);
+    $payinfo = 'x'x(length($payinfo)-4).
substr($payinfo,(length($payinfo)-4),length($payinfo));

     print 'Credit card</TD></TR>',
           '<TR><TD ALIGN="right">Card number</TD><TD BGCOLOR="#ffffff">',

Thanks,
Steve




More information about the freeside-users mailing list