src/js/card-js.js
function CardJs(elem) {
  this.elem = jQuery(elem);

  this.captureName = this.elem.data("capture-name") ? this.elem.data("capture-name") : false;
  this.iconColour = this.elem.data("icon-colour") ? this.elem.data("icon-colour") : false;
  this.stripe = this.elem.data("stripe") ? this.elem.data("stripe") : false;

  if(this.stripe) {
    this.captureName = false;
  }

  // Initialise
  this.initCardNumberInput();
  this.initNameInput();
  this.initExpiryMonthInput();
  this.initExpiryYearInput();
  this.initCvcInput();


  this.elem.empty();


  // Setup display
  this.setupCardNumberInput();
  this.setupNameInput();
  this.setupExpiryInput();
  this.setupCvcInput();


  // Set icon colour
  if(this.iconColour) {
    this.setIconColour(this.iconColour);
  }

  // --- --- --- --- --- --- --- --- --- ---

  this.refreshCreditCardTypeIcon();

}
function CardJs(elem) {
  this.elem = jQuery(elem);

  this.captureName = this.elem.data("capture-name") ? this.elem.data("capture-name") : false;
  this.iconColour = this.elem.data("icon-colour") ? this.elem.data("icon-colour") : false;
  this.stripe = this.elem.data("stripe") ? this.elem.data("stripe") : false;

  if(this.stripe) {
    this.captureName = false;
  }

  // Initialise
  this.initCardNumberInput();
  this.initNameInput();
  this.initExpiryMonthInput();
  this.initExpiryYearInput();
  this.initCvcInput();


  this.elem.empty();


  // Setup display
  this.setupCardNumberInput();
  this.setupNameInput();
  this.setupExpiryInput();
  this.setupCvcInput();


  // Set icon colour
  if(this.iconColour) {
    this.setIconColour(this.iconColour);
  }

  // --- --- --- --- --- --- --- --- --- ---

  this.refreshCreditCardTypeIcon();

}
function CardJs ( elem ) { this . elem = jQuery ( elem ) ; this . captureName = this . elem . data ( "capture-name" ) ? this . elem . data ( "capture-name" ) : false ; this . iconColour = this . elem . data ( "icon-colour" ) ? this . elem . data ( "icon-colour" ) : false ; this . stripe = this . elem . data ( "stripe" ) ? this . elem . data ( "stripe" ) : false ; if ( this . stripe ) { this . captureName = false ; } // Initialise this . initCardNumberInput ( ) ; this . initNameInput ( ) ; this . initExpiryMonthInput ( ) ; this . initExpiryYearInput ( ) ; this . initCvcInput ( ) ; this . elem . empty ( ) ; // Setup display this . setupCardNumberInput ( ) ; this . setupNameInput ( ) ; this . setupExpiryInput ( ) ; this . setupCvcInput ( ) ; // Set icon colour if ( this . iconColour ) { this . setIconColour ( this . iconColour ) ; } // --- --- --- --- --- --- --- --- --- --- this . refreshCreditCardTypeIcon ( ) ; }
@class CardJs

@author Colin Stannard

@param elem
@constructor
@class CardJs