Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Obscuring CC numbers: XXXX-XXXX-XXXX-1234

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 02-28-2007, 09:35 AM
 
mickie2000 mickie2000 is offline
 

Member
  
Join Date: Jul 2003
Location: Sacramento, CA
Posts: 10
 

Default Obscuring CC numbers: XXXX-XXXX-XXXX-1234

I need the credit card info in /mail/order_invoice.tpl to be obscured, bus show the last 4 digits.

To do this it seems I need a regular expression so i tried:
{php}
$order = $GLOBALS["smarty"]->_tpl_vars["order"];
$details = preg_replace("/Card number: [0-9]+([0-9]{4})(\r)?\n/Umi", "Card number: XXXXXXXXXXXX\\1\\2\n", $order["details"]);
echo $details;
{/php}

and *lots* of variations on that general idea.

Then i tried:

{$order.details|regex_replace:"Card number: [0-9]+([0-9])(\r?)\n":"Card number: XXXXXXXXXXXX\n"}

and *lots* of variations on that idea.

Fruitless. My problem is clearly somewhere else. Here is the strangest part: "Print Invoice" on the admin side worked perfectly using the first solution, but the admin notification emails did not display the details at all, even though they both come from order_invoice.tpl .


Does anyone have any ideas? Thanks in advance!!
__________________
Mike Linville
CRdeZign

Using X-Cart 4.0
Reply With Quote
  #2  
Old 02-28-2007, 09:44 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default Re: Obscuring CC numbers: XXXX-XXXX-XXXX-1234

Moving to Template Editing. I assume you are aware that credit card info should NOT be stored in the DB? Your call of course, but you are opening yourself up to a lot of liability.
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 03:48 PM.

   

 
X-Cart forums © 2001-2020