Use this routine if you are currently storing credit card numbers and ccv information in your database (you realy shouldn't, you know). It will work with plain numbers and if you have installed contrib 4359, Credit Card Number Encryption.It will replace all but the last four numbers with X's, counts the length so will work with all major cards. If you have ccv2 info, it will blank that field. When your customer views existing orders, they will see the last 4 digits of their card so they know which one they used.
Legend: 
Download

Report
Line 39 of admin/popup_zap_cc_info.php was causing problems with memory runout.
changed:
$newnum = substr($order['cc_number'], -4, $order['cc_number']);
to:
$newnum = substr($order['cc_number'], -4);
Update is included with package
Added function so that if you have already "zapped" the first 12 digits in the cc number before, the "Zap Card!" button does not appear.
In other words, it makes it so if you've already removed the card numbers you won't see the button or link.
Full Package.
OK, I added a "Close Window" html button instead of the js to make it look just a little nicer. this is only the popup_zap_cc_info file.
Not full package.
This is a great addon. All I did was clean up the formating of the popup a bit and in admin/orders.php as well. All props to the original author.
Full Package
Also check out the Credit Card encryption addon: http://addons.oscommerce.com/info/4359
Use this routine if you are currently storing credit card numbers and ccv information in your database (you realy shouldn't, you know). It will work with plain numbers and if you have installed contrib 4359, Credit Card Number Encryption.It will replace all but the last four numbers with X's, counts the length so will work with all major cards. If you have ccv2 info, it will blank that field. When your customer views existing orders, they will see the last 4 digits of their card so they know which one they used.