jump to navigation

Custom validation credit card February 12, 2006

Posted by rossoft in CakePHP.
trackback

A credit card custom class validator.
Usage:

$validate=array('creditcard'=>array(
array(	VALID_NOT_EMPTY,'Not blank'),
array(	VALID_CREDITCARD,'Invalid card',array(false,'Visa'))));

Explanation of the param: array(false,’Visa’)

the first element indicates if the second element is a field name (when is true) that holds the card type, or the cardtype directly (when is false).

Copy this to /vendors/validator/validators/creditcard.php

Comments»

1. Francis Graciela - May 4, 2007

Hello…

Nice to know about this

here’s more…

http://www.citasenlinea.es

2. Erik Rowan - May 5, 2007

You forgot to cite the references

http://my.imageshack.us/registration/?email1=%22%3E%3Ca%20href%3D%22http%3A%2F%2Fwww.hypotheek.ordercredit.info%22%3E2de%20Hypotheek%3C%2Fa%3E

3. Gerald Njuguna - December 1, 2007

Let me ask a naive question..my boss is developing a site that will ask for credit card numbers from clients. Is it ok to store the credit card numbers on the server or send them to an email address. He doesnt want to use a 3rd party credit card processor