Click here to Skip to main content
13,800,704 members
Rate this:
Please Sign up or sign in to vote.
See more:
Hey there,

Can anyone guide me on how to develop a tool which generate random but legit credit card
numbers whenever required by me. I need them for testing purpose in one my of project.
Any suggestion or example will be appreciated.

What I have tried:

I'm having basic knowledge of HTML & CSS only so I need in-depth help regarding that.
Posted 6-Dec-18 0:41am
Updated 9-Dec-18 19:14pm
F-ES Sitecore 6-Dec-18 6:10am
This is an extensively documented area so googling will easily show you how card numbers are verified and how each provider differs. Once you understand the subject area it's just a case of writing the code, and you could probably find the code to generate numbers that pass validation tests too.
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

HTML & CSS will not help; you need to use a programming language. As to legitimate numbers, it all depends what you plan to do with them. Credit card numbers are allocated by the banks and card companies so you should talk to one of them for the specific details.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Richard is absolutely right: you can't generate "legit" credit card numbers in isolation )(and you certainly couldn't in HTML!). And even if you could, using them for testing would be ... um ... rather risky from a "financial fraud" point of view if your code makes mistakes.

A better solution is to use the sandbox environment most Payment Service Providers will give you specifically for app testing.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Cookies | Terms of Service
Web02 | 2.8.181215.1 | Last Updated 10 Dec 2018
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100