livingst Posted February 28, 2005 Share Posted February 28, 2005 Can anyone tell me what file I have to modify for the credit card module to only except certain credit card types? Link to comment Share on other sites More sharing options...
kstans Posted March 1, 2005 Share Posted March 1, 2005 I'm needing to know how to do this as well. Thanks Link to comment Share on other sites More sharing options...
turandot88 Posted March 1, 2005 Share Posted March 1, 2005 An old post by someone: Go into the file /catalog/includes/classes/cc_validation.php and in change the first IF statement in the validate function. Remove the cards you do not want to take from the statement and add the one you would like that are not there. The statement you are looking for looks like this: CODE 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; } Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.