Struts Validator - creditCard validator

Discussion in 'Java' started by smrimell@gmail.com, Feb 13, 2007.

  1. Guest

    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
     
    , Feb 13, 2007
    #1
    1. Advertising

  2. Richter~9.6 Guest

    On 13 Feb, 13:10, 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/validating-card-numbers/

    Regards,
    Richard
     
    Richter~9.6, Feb 13, 2007
    #2
    1. Advertising

  3. Guest

    On 13 Feb, 14:15, "Richter~9.6" <> wrote:
    > On 13 Feb, 13:10, 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/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
     
    , Feb 13, 2007
    #3
  4. Guest

    On 13 Feb, 14:37, wrote:
    > On 13 Feb, 14:15, "Richter~9.6" <> wrote:
    >
    >
    >
    > > On 13 Feb, 13:10, 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/validating-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 :)
     
    , Feb 13, 2007
    #4
  5. Richter~9.6 Guest

    On 13 Feb, 16:09, wrote:
    > On 13 Feb, 14:37, wrote:
    >
    >
    >
    > > On 13 Feb, 14:15, "Richter~9.6" <> wrote:

    >
    > > > On 13 Feb, 13:10, 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/validating-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
     
    Richter~9.6, Feb 13, 2007
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Katie Wright
    Replies:
    8
    Views:
    4,337
    Andrea Desole
    Jan 7, 2005
  2. Jason Us
    Replies:
    0
    Views:
    1,017
    Jason Us
    Oct 4, 2003
  3. jc1771
    Replies:
    0
    Views:
    431
    jc1771
    Dec 28, 2003
  4. Lucas Carlson

    Pleased to announce CreditCard

    Lucas Carlson, Jan 16, 2005, in forum: Ruby
    Replies:
    1
    Views:
    108
    George Moschovitis
    Jan 17, 2005
  5. Jason  Vogel
    Replies:
    0
    Views:
    85
    Jason Vogel
    Dec 15, 2006
Loading...

Share This Page