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

Advertisements

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


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: