Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / February 2007

Tip: Looking for answers? Try searching our database.

Struts Validator - creditCard validator

Thread view: 
smrimell@gmail.com - 13 Feb 2007 13:10 GMT
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
Richter~9.6 - 13 Feb 2007 14:15 GMT
On 13 Feb, 13:10, smrim...@gmail.com wrote:
> Hi,
>
[quoted text clipped - 17 lines]
> 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
smrimell@gmail.com - 13 Feb 2007 14:37 GMT
> On 13 Feb, 13:10, smrim...@gmail.com wrote:
>
[quoted text clipped - 28 lines]
> 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
smrimell@gmail.com - 13 Feb 2007 16:09 GMT
On 13 Feb, 14:37, smrim...@gmail.com wrote:

> > On 13 Feb, 13:10, smrim...@gmail.com wrote:
>
[quoted text clipped - 28 lines]
> > Regards,
> > Richard

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 :)
Richter~9.6 - 13 Feb 2007 20:32 GMT
On 13 Feb, 16:09, smrim...@gmail.com wrote:
> On 13 Feb, 14:37, smrim...@gmail.com wrote:
>
[quoted text clipped - 38 lines]
>
> Don't make me download the source :)

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

Regards,
Richard


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.