Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Struts Validator - creditCard validator

Reply
Thread Tools

Struts Validator - creditCard validator

 
 
smrimell@gmail.com
Guest
Posts: n/a
 
      02-13-2007
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

 
Reply With Quote
 
 
 
 
Richter~9.6
Guest
Posts: n/a
 
      02-13-2007
On 13 Feb, 13:10, (E-Mail Removed) wrote:
> 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/...-card-numbers/

Regards,
Richard

 
Reply With Quote
 
 
 
 
smrimell@gmail.com
Guest
Posts: n/a
 
      02-13-2007
On 13 Feb, 14:15, "Richter~9.6" <(E-Mail Removed)> wrote:
> On 13 Feb, 13:10, (E-Mail Removed) wrote:
>
>
>
> > 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/...-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

 
Reply With Quote
 
smrimell@gmail.com
Guest
Posts: n/a
 
      02-13-2007
On 13 Feb, 14:37, (E-Mail Removed) wrote:
> On 13 Feb, 14:15, "Richter~9.6" <(E-Mail Removed)> wrote:
>
>
>
> > On 13 Feb, 13:10, (E-Mail Removed) wrote:

>
> > > 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/...-card-numbers/

>
> > 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







 
Reply With Quote
 
Richter~9.6
Guest
Posts: n/a
 
      02-13-2007
On 13 Feb, 16:09, (E-Mail Removed) wrote:
> On 13 Feb, 14:37, (E-Mail Removed) wrote:
>
>
>
> > On 13 Feb, 14:15, "Richter~9.6" <(E-Mail Removed)> wrote:

>
> > > On 13 Feb, 13:10, (E-Mail Removed) wrote:

>
> > > > 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/...-card-numbers/

>
> > > 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


hehe, I'm glad I was able to help

Regards,
Richard

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem using a Gem... (CreditCard is not a module) Jason Vogel Ruby 0 12-15-2006 07:39 PM
Pleased to announce CreditCard Lucas Carlson Ruby 1 01-17-2005 09:56 AM
Is it safe to point to Internet for locating struts DTD files in struts TLDs and XML files? Katie Wright Java 8 01-07-2005 03:37 PM
Integrate a Struts app with a non-struts app jc1771 Java 0 12-28-2003 06:36 PM
Struts Installation - missing struts.tld??? Jason Us Java 0 10-03-2003 11:36 PM



Advertisments