Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Solo cards (UK) with Protx direct module


Charterhouse

Recommended Posts

Posted

Hi,

 

We are currently testing the protx direct payment module. All cards are working fine apart from solo cards (UK).

 

The error being display from protx confirms that the card number does not match the card type.

 

Our validation code is as follows:

 

class cc_validation {

var $cc_type, $cc_number, $cc_expiry_month, $cc_expiry_year;

 

function validate($number, $expiry_m, $expiry_y) {

$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[1-5][0-9]{14}$', $this->cc_number)) {

$this->cc_type = 'MC';

} elseif (ereg('^3[47][0-9]{13}$', $this->cc_number)) {

$this->cc_type = 'AMEX';

} 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';

} elseif (ereg('^49030[2-9]{1}([0-9]{10,13})?$', $this->cc_number)) {

$this->cc_type = 'Switch';

} elseif (ereg('^49033[5-9]{1}([0-9]{10,13})?$', $this->cc_number)) {

$this->cc_type = 'Switch';

} elseif (ereg('^49110[1-2]{1}([0-9]{10,13})?$', $this->cc_number)) {

$this->cc_type = 'Switch';

} elseif (ereg('^49117[4-9]{1}([0-9]{10,13})?$', $this->cc_number)) {

$this->cc_type = 'Switch';

} elseif (ereg('^49118[0-2]{1}([0-9]{10,13})?$', $this->cc_number)) {

$this->cc_type = 'Switch';

} elseif (ereg('^4936[0-9]{2}([0-9]{10,13})?$', $this->cc_number)) {

$this->cc_type = 'Switch';

} elseif (ereg('^564182([0-9]{10,13})?$', $this->cc_number)) {

$this->cc_type = 'Switch';

} elseif (ereg('^6333[0-4]{1}([0-9]{1})([0-9]{10,13})?$', $this->cc_number)) {

$this->cc_type = 'Switch';

} elseif (ereg('^6759[0-9]{2}([0-9]{10,13})?$', $this->cc_number)) {

$this->cc_type = 'Switch';

} elseif (ereg('^6767[0-9]{2}([0-9]{10,13})?$', $this->cc_number)) {

$this->cc_type = 'Switch';

} else {

return -1;

}

 

It would be fantastic if anybody could provide some updated code that works for solo cards. Our solo card starts with 6767 as the first four numbers. Oscommerce is treating this as a switch card. We are not sure what is the correct method of implementing this.

 

Kind Regards,

 

Charterhouse.

Archived

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

×
×
  • Create New...