Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How to prevent people from using AMEX or Discover?


thenetwerx

Recommended Posts

Posted

in catalog/includes/classes/cc_validation.php look for:

if (ereg('^4[0-9]{12}([0-9]{3})?$', $this->cc_number)) {
$this->cc_type = 'Visa';
} elseif (ereg('^5[1-5][0-9]{14}$', $this->cc_number)) {
$this->cc_type = 'Master Card';
} elseif (ereg('^3[47][0-9]{13}$', $this->cc_number)) {
$this->cc_type = 'American Express';
} elseif (ereg('^3(0[0-5]|[68][0-9])[0-9]{11}$', $this->cc_number)) {
$this->cc_type = 'Diners Club';
} elseif (ereg('^6011[0-9]{12}$', $this->cc_number)) {
$this->cc_type = 'Discover';
} elseif (ereg('^(3[0-9]{4}|2131|1800)[0-9]{11}$', $this->cc_number)) {
$this->cc_type = 'JCB';
} elseif (ereg('^5610[0-9]{12}$', $this->cc_number)) {
$this->cc_type = 'Australian BankCard';
} else {
return -1;
}

and replace with:

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

Posted
in catalog/includes/classes/cc_validation.php look for:
if (ereg('^4[0-9]{12}([0-9]{3})?$', $this->cc_number)) {
$this->cc_type = 'Visa';
} elseif (ereg('^5[1-5][0-9]{14}$', $this->cc_number)) {
$this->cc_type = 'Master Card';
} elseif (ereg('^3[47][0-9]{13}$', $this->cc_number)) {
$this->cc_type = 'American Express';
} elseif (ereg('^3(0[0-5]|[68][0-9])[0-9]{11}$', $this->cc_number)) {
$this->cc_type = 'Diners Club';
} elseif (ereg('^6011[0-9]{12}$', $this->cc_number)) {
$this->cc_type = 'Discover';
} elseif (ereg('^(3[0-9]{4}|2131|1800)[0-9]{11}$', $this->cc_number)) {
$this->cc_type = 'JCB';
} elseif (ereg('^5610[0-9]{12}$', $this->cc_number)) {
$this->cc_type = 'Australian BankCard';
} else {
return -1;
}

and replace with:

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

 

Thanks!!

Archived

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

×
×
  • Create New...