Can you tell me how to validate credit card numbers using JSP?

Michael Wax

Two points:

  • A JSP should not do this sort of validation. The JSP should handle presentation only; business logic (such as credit card validation) should be in separate classes, for example, in EJB. While no one can stop you from mixing presentation and business logic, doing so will give you confusing and difficult-to-maintain code.
  • Validation of credit cards involves multiple steps. The first is checking to see that the credit card number is allowed under card numbering rules (e.g., MasterCard numbers start with the numeral "5"); the second step requires connecting to a processor (e.g., CyberCash) who will connect to cardholder banks to determine that (a) the card exists and is active, and (b) that there are sufficient funds available for the purchase. The processor may also perform some fraud checks. Given the complexity of card processing and your limited experience in this area, I would suggest that you look for a commercial service to connect with.
0 Comments  (click to add your comment)
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



About | Sitemap | Contact