emailanj Posted August 14, 2005 Posted August 14, 2005 I get this error when trying to run any credit card. I have tried to run the card through both of my credit modules, Viaklix and the manual (were the card number is sent to you in two different e-mails and you can enter it manually) Credit Card Error! The first four digits of the number entered are: 5000<br>If that number is correct, we do not accept that type of credit card.<br>If it is wrong, please try again. I am thinking there must be a <BR> in the code somewhere but I have searched and not quite sure were to look. Please any help..... Anj
emailanj Posted August 14, 2005 Author Posted August 14, 2005 Please....any direction or thoughts would be so helpful...I am so stumped. Anj
stevel Posted August 14, 2005 Posted August 14, 2005 The <br> is not part of what you entered, it's part of the error message. There are three relevant defines in includes/languages/english.php: define('TEXT_CCVAL_ERROR_INVALID_DATE', 'The expiry date entered for the credit card is invalid.<br>Please check the date and try again.'); define('TEXT_CCVAL_ERROR_INVALID_NUMBER', 'The credit card number entered is invalid.<br>Please check the number and try again.'); define('TEXT_CCVAL_ERROR_UNKNOWN_CARD', 'The first four digits of the number entered are: %s<br>If that number is correct, we do not accept that type of credit card.<br>If it is wrong, please try again.'); Unfortunately, the way these strings are processed, the <br> is converted to HTML escapes so that it prints exactly that way. I haven't bothered to find the code that does this and fix it (I removed the <br> instead on my store - it's not needed.) Does the credit card number really start with 5000? Or did you just change it for this post? Some have reported that the validation done in includes/classes/cc_validation.php incorrectly rejects some MasterCard numbers. A card number beginning 50 would be rejected. Steve Contributions: Country-State Selector Login Page a la Amazon Protection of Configuration Updated spiders.txt Embed Links with SID in Description
emailanj Posted August 14, 2005 Author Posted August 14, 2005 Wow..Thanks a bunch!!! The card I am using does have a 50 for the first two numbers. How do I correct it from giving me an error? (what code do I need to change?) Thanks so much anj. The <br> is not part of what you entered, it's part of the error message. There are three relevant defines in includes/languages/english.php: define('TEXT_CCVAL_ERROR_INVALID_DATE', 'The expiry date entered for the credit card is invalid.<br>Please check the date and try again.'); define('TEXT_CCVAL_ERROR_INVALID_NUMBER', 'The credit card number entered is invalid.<br>Please check the number and try again.'); define('TEXT_CCVAL_ERROR_UNKNOWN_CARD', 'The first four digits of the number entered are: %s<br>If that number is correct, we do not accept that type of credit card.<br>If it is wrong, please try again.'); Unfortunately, the way these strings are processed, the <br> is converted to HTML escapes so that it prints exactly that way. I haven't bothered to find the code that does this and fix it (I removed the <br> instead on my store - it's not needed.) Does the credit card number really start with 5000? Or did you just change it for this post? Some have reported that the validation done in includes/classes/cc_validation.php incorrectly rejects some MasterCard numbers. A card number beginning 50 would be rejected. <{POST_SNAPBACK}>
stevel Posted August 14, 2005 Posted August 14, 2005 Yeah, I've heard of this before. In includes/classes/cc_validation.php, line 21, change: } elseif (ereg('^5[1-5][0-9]{14}$', $this->cc_number)) { to: } elseif (ereg('^5[0-9][0-9]{14}$', $this->cc_number)) { Steve Contributions: Country-State Selector Login Page a la Amazon Protection of Configuration Updated spiders.txt Embed Links with SID in Description
emailanj Posted August 14, 2005 Author Posted August 14, 2005 You are a Genius!!....I would have never figured that out!!...It worked like a charm. Thank you a hundred times over.. Anj Yeah, I've heard of this before. In includes/classes/cc_validation.php, line 21, change: ? ? ?} elseif (ereg('^5[1-5][0-9]{14}$', $this->cc_number)) { to: ? ? ?} elseif (ereg('^5[0-9][0-9]{14}$', $this->cc_number)) { <{POST_SNAPBACK}>
stevel Posted August 14, 2005 Posted August 14, 2005 Not a genius - it's just that I've seen this reported before. The whole cc_validation class is a mess and I hear it is being restructured for MS3. Steve Contributions: Country-State Selector Login Page a la Amazon Protection of Configuration Updated spiders.txt Embed Links with SID in Description
emailanj Posted August 14, 2005 Author Posted August 14, 2005 Well...I still am excited that you helped me with my problem....genius or not :D Thank you again anj Not a genius - it's just that I've seen this reported before. The whole cc_validation class is a mess and I hear it is being restructured for MS3. <{POST_SNAPBACK}>
user99999999 Posted August 15, 2005 Posted August 15, 2005 Try this to avoid any other problem. http://www.oscommerce.com/forums/index.php?showtopic=145131
omrirgv Posted August 24, 2005 Posted August 24, 2005 You are a Genius!!....I would have never figured that out!!...It worked like a charm. Thank you a hundred times over.. Anj <{POST_SNAPBACK}> I'm trying to run an 8 digit local card type with no success, the card is alocal mastercard starting with 5. Any suggestions?
stevel Posted August 24, 2005 Posted August 24, 2005 Well, try inserting this into the series of tests in cc_validation.php: } elseif (ereg('^5[0-9][0-9]{6}$', $this->cc_number)) { $this->cc_type = 'Master Card'; Steve Contributions: Country-State Selector Login Page a la Amazon Protection of Configuration Updated spiders.txt Embed Links with SID in Description
omrirgv Posted August 25, 2005 Posted August 25, 2005 Well, try inserting this into the series of tests in cc_validation.php: ? ? ?} elseif (ereg('^5[0-9][0-9]{6}$', $this->cc_number)) { ? ? ? ?$this->cc_type = 'Master Card'; <{POST_SNAPBACK}> Well no, its still not accepting this type of card, here is my code: 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-9][0-9]{6}$', $this->cc_number)) { $this->cc_type = 'CUSTOM'; } elseif (ereg('^5[1-9][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'; } else { $this->cc_type = 'Credit Card'; //return 1; }
Recommended Posts
Archived
This topic is now archived and is closed to further replies.