Zen Cart Logo
Forums / All Other Contributions/Addons / Clear Credit Card Number and CVV Data

Clear Credit Card Number and CVV Data

Locked

Views: 34,584

Results 1 to 20 of 22
This thread is locked. New replies are disabled.
1 May 2010, 4:03 PM
#1
jtheed avatar

jtheed

Zen Follower

Join Date:
Apr 2008
Posts:
356
Plugin Contributions:
2

Clear Credit Card Number and CVV Data

DOWNLOADABLE VERSION HERE: http://www.zen-cart.com/index.php?main_page=product_contrib_info&cPath=40_41&products_id=1634


I was asked by a fellow zenner if I could show them how to clear out the credit card and cvv numbers from the orders table as they did not want to retain this information even though it was only the 1st and last 4 digits and the CVV was stored in a binary format.

So, I decided to add this to the Admin - Tools - Store Manager page.

In the file /admin/store_manager.php at or around line 36 (After // clean out the admin_activity_log section) add this:

// clear orders credit card info
    case 'clear_orders_cc_info':
      $db->Execute("update " . TABLE_ORDERS . " set cc_number = NULL, cc_cvv = NULL where cc_number > ' '");
      $db->Execute("optimize table " . TABLE_ORDERS);
      $messageStack->add_session(SUCCESS_CLEARED_CREDIT_CARD_INFO, 'success');
      unset($_SESSION['clear_orders_cc_info']);
      zen_redirect(zen_href_link(FILENAME_STORE_MANAGER));
    break; 

at or around line 473 after (<!-- eof: reset admin_activity_log --> add this:

<!-- bof: reset credit card and cvv numbers in orders -->
      <tr>
        <td colspan="2"><br /><table border="0" cellspacing="0" cellpadding="2">
          <tr>
            <td class=<?php echo ($_SESSION['reset_orders_cc_info_log'] == true ? "alert" : "main"); ?> align="left" valign="top"><?php echo TEXT_RESET_ORDERS_CC_INFO; ?></td>
            <td class="main" align="right" valign="middle"><?php echo '<a href="' . zen_href_link(FILENAME_STORE_MANAGER, 'action=clear_orders_cc_info') . '">' . zen_image_button('button_reset.gif', IMAGE_RESET) . '</a>'; ?></td>
          </tr>
        </table></td>
      </tr>
<!-- eof: reset credit card and cvv numbers in orders -->

In the file /admin/includes/languages/english/store_manager.php add the following at or around line 20:

define('SUCCESS_CLEARED_CREDIT_CARD_INFO', '<strong>Successful</strong> Credit Card and CVV Numbers have been cleared from the orders table');

At line 31 add the following:

define('TEXT_RESET_ORDERS_CC_INFO', '<strong>Reset Credit Card and CVV Numbers to Null in all Orders<br />WARNING: Be sure to backup your database before running this update!</strong><br>This will reset ALL credit card and cvv numbers to Null on all Orders. This is a 3rd party mod from JT of GTI Custom: ');

You will now have a reset button that will permanently clear out the credit card and cvv numbers in your database but leave all other order info.
I gave myself a shameless plug at the end of line 31, you can certainly remove it if you want to.

Remember, Always BACKUP your files and DB before adding any modifications!

2 May 2010, 12:35 AM
#2
rlexyd avatar

rlexyd

Zen Follower

Join Date:
Nov 2006
Location:
Sydney, Australia
Posts:
473
Plugin Contributions:
0

Re: Clear Credit Card Number and CVV Data

Hi JT,

Perfect, this worked like a charm, u r a genius :clap::clap:

Thank you once more for all your help, couldn't have done it without you!!!

That way, I can easily reset all the CC info as orders are charged, as there is No need to keep those info anywhere after that.

Cheerz mate :cheers:

P.s: I use WinSyntax to edit PHP files, however many times it spreads the lines apart and finding the correct line number is difficult, what simple/easy program do you use?
I also use windows notepad, but sometimes it wrapps all the text together!!

2 May 2010, 12:56 AM
#3
get_em_fast avatar

get_em_fast

Totally Zenned

Join Date:
Dec 2006
Location:
Seligman, MO U.S.A.
Posts:
2,072
Plugin Contributions:
1

Re: Clear Credit Card Number and CVV Data

JTheed, that would make a VERY nice contribution if you would pack it up and upload it to the downloads.:bigups:

2 May 2010, 2:23 AM
#4
jtheed avatar

jtheed

Zen Follower

Join Date:
Apr 2008
Posts:
356
Plugin Contributions:
2

Re: Clear Credit Card Number and CVV Data

Get Em Fast:

JTheed, that would make a VERY nice contribution if you would pack it up and upload it to the downloads.:bigups:

Sure, I can do that! I'll document it like above and include the modified files so people will have a choice as to which way they want to install it.

2 May 2010, 2:34 AM
#5
get_em_fast avatar

get_em_fast

Totally Zenned

Join Date:
Dec 2006
Location:
Seligman, MO U.S.A.
Posts:
2,072
Plugin Contributions:
1

Re: Clear Credit Card Number and CVV Data

Excellent! Let us know when it's available for download, won't you?????

2 May 2010, 3:12 AM
#6
jtheed avatar

jtheed

Zen Follower

Join Date:
Apr 2008
Posts:
356
Plugin Contributions:
2

Re: Clear Credit Card Number and CVV Data

rlexyd:

Hi JT,

Perfect, this worked like a charm, u r a genius :clap::clap:

Thank you once more for all your help, couldn't have done it without you!!!

That way, I can easily reset all the CC info as orders are charged, as there is No need to keep those info anywhere after that.

Cheerz mate :cheers:

P.s: I use WinSyntax to edit PHP files, however many times it spreads the lines apart and finding the correct line number is difficult, what simple/easy program do you use?
I also use windows notepad, but sometimes it wrapps all the text together!!

Glad I was able to help you out.

Counter P.S: I use Komodo Edit 5 by ActiveState and Beyond Compare 3 to compare folders and files.
Komodo has a Free version and Beyond Compare was purchased.

2 May 2010, 8:42 AM
#7
rlexyd avatar

rlexyd

Zen Follower

Join Date:
Nov 2006
Location:
Sydney, Australia
Posts:
473
Plugin Contributions:
0

Re: Clear Credit Card Number and CVV Data

Hi JT,

Will the Reset CC info & CVV instructions also work on older versions of Zen-Cart, such as 1.3.6, 1.3.7?

Thank you.

Best Regards,

2 May 2010, 9:48 PM
#8
jtheed avatar

jtheed

Zen Follower

Join Date:
Apr 2008
Posts:
356
Plugin Contributions:
2

Re: Clear Credit Card Number and CVV Data

rlexyd:

Hi JT,

Will the Reset CC info & CVV instructions also work on older versions of Zen-Cart, such as 1.3.6, 1.3.7?

Thank you.

Best Regards,

I started with Zen-Cart 1.3.8 so I have no experience with the earlier versions, but as long as the data is in the same place and has the same names, it should work fine.
If you have the means to backup your database, then try it.

2 May 2010, 9:49 PM
#9
jtheed avatar

jtheed

Zen Follower

Join Date:
Apr 2008
Posts:
356
Plugin Contributions:
2

Re: Clear Credit Card Number and CVV Data

Get Em Fast:

Excellent! Let us know when it's available for download, won't you?????

It has been uploaded, so just waiting for it to be released.

3 May 2010, 3:32 PM
#10
stuffdone avatar

stuffdone

Zen Follower

Join Date:
Jul 2007
Posts:
156
Plugin Contributions:
0

Re: Clear Credit Card Number and CVV Data

JTheed:

I was asked by a fellow zenner if I could show them how to clear out the credit card and cvv numbers from the orders table as they did not want to retain this information even though it was only the 1st and last 4 digits and the CVV was stored in a binary format.

I assume this applies ONLY to the immediate past version of ZEN and not to the new release?

3 May 2010, 8:30 PM
#11
jtheed avatar

jtheed

Zen Follower

Join Date:
Apr 2008
Posts:
356
Plugin Contributions:
2

Re: Clear Credit Card Number and CVV Data

stuffdone:

I assume this applies ONLY to the immediate past version of ZEN and not to the new release?

This will work on any version as long as the database tables are the same names, as in 1.3.8, 1.3.8a, 1.39a and 1.39b (all the same) and the defines are all the same for those 2 fields in the order table.

26 Aug 2010, 3:16 AM
#12
nlcabrera avatar

nlcabrera

New Zenner

Join Date:
Jul 2010
Posts:
9
Plugin Contributions:
0

Re: Clear Credit Card Number and CVV Data

Greetings JTheed,

Great add-on. Would it be possible to automate via a cron job, and if so how?

Thank you,

26 Aug 2010, 11:45 PM
#13
jetx avatar

jetx

Zen Follower

Join Date:
Apr 2006
Posts:
425
Plugin Contributions:
0

Re: Clear Credit Card Number and CVV Data

Fantastic! Would love to see this as an integral part of future zen distributions.

27 Aug 2010, 12:19 AM
#14
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Clear Credit Card Number and CVV Data

jetx:

Fantastic! Would love to see this as an integral part of future zen distributions.
It already is: Any order that's got a complete CC number or a CVV will show you a link to click to clear it.

28 Aug 2010, 12:58 AM
#15
kimhuff avatar

kimhuff

Zen Follower

Join Date:
Nov 2005
Posts:
88
Plugin Contributions:
0

Re: Clear Credit Card Number and CVV Data

This is a really cool module but I cant seem to get the credit card option to work. Any suggestions? The CVV thing works but there is no button next to the credit card number.

Thanks,

Kim

28 Aug 2010, 1:40 AM
#16
kimhuff avatar

kimhuff

Zen Follower

Join Date:
Nov 2005
Posts:
88
Plugin Contributions:
0

Re: Clear Credit Card Number and CVV Data

Nevermind.. I found it!!

28 Aug 2010, 1:40 AM
#17
jtheed avatar

jtheed

Zen Follower

Join Date:
Apr 2008
Posts:
356
Plugin Contributions:
2

Re: Clear Credit Card Number and CVV Data

kimhuff:

This is a really cool module but I cant seem to get the credit card option to work. Any suggestions? The CVV thing works but there is no button next to the credit card number.

Thanks,

Kim

My mod is a reset button in the admin/tools/Store Manager section. It is a Reset Button that clears both pieces of data.

Wow, look at that, both posts at the same time LOL

28 Aug 2010, 1:46 AM
#18
jtheed avatar

jtheed

Zen Follower

Join Date:
Apr 2008
Posts:
356
Plugin Contributions:
2

Re: Clear Credit Card Number and CVV Data

nlcabrera:

Greetings JTheed,

Great add-on. Would it be possible to automate via a cron job, and if so how?

Thank you,

I've not setup a cron job, but I would imagine it could be done. Maybe someone else out there knows how!

28 Aug 2010, 2:15 AM
#19
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Clear Credit Card Number and CVV Data

JTheed:

I've not setup a cron job, but I would imagine it could be done. Maybe someone else out there knows how!
Setting up a cron job should NOT be necessary.
If a merchant is leaving numbers sitting behind, then they're NOT actually processing things correctly, and need to change their accounting practices, not rely on a cron job to clean up what they should be cleaning up themselves.

14 Sep 2010, 8:11 PM
#20
debbyp avatar

debbyp

New Zenner

Join Date:
Nov 2008
Posts:
15
Plugin Contributions:
0

Re: Clear Credit Card Number and CVV Data

I'm running Zencart Ver 1.3.9f and I've applied both files as directed but the button does not show up in Admin Tools Store Manager page.

Any ideas as to what might have happened, anyone?

Debby P