Responsive ajax credit card payment validation with Jquery, PHP and Twitter Bootstrap

Today we are going to learn how to validate credit card details with PHP using AJAX and this tutorial quite useful for eCommerce websites. Lot of plugin is available to validate the credit card details with JQuery but i have written class to validate the creditcard details at server side and it is more secure than client side validation. It supports following type of credit cards

  • Visa
  • MasterCard
  • Discover
  • Amex
  • Diners
  • BankCard
  • JCB
  • Enroute
  • Switch

Validation features:

  • It validates above type of card numbers
  • It validates Expiry dates and Months
  • It validates card CVV
  • Compatible with small devices(Responsive)

PHP validation code:

Card Number validation

Expiry Month/Year validation

Validation with CVV number

I have used Jquery Form plugin to submit the form

HTML code:

I have written entire validation as one single class. You just include that file and pass input data to the object.

Check with sample card details in demo :

Thank you….
Demo and Download


Please don’t forget to share and subscribe to latest updates of the blog .