Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Realex Payments & Laser Cards


Recommended Posts

Hi all,

 

I have the Realex payment gateway setup and working on an osC store for Visa and Mastercard.

 

When i try to pay with a Laser card, i get the usual error:

 

The first four digits of the number entered are: 6304 If that number is correct, we do not accept that type of credit card. If it is wrong, please try again.

 

Realex supports Laser Cards so it should be accepting all numbers that begin with 6304 but before the order is even sent to the Realex servers, osC gives me that error code. Do i need to disable cc_validation or something? There wouldnt be a need for it on osC if Realex authorizes everything in realtime...

 

Is there anyone thats able to accept Laser Cards with the Realex system?

 

cheers.

Link to comment
Share on other sites

Ok, it seems we just need to rewrite the BIN range for Laser.

 

Here's the cc_validation for a few popular cards:

 

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

 

So, how do we rewrite one of the above ereg codes to support cards that begin with 6304 ?? Can someone explain in english what one of the above statments actually means?

Link to comment
Share on other sites

  • 2 weeks later...

Ok, i got some info from BOI and AIB about the BIN ranges for Laser cards but i still dont know how to write the proper php code to validate it.

 

BOI just told me that all their Laser cards begin with 630490

 

and AIB sent me a whole list of BIN's including the ones i think are Laser:

 

Laser AIB:

 

630490999999630490000000E016YYNW372ZTHE GOVERNOR AND COMPANY OF TH

630495199999630495100000E016YYNW372ZCLYDESDALE BANK PLC.

630495999999630495000000E011YYNW372ZCLYDESDALE BANK PLC.

630498999999630498000000E013YNNW372ZNATIONAL WESTMINSTER BANK PLC

630499999999630499000000E013YNNW372ZIRISH LIFE AND PERMANENT PLC

 

So, with the above information, is it possible to rewrite another cards code to reflect the number ranges above?:

 

if (ereg('^4[0-9]{12}([0-9]{3})?$', $this->cc_number)) {

$this->cc_type = 'Visa';

 

All Laser cards can have up to 19 numbers, if that can be included in the code as well somehow?

Edited by sonictrip.net
Link to comment
Share on other sites

  • 3 weeks later...

At last we have a SOLUTION to the Laser card problem:

 

This bit of text is in the Realex Zip file, only the version that i downloaded from the osCommerce site doesn't have the Laser card text file, so here it is:

 

 

If you wish to process lasercards you will need to add this bit of code to the cc_validation.php file in OS Commerce.

 

Look for file called cc_validation.php

 

 

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('^6', $this->cc_number)) {

$this->cc_type = 'LASER';

} elseif (ereg('^56, $', $this->cc_number)) {

$this->cc_type = 'LASER';

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

}

 

 

Im sure this will help a lot of Irish people! :thumbsup:

Edited by sonictrip.net
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...