sonictrip.net Posted April 10, 2007 Posted April 10, 2007 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. Quote
sonictrip.net Posted April 11, 2007 Author Posted April 11, 2007 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? Quote
sonictrip.net Posted April 20, 2007 Author Posted April 20, 2007 (edited) 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 April 20, 2007 by sonictrip.net Quote
sonictrip.net Posted May 9, 2007 Author Posted May 9, 2007 (edited) 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 May 9, 2007 by sonictrip.net Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.