View Single Post
  #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