Jump to content
Sign in to follow this  
jackrabbit

Excluding certain types of cards

Recommended Posts

I'm interested in finding out how to exclude American Express from being accepted through the OSC payment module. Is there a way to do that?

Share this post


Link to post
Share on other sites

Sure. Which payment module are you using?


Please use the forums for support! I am happy to help you here, but I am unable to offer free technical support over instant messenger or e-mail.

Share this post


Link to post
Share on other sites

Oh wait a minute. Head up my butt. Just edit the file:

/catalog/includes/classes/cc_validation.php

 

Delete these two lines:

 

} elseif (ereg('^3[47][0-9]{13}$', $this->cc_number)) {

$this->cc_type = 'American Express';


Please use the forums for support! I am happy to help you here, but I am unable to offer free technical support over instant messenger or e-mail.

Share this post


Link to post
Share on other sites

Thank you so much for the tip, I really appreciate it.

 

I was wondering if you or anyone else could help me with a very urgent problem that I am having with the same CC module.

 

Apparently, people with valid VISA cards are recieving errors when they try to submit their CC# and I don't know why. Do you know what the best thing to do about this is or why it is happening?

 

Thanks again.

Share this post


Link to post
Share on other sites

I'd need to know what the error is. The generic cc_validation class is a few years old, so VISA could've updated their card number algorithm.


Please use the forums for support! I am happy to help you here, but I am unable to offer free technical support over instant messenger or e-mail.

Share this post


Link to post
Share on other sites

I'm currently also busy getting my payment modules to work, and yesterday came across the VISA validation code in this thread, where I commented on it.

 

In short: the current VISA verification code thinks that a VISA card number consists of 13 digits + 3 optional ones. I assume that the 3 optional ones refer to the check number on the back of the card. If that's the case however, the code is not correct because as far as I know a VISA card number consists of 16 digits + 3 optional ones.

 

See other thread for corrected code. Oh, and please let me know what you think about this, I'm also fairly new to osCommerce and PHP, so I might be overlooking something...

Share this post


Link to post
Share on other sites

I'm pretty sure the cc_validation script doesn't check CVV2 numbers in those regexps.

 

All credit cards have a special number format to differentiate between the cards, so I think the three numbers you call optional just mean any three numbers will work in that space.

 

I think what the OP's problem is is that VISA has come out with a new card and a new number format that isn't checked properly in the cc_validation script. Someone needs to dig up that information so that the cc_validation script can be updated.

Edited by dynamoeffects

Please use the forums for support! I am happy to help you here, but I am unable to offer free technical support over instant messenger or e-mail.

Share this post


Link to post
Share on other sites

Are you really sure that the code doesn't take the CVV2 number into account? Because if that's the case, I don't really understand why the last 3 digits are optional, as far as I know a VISA card number is always 16 digits, not 13 or 16? Unless there's a special type of VISA card of which I'm not aware...

 

BTW: I called it optional because that's how it's defined in the regex - see the ? sign in the expression.

 

On the other hand, you're probably correct in saying that the code doesn't check those verification numbers, because the VISA regex is the only one with optional digits, hmm...

Share this post


Link to post
Share on other sites

Dunno. Maybe there are some special VISA cards, like AMEX's Black card, that only has 13 digits. It could also be back compatibility for really old VISA cards.


Please use the forums for support! I am happy to help you here, but I am unable to offer free technical support over instant messenger or e-mail.

Share this post


Link to post
Share on other sites

Thanks for the feedback guys, I really appreciate it.

 

Actually thing is about the problem I'm having is that some Visa's are not working while it seems that most do work. Have you heard anything about this? If not do you think I should post another question that asks about it specifically?

 

Since I don't have the problem CC numbers I can't compare them to the ones that do work. That is why I'm a little hesitant to use that modification you posted earlier.

Share this post


Link to post
Share on other sites

That might be the problem right there. You customers could have just mistyped one number and it'd throw back an error. I'd suggest you contact one of your problem customers and have them try it again.

 

aragorn, I just did a quick google of credit card number algorithms and it turns out that VISA does have 13 digit card numbers, so the algorithm in cc_validation is correct. I'm willing to bet this is more user error than anything because I can't find any info on new algorithms put out by VISA.


Please use the forums for support! I am happy to help you here, but I am unable to offer free technical support over instant messenger or e-mail.

Share this post


Link to post
Share on other sites
aragorn, I just did a quick google of credit card number algorithms and it turns out that VISA does have 13 digit card numbers, so the algorithm in cc_validation is correct. I'm willing to bet this is more user error than anything because I can't find any info on new algorithms put out by VISA.

 

 

Back at the dawn of time (okay, in the 70's), both BankAmericard (now VISA) and MasterCharge (now MasterCard) used 13 digit account numbers. MasterCard made a wholesale change to 16 digit numbers, while Bank of America/VISA International allowed at least some of their member banks to retain the 13 digit format.

 

Possibly interesting historical information:

http://www.well.com/user/mp/mcmain.html (description and interviews on the origins of MasterCharge/MasterCard)

http://www.npc.net/merchant/bankcard101.htm (A bit of history of the bank credit card, as well as an overview of the participants and payment flows in credit card processing)

 

Back to the topic at hand...

The code in cc_validation is used everywhere, it seems. Another version in PHP can be found as an example on http://www.sitepoint.com. I note that whoever originally wrote the MOD 10 validation code probably didn't really understand the math behind it, because it can be made a bit simpler. Since it's only being used to validate one card at a time, speed isn't an issue, so it's not really a problem. I'll elaborate if anyone is interested.

 

--Glen

Share this post


Link to post
Share on other sites
Sure. Which payment module are you using?

Hi,

 

Saw this recent post and thought that someone on this string might be able to help me. We do not process cc on line, we only collect the numbers and process them on our machine in our office. We need to collect the ccv number (3 Digits) from the signature line on the rear of the customers card. Can anyone tell me how to create a box on the payment page to collect this info.

 

Thanks for all your posts as I found then info valuable so far.

 

jgairguns

Share this post


Link to post
Share on other sites

Hello,

 

I also have problems with the credit card module.

 

I norway we have 16 digits in our card number. + 3 safety digits.

But when i enter the first numbers that usualy is 4925 i get an error that that number isn't an valid number. Does anybody now why?

 

I use the basic credit card module since i use an external payment terminal.

 

Hope you guys can help me.

 

-Thomas-

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×