Skip to content

goradish/creditCardService

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Credit Card Service

A single line credit card input written in JavaScript that will switch to the next input once the information has been filled out, so no touch/mouse events are needed from the user.

Install

  1. Run npm install && gulp to create the dist directory.
  2. Copy the dist directory to your project and load it onto your page
  3. The paymentService.js file creates a global object called PaymentService. Invoke the init function with the ID of the div container as the parameter.
  4. Access the non-formated user input with the PaymentService.finalNumbers object
    1. PaymentService.finalNumbers.creditCardNumber - the credit card number eg. 4242424242424242
    2. PaymentService.finalNumbers.expiration - the card expiration e.g. 0222
    3. PaymentService.finalNumbers.cvv - the card CVV (4 numbers for Amex cards) e.g. 222
    4. PaymentService.finalNumbers.zip - the card zip code e.g. 60604

TODO

  • Create Bower package