With regards to validating the security code, I think if this was possible it would almost defeat the purpose of the security case. I think the best that you could do it check the security code length. >From my limited knowledge on credit cards I believe that the standard in the digits long with Amex being four. I am probably missing some others though so I would not go just on this piece of information.
On Aug 13, 10:51 am, Wilhelm <[email protected]> wrote: > Hi Guys, > > thanks so much for your feedback it has been greatly helpful. > > Kind Regards > Wilhelm > > On Aug 13, 10:26 am, Jeremy Burns | Class Outfit > > <[email protected]> wrote: > > I let the card processing company do that - is there a way to do it locally > > before submitting? I'd be interested if there is a method for that. > > > Jeremy Burns > > Class Outfit > > > [email protected]http://www.classoutfit.com > > > On 13 Aug 2010, at 09:20, Louie Miranda wrote: > > > > How about validating proper security code? > > > -- > > > Louie Miranda > > > - Email: [email protected] > > > - Web:http://www.louiemiranda.com > > > > On Fri, Aug 13, 2010 at 4:08 PM, Jeremy Burns | Class Outfit > > > <[email protected]> wrote: > > > Yes, I already do this. Create /app/models/credit_card.php; > > > > <?php > > > class CreditCard extends AppModel { > > > > var $name = 'CreditCard'; > > > > var $useTable = false; > > > > var $validate = array( > > > 'card_number' => array( > > > 'notempty' => array( > > > 'rule' => 'notEmpty', > > > 'message' => 'Please enter a credit card > > > number.', > > > 'required' => true, > > > 'last' => true > > > ), > > > 'maxLength' => array( > > > 'rule' => array('maxLength', 20), > > > 'message' => 'The credit card number must > > > 20 characters or less.', > > > 'last' => true > > > ), > > > 'valid' => array( > > > 'rule' => array('cc', 'fast', false, null), > > > 'message' => 'The credit card number you > > > supplied was invalid.' > > > ) > > > ), > > > 'card_type' => array( > > > 'rule' => 'notEmpty', > > > 'message' => 'Please select a credit card type.', > > > 'required' => true > > > ), > > > 'exp_month' => array( > > > 'rule' => 'notEmpty', > > > 'message' => 'Please select a credit card expiry > > > month.', > > > 'required' => true > > > ), > > > 'exp_year' => array( > > > 'rule' => 'notEmpty', > > > 'message' => 'Please select a credit card expiry > > > year.', > > > 'required' => true > > > ), > > > 'cardid_number' => array( > > > 'rule' => 'notEmpty', > > > 'message' => 'Please enter a security code.', > > > 'required' => true > > > ) > > > ); > > > } > > > ?> > > > > Then at the right time in the order process: > > > > if (isset($this->data['CreditCard'])): > > > > $creditCard = ClassRegistry::init('CreditCard'); > > > > $creditCard->set( $this->data ); > > > > if ($creditCard->validates($this->data['CreditCard'])): > > > > $this->Session->write('creditCard', > > > array( > > > 'card_type' => > > > $this->data['CreditCard']['card_type'], > > > 'card_number' => > > > $this->data['CreditCard']['card_number'], > > > 'exp_month' => > > > $this->data['CreditCard']['exp_month'], > > > 'exp_year' => > > > $this->data['CreditCard']['exp_year'], > > > 'cardid_number' => > > > $this->data['CreditCard']['cardid_number'] > > > ) > > > ); > > > > else: > > > > $validationErrors['CreditCard'] = > > > $creditCard->validationErrors; > > > > endif; > > > > endif; > > > > Jeremy Burns > > > Class Outfit > > > > [email protected] > > >http://www.classoutfit.com > > > > On 13 Aug 2010, at 08:55, Wilhelm wrote: > > > > > Hi, > > > > > I am implementing a e-commerce website, in my project for security > > > > reasons I am not storing the users credit card details in the database > > > > but rather that is being handled by a third party. > > > > > My question is that I would like to use the cc validation to validate > > > > the credit card number before sending it off to the third party. Is > > > > this possible? > > > > > Kind Regards > > > > Wilhelm > > > > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp others > > > > with their CakePHP related questions. > > > > > You received this message because you are subscribed to the Google > > > > Groups "CakePHP" group. > > > > To post to this group, send email to [email protected] > > > > To unsubscribe from this group, send email to > > > > [email protected] For more options, visit this > > > > group athttp://groups.google.com/group/cake-php?hl=en > > > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp others > > > with their CakePHP related questions. > > > > You received this message because you are subscribed to the Google Groups > > > "CakePHP" group. > > > To post to this group, send email to [email protected] > > > To unsubscribe from this group, send email to > > > [email protected] For more options, visit this group > > > athttp://groups.google.com/group/cake-php?hl=en > > > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp others > > > with their CakePHP related questions. > > > > You received this message because you are subscribed to the Google Groups > > > "CakePHP" group. > > > To post to this group, send email to [email protected] > > > To unsubscribe from this group, send email to > > > [email protected] For more options, visit this group > > > athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
