Hi, i am trying to validate credit card.

I want to validate credit card

1> name on card
2> card number
3> card type (visa,mastercard... etc)
4> cvv
5> expiry date

I seared on google but most of links gives information to validate card according to number.

How to do this? any sample link how to do this? or script ?

Recommended Answers

All 4 Replies

You can only do this by using a payment provider, like a bank, or paypal.

Hi, can you explain it to me.

How verified these details with paypal but not the payment transfer...

Only credit card verification with above inputs??

You could verify the credit card number using the Luhn Algorithm. http://en.wikipedia.org/wiki/Luhn_algorithm There is a link at the bottom for an example of a php algorithm.

There are some resources I have seen online that describe the particulars of most major card providers in terms of length of card number, general acceptable ranges, as well as what to look for in terms of CVV's and often how frequently they expire.

Besides checking if the number is valid, the date is not expired and the other fields are filled in, I agree with pritaeas that the best way to do this would be through your payment gateway of choice.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.