Guest Posted August 19, 2005 Posted August 19, 2005 Hey guys, I know this question has been asked many times through the forum.. But im still a little bit confused with the credit card module. I see in cc_validation.php it has listed the accepted 4 first digits and then allocates it to the correct type of card may it be ( mastercard, visa .. or whatever ) but I do not want this checking. I just want it to accept all card numbers because i manually process the order. I have made these changes in cc_validation.php but still not working.. can someone help me.. i think i screwed sumfin up.. function validate($number, $expiry_m, $expiry_y, $cvv2) { $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; } i thought : } else { return -1; } makes it accept any card.. hrmmm well it sure didnt work still.. its still fussy when it comes to accepting the right kinda card... looking for a quick easy fix.. come on php guys.. help me out ta grego Quote
boxtel Posted August 19, 2005 Posted August 19, 2005 Hey guys,I know this question has been asked many times through the forum.. But im still a little bit confused with the credit card module. I see in cc_validation.php it has listed the accepted 4 first digits and then allocates it to the correct type of card may it be ( mastercard, visa .. or whatever ) but I do not want this checking. I just want it to accept all card numbers because i manually process the order. I have made these changes in cc_validation.php but still not working.. can someone help me.. i think i screwed sumfin up.. function validate($number, $expiry_m, $expiry_y, $cvv2) { $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; } i thought : } else { return -1; } makes it accept any card.. hrmmm well it sure didnt work still.. its still fussy when it comes to accepting the right kinda card... looking for a quick easy fix.. come on php guys.. help me out ta grego <{POST_SNAPBACK}> try return 1; Quote Treasurer MFC
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.