X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Obscuring CC numbers: XXXX-XXXX-XXXX-1234 (https://forum.x-cart.com/showthread.php?t=29249)

mickie2000 02-28-2007 09:35 AM

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!!

balinor 02-28-2007 09:44 AM

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.


All times are GMT -8. The time now is 07:06 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.