Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

Problem validating VISA credit cards with prefix 4333...


Recommended Posts

We've been using oscommerce for over 5 years, and recently we've been seeing abandoned carts because of customers not able to authorize cards with the prefix 4333...


In cc_validation.php we have the following lines:


 function validate($number, $expiry_m, $expiry_y, $cvv, $cr_card_type) {
  $this->cc_number = ereg_replace('[^0-9]', '', $number);

  if (ereg('^4[0-9]{12}([0-9]{3})?$', $this->cc_number)) {
	$this->cc_type = 'Visa';
  elseif (ereg('^5[0-9][0-9]{14}$', $this->cc_number)) {
	$this->cc_type = 'Mastercard';


From this it looks like all VISA cards with the first four numbers being either 0-9 should authorize.


Why are these cards being rejected?

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...