| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Obscuring CC numbers: XXXX-XXXX-XXXX-1234 | |||
![]() |
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
![]() 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 |
|||||||
#2
|
|||||||
|
|||||||
![]() 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 |
|||||||
|
|||
X-Cart forums © 2001-2020
|