Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Credit Card Validation - Turning off


donalrafferty

Recommended Posts

Posted

I process credit cards manually in my shop. Can anyone tell me how to turn off osCommerce's automatic credit card validation?

 

Even with the updated card identifiers it still does not accept many Irish VISA and Mastercards.

Posted

You can change your credit card validation criteria in:

 

catalog/includes/classes/cc_validation.php

 

 

or you can try commenting out the line:

 

include(DIR_WS_CLASSES . 'cc_validation.php');

 

in includes/modules/payment/cc.php (not sure if this will work, you can try it :) )

Posted

I've just installed the Paypal website payments pro Contribution and it also uses the cc_validation.php file? Is this necessary?

 

Thanks for your help Jemlin. I know it's a matter of changing something in the cc_validation.php file - maybe to comment out the if loop containing the identifiers and replacing the return -1 with a return 1. I'm just a bit reluctant to go messing around with it.

 

Surely there must be someone who has disabled cc_validation already?

Posted

Surely someone must have disabled credit card validation already - or at least come up with better verifyers that work with more cards.

 

Vger, maybe you know?

Posted

includes/classes/cc_validation.php

 

Change from:

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

 

To:

 

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 {
       $this->cc_type = 'Credit/Debit Card';
     }

 

Rock and roll.

Posted

Hi Burt,

 

From what I can see here, this code will let anything through as just an unverified Credit/Debit Card if it doesn't pass Visa, Mastercard, etc. - which is exactly what I want!

 

Thank you SO much! You're a star.

Posted
From what I can see here, this code will let anything through as just an unverified Credit/Debit Card if it doesn't pass Visa, Mastercard, etc. - which is exactly what I want!

 

Exactly so. If those strings don't pick up the Card as a recognised card, it just goes as "Credit/Debit Card". Obviously you'd then need to be certain that the Card is valid before sending out the order to the Customer.

  • 3 months later...
Posted

I have tried to change the code as said over but i still get an error when inserting my card number of 16 characters.

I have tried another card and that works.

 

the two cards have diffiren numbers.

 

4925 5188 xxxx xxxx this one gets an error.

4025 0549 xxxx xxxx this goes thru

 

Does anyone nows why?

 

Regards

Thomas B

Archived

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

×
×
  • Create New...