ramiav Posted August 29, 2004 Share Posted August 29, 2004 hi all how do i turn off the credit card validation , im using the regular cc.php and i want whatever the customer type to go thru. does any1 can help me with that please? Quote Link to comment Share on other sites More sharing options...
Guest Posted September 19, 2004 Share Posted September 19, 2004 hi allhow do i turn off the credit card validation , im using the regular cc.php and i want whatever the customer type to go thru. does any1 can help me with that please? <{POST_SNAPBACK}> the same here.. PLEASE TELL US... Quote Link to comment Share on other sites More sharing options...
Guest Posted November 9, 2004 Share Posted November 9, 2004 the same here.. PLEASE TELL US... <{POST_SNAPBACK}> Again I am desperate to turn this of fully, I know we are lossing order through cards b eing declined I have tired a few things on the boards here but only found errors. Anyone any idea please! thanks Zebra Quote Link to comment Share on other sites More sharing options...
iwik Posted November 17, 2004 Share Posted November 17, 2004 In includes/classes/cc_validation.php, there is a long if-else statement that has many different types of cards on there that it uses to validate the type of card being used. You can easily add/remove cards as necessary, but I'm not sure about turning the whole thing off - you really accept every single type of credit card there is?? There's more information in this thread and to add more credit cards to the list check out this thread Quote Link to comment Share on other sites More sharing options...
Daemonj Posted November 19, 2004 Share Posted November 19, 2004 Edit catalog/includes/classes/cc_validation.php and around line 57 should read: return $this->is_valid(); Make is look like: // return $this->is_valid(); return true; and that should do the trick for you. ;) Quote "Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein Link to comment Share on other sites More sharing options...
Guest Posted November 19, 2004 Share Posted November 19, 2004 Hi, thanks for your post! It's not a matter of accepting every card... we don't but the problem is that so many cards are being flagged up as not valid, since the operation is done manually at the other end its ok for us just to let all cards through. Part of the problem is that I can't seem to keep up with the changes in the card numbers! thanks Peter Quote Link to comment Share on other sites More sharing options...
Guest Posted November 19, 2004 Share Posted November 19, 2004 Edit catalog/includes/classes/cc_validation.php and around line 57 should read: ? ? ?return $this->is_valid(); Make is look like: // ? ? ?return $this->is_valid(); ? ? ?return true; and that should do the trick for you. ;) <{POST_SNAPBACK}> Hi thanks so much! I will give it a go right away and let you know how it goes thanks Peter Quote Link to comment Share on other sites More sharing options...
Guest Posted November 19, 2004 Share Posted November 19, 2004 Edit catalog/includes/classes/cc_validation.php and around line 57 should read: ? ? ?return $this->is_valid(); Make is look like: // ? ? ?return $this->is_valid(); ? ? ?return true; and that should do the trick for you. ;) <{POST_SNAPBACK}> Hi Jim thanks for your help that seems to have done it, and it still checks the card type.. just not the number. Perfect! thanks Peter Quote Link to comment Share on other sites More sharing options...
apexonelove Posted August 4, 2006 Share Posted August 4, 2006 (edited) Hi Jim thanks for your help that seems to have done it, and it still checks the card type.. just not the number. Perfect! thanks Peter I tried entering this code and it still gives me the error. Someone said that I might be working with an older version of the ccvalidation file. Is that possibly messing me up? Where do I find the new one? Here's My Code: <?php /* $Id: cc_validation.php,v 1.3 2003/02/12 20:43:41 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright ? 2003 osCommerce Released under the GNU General Public License */ 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 = '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; } if (is_numeric($expiry_m) && ($expiry_m > 0) && ($expiry_m < 13)) { $this->cc_expiry_month = $expiry_m; } else { return -2; } $current_year = date('Y'); $expiry_y = substr($current_year, 0, 2) . $expiry_y; if (is_numeric($expiry_y) && ($expiry_y >= $current_year) && ($expiry_y <= ($current_year + 10))) { $this->cc_expiry_year = $expiry_y; } else { return -3; } if ($expiry_y == $current_year) { if ($expiry_m < date('n')) { return -4; } } // return $this->is_valid(); return true; } function is_valid() { $cardNumber = strrev($this->cc_number); $numSum = 0; for ($i=0; $i<strlen($cardNumber); $i++) { $currentNum = substr($cardNumber, $i, 1); // Double every second digit if ($i % 2 == 1) { $currentNum *= 2; } // Add digits of 2-digit numbers together if ($currentNum > 9) { $firstNum = $currentNum % 10; $secondNum = ($currentNum - $firstNum) / 10; $currentNum = $firstNum + $secondNum; } $numSum += $currentNum; } // If the total has no remainder it's OK return ($numSum % 10 == 0); } } ?> Any help would be fantastic as i've been working on this for a couple days!! oh and a ps -- i'm working with the authorize.net module. Edited August 4, 2006 by apexonelove Quote Link to comment Share on other sites More sharing options...
codieskid Posted May 31, 2007 Share Posted May 31, 2007 Hi Guys I know this is an old post but I too am trying to get my eshop to accept any card numbers. The validation file that oscommerce installs add values for certain cards that are not applicable to the UK so I want the customer to be able to enter their card details and for it to be processed regardless of the card type. I have tried using the above method of commenting doing the above: // return $this->is_valid(); return true; But when I try and enter a card number the system won't let me. I think it will only let me use the default CC number of 41111111111 but I can't seem to find where i can remove/stop it from doing this. The site is on a live server but is there some setting that I need to activate to tell oscommerce that the system is live and to process payments? Many thanks Trev Quote Link to comment Share on other sites More sharing options...
Guest Posted May 31, 2007 Share Posted May 31, 2007 try editing cc_validation.php Instead of making the change you post above try changing } else { return -1; } to } else { $this->cc_type='Unknown Card'; } Tom Quote Link to comment Share on other sites More sharing options...
Guest Posted September 10, 2007 Share Posted September 10, 2007 I too and trying to do this, no luck with the above codes either. Please help. Quote Link to comment Share on other sites More sharing options...
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.