Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. What is the code for Credit card no. validation in C#?

What is the code for Credit card no. validation in C#?

Scheduled Pinned Locked Moved C#
questioncsharpcom
22 Posts 11 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J jschell

    Depends on what you mean by validate. One of the other posts provide a link to do a simple check sum on the digits itself. This is a simple test that can be done in a GUI. A number that passes that test still might not be a valid number in that numbers have certain rules related to the card type (such as Visa.) There are simple methods that one can use to validate those however the only correct way requires that one get the bin numbers from a valid processor and check them. Of course a number is only valid if a processor accepts it. Doing that requires a lot of code and will be specific to each processor. Both of those make it pointless for anyone to post such solutions here. And none of that has anything at all to do with securing ecommerce payment applications.

    C Offline
    C Offline
    Cnu55555
    wrote on last edited by
    #21

    Actually SECURE E-COMMERCE is my acadamic project. In that i need to validate Credit card atleast Visa card. My thinking is when the user give card no. how can we validate ? and what are the reqmnts to validate?

    1 Reply Last reply
    0
    • P PIEBALDconsult

      http://en.wikipedia.org/wiki/Luhn_algorithm[^]

      C Offline
      C Offline
      Cnu55555
      wrote on last edited by
      #22

      Thank Q

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups