Struts Validator - creditCard validator

S

smrimell

Hi,

I'm writing an ecommerce application in struts (1.3.5) and need to
perform a simple sanity check on a credit card number before a form is
submitted.
I'm, using the struts validator framework with the "creditCard"
validator.

This successfully validates my Visa card but fails to validate my
Switch, Solo or maestro card numbers.

Is this a known problem with the creditCard validator or have I just
been unlucky?
I'd rather not write my own mod10 check.

My card numbers are.......


just kidding.

Thanks,
sm rimell
 
R

Richter~9.6

Hi,

I'm writing an ecommerce application in struts (1.3.5) and need to
perform a simple sanity check on a credit card number before a form is
submitted.
I'm, using the struts validator framework with the "creditCard"
validator.

This successfully validates my Visa card but fails to validate my
Switch, Solo or maestro card numbers.

Is this a known problem with the creditCard validator or have I just
been unlucky?
I'd rather not write my own mod10 check.

My card numbers are.......

just kidding.

Thanks,
sm rimell

I'm a fairly new Java programmer but I have done this with PHP. Here
is my script... it should be straight forward enough to convert to
Java as I've commented it too.

http://www.vividreflection.com/blog/validating-card-numbers/

Regards,
Richard
 
S

smrimell

I'm a fairly new Java programmer but I have done this with PHP. Here
is my script... it should be straight forward enough to convert to
Java as I've commented it too.

http://www.vividreflection.com/blog/validating-card-numbers/

Regards,
Richard

Thanks Richard,

I will probably end up writing my own mod10 check and your code will
be of help.
I'm just disapointed that the struts creditCard validator doesn't seem
to be as useful as I first thought.....not much use if it rejects
Maestro cards is it?

Thanks for your reply,
sm rimell
 
S

smrimell

I've just written a standard mod10 checker (looks strangely similar to
yours Richard!) and it validates switch, maestro and solo cards.

Does anybody know which algorithm the struts creditCard validator
uses?

Don't make me download the source :)
 
R

Richter~9.6

I've just written a standard mod10 checker (looks strangely similar to
yours Richard!) and it validates switch, maestro and solo cards.

Does anybody know which algorithm the struts creditCard validator
uses?

Don't make me download the source :)

hehe, I'm glad I was able to help :)

Regards,
Richard
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top