   @on('keydown', formatBackCardNumber)
   @on('keyup', setCardType)
   @on('paste', reFormatCardNumber)
+  @on('change', reFormatCardNumber)
+  @on('input', reFormatCardNumber)
+  @on('input', setCardType)
   this
 
 # Restrictions

$.payment.fn.formatCardExpiry = ->
  @payment('restrictNumeric')
  @on('keypress', restrictExpiry)
  @on(oninput,    formatExpiry)
  @on('keypress', formatForwardSlash)
  @on('keydown',  formatBackExpiry)
  this

$.payment.fn.formatCardNumber = ->

  # If '4242' + 4
  if re.test(value)
    e.preventDefault()
    setTimeout -> $target.val(value + ' ' + digit)

  # If '424' + 2
  else if re.test(value + digit)
    e.preventDefault()
    setTimeout -> $target.val(value + digit + ' ')

formatBackCardNumber = (e) ->
  $target = $(e.currentTarget)
