Thanks Greg... we do take CC security very seriously.
So here is how we currently display the card info on the user profile
page:
In summary mode, we show "AMEX xxx-1234" or "VISA xxx-1234".
The questions is how to group the x's for display (in the cc number
input box) when the user goes to edit their payment info?
AMEX: xxxx-xxxxxx-1234
Visa: xxxx-xxxx-xxxx-1234 (same for mastercard and visa?) I understand
VISA numbers can be 13 digits, so in the case xxx-xxx-xxx-1234?
Minutia I know but trying to keep things looking familiar and logical
for end users...
Best, Roupen N.
On Jun 16, 10:20 am, "Greg Furmanek" <
greg.furma...@gmail.com> wrote:
> Hi Nahabed
>
> I am amazed however that such trivial problem causes consternation.
> I hope I am understanding your question correctly so I will try to restate
> with an example:
>
> 4123456700009191 => xxxxxxxxxxxx9191
> 372345600009191 => xxxxxxxxxxx9191
>
> Here is a solution that should work for all problem stated above.
> It substitutes everything except the last 4 digits with x.
> It probably could be refactored into nicer code but this works quite well
> by itself.
>
> def last_for(cc)
> cc.gsub(/(\d+)(\d{4})/, "\\1").gsub(/\d/, "x") + cc.gsub(/\d+(\d{4})/,
> "\\1")
> end
>
> I hope you understand the responsibility you take upon yourself when
> you store credit card numbers and you are designing the system to
> safeguard those numbers.
>
> - Greg
>