Products     Magento Extension     PCI-Shopping-Carts     Templates       CRELoaded     WordPress Modules     osCommerce Modules       osCommerce Addons       osCommerce Features       osCommerce Management       Payment Modules     CRELoaded Modules       CRE Loaded Addons       CRE Loaded Features       CRE Loaded Management       Payment Modules       CRELoaded Services
Free Stuff
Customization
Templates
Compare Products
You have no items to compare.
Affiliate Info
Affiliate Program FAQ
Affiliate Log In
Recent Orders
Hot Keywords: Order Notification, Order Search, Coupon, Flash Board, Compare, Floating Message, Tracking, Moneris, RSS, Visitor Filter

  Credit Card numbers cleaner

The following osCommerce contribution is a free Opensource code originated from official osCommerce website and provided for your reference only, you may download the original contribution file(s) and install it on your own; or you may request a Paid Installation Service from Agents Of Power; Agents Of Power does the "AS IS" installation on your website, we do not guarantee it will work properly on your website. Extra Paid service is available for repairing the problem from the original contribution or from your website.
For those using the Credit Card Number Encryption contribution (http://addons.oscommerce.com/info/4359), you'll need to modify your code as follows:


Find the section of code in /catalog/admin/clean_cc_numbers.php:

while ($orders = tep_db_fetch_array($orders_query)) {
$newNum = 'XXXXXXXXXXXX';
$newNum .= substr($orders['cc_number'], strlen($orders['cc_number'])-4);
echo "<tr><td align='right'>".$orders['orders_id']."&nbsp;</td><td>".$newNum."</td><td>".substr($orders['date_purchased'],0,-8)."</td><td align='center'>".$orders['orders_status']."</td></tr>";
// Uncommenting the line below will ACTIVATE the script
//tep_db_query("update " . TABLE_ORDERS . " set cc_number='".$newNum."' where orders_id=".$orders['orders_id'].";");
}


And replace with:


while ($orders = tep_db_fetch_array($orders_query)) {
$newNum = 'XXXXXXXXXXXX';

// Credit Card Number Decryption
// check for encryption status and if credit card number exist decrypt
if ((USE_ENCRYPTION == true) && (tep_not_null($orders['cc_number'])) && (strlen($orders['cc_number']) > 19) ) {
$cc_new_value = md5_decrypt($orders['cc_number'], TEXT_ENCRYPTION_PW, $iv_len = 16);
} else {
$cc_new_value = $orders['cc_number'];
}

$newNum .= substr($cc_new_value, strlen($cc_new_value)-4);
echo "<tr><td align='right'>".$orders['orders_id']."&nbsp;</td><td>".$newNum."</td><td>".substr($orders['date_purchased'],0,-8)."</td><td align='center'>".$orders['orders_status']."</td></tr>";
// Uncommenting the line below will ACTIVATE the script
//tep_db_query("update " . TABLE_ORDERS . " set cc_number='".$newNum."' where orders_id=".$orders['orders_id'].";");
}

--------------------------------

Thanks. Great Contrib!

Other things I'd suggest others consider - on our site, we are contemplating
that across ALL orders. I cannot think of a use case where the cc number should be cleansed
regardless of order status.

Also, I'd prefer if there was some way for this script to be automated (run once daily)

Attached File just contains what I have posted
- Now does not re-clean previously cleaned records. Slightly more processing for less database access.
- Output is now a table for better readability.

Please be aware that lines are commented out as a safety feature. You may remove the "//" after testing to ACTIVATE the script.
   Posted on: 11/11/2008     See contribution details Request Installation with Paid service