Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Remove Credit Cards Info from DB


Rayzak

Recommended Posts

Posted

Hi there, I just decided to erase all info from DB which contains CC info. I don't need any problems if someone will get them :)

 

What contribution to use- there is couple and I guess I need some advice

 

Thx. In advance

Posted

I read a lot of cont. and did not see any which will remove all CC numbers with one touch.

Do I have do clear all the orders one by one to clen numbers, or there is contribution which will remove them all?

Posted
I read a lot of cont. and did not see any which will remove all CC numbers with one touch.

Do I have do clear all the orders one by one to clen numbers, or there is contribution which will remove them all?

I know very little about SQL, but it seems like it would be real easy to run a query and delete the information in the credit card number field of the orders table. I don't know how to write a query for phpmyadmin. Maybe someone else knows one already or that this is not doable.

 

Tim

Posted

Yes, It would be nice to have a clearcc.php in the admin folder and run every evning or so, so all CC# would be cleaned...

  • 3 weeks later...
Posted

Can anyone can help to create right script? It would be really nise to have one file, and when you run it it will go trough all orders and delete cc info and replace them with something?

Posted
I know very little about SQL, but it seems like it would be real easy to run a query and delete the information in the credit card number field of the orders table. I don't know how to write a query for phpmyadmin. Maybe someone else knows one already or that this is not doable.

 

Tim

 

 

I use contribution clean_cc_numbers

Works fine.....Clears em ALL out.

 

"Clean Cc Numbers" shows up in Admin under Customers on the left side. Just click and it shows a button & then runs the script after you click again.

Thanks

 

Mike

Posted

Thank you man! I don't know how could I miss it! really good contribution, save a lot of nerves :)

  • 3 months later...
Posted
I use contribution clean_cc_numbers

Works fine.....Clears em ALL out.

 

"Clean Cc Numbers" shows up in Admin under Customers on the left side. Just click and it shows a button & then runs the script after you click again.

 

I tried this contrib (http://www.oscommerce.com/community/contributions,2777) but it doesn't seem to be working. Did you have to modify anything? Right now, I get the ERROR_EMPTY_LOG message "The orders log does not have credit card entries or is empty" even when there are entries that meet the orders_status criteria.

 

Maybe someone can take a quick peek at the code.

At the top, there is this line:

define('PENDING_STATUS_ID',1);

And then the relevant code is this:

<?php 
		  $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');
		 	if ($action == 'clean') {
				$orders_query = tep_db_query("select orders_id,cc_number,orders_status from " . TABLE_ORDERS . " where orders_status != ".PENDING_STATUS_ID." AND payment_method = 'cc'");
				if (tep_db_num_rows($orders_query)) {
					echo tep_db_num_rows($orders_query)." items updating ...";
					while ($orders = tep_db_fetch_array($orders_query)) {
						$newNum = 'xxxxxxxxxxxx';
						$newNum .= substr($orders['cc_number'], strlen($orders['cc_number'])-4); 
						echo $orders['orders_id']." \t ".$newNum."\t".$orders['orders_status']."\n";
						tep_db_query("update " . TABLE_ORDERS . " set cc_number='".$newNum."' where orders_id=".$orders['orders_id']);
					}
					echo "X<br>";

				} else {
					echo ERROR_EMPTY_LOG;
				}
			} else {
		?>

 

Thanks.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...