12345678910111213141516171819202122 |
- $ ->
- $('[data-numeric]').payment('restrictNumeric')
- $('.cc-number').payment('formatCardNumber')
- $('.cc-exp').payment('formatCardExpiry')
- $('.cc-csc').payment('formatCardCVC')
- # $('form').submit(function(e){
- # e.preventDefault();
- # $('input').removeClass('invalid');
- # $('.validation').removeClass('passed failed');
- # var cardType = $.payment.cardType($('.cc-number').val());
- # $('.cc-number').toggleClass('invalid', !$.payment.validateCardNumber($('.cc-number').val()));
- # $('.cc-exp').toggleClass('invalid', !$.payment.validateCardExpiry($('.cc-exp').payment('cardExpiryVal')));
- # $('.cc-cvc').toggleClass('invalid', !$.payment.validateCardCVC($('.cc-cvc').val(), cardType));
- # if ( $('input.invalid').length ) {
- # $('.validation').addClass('failed');
- # } else {
- # $('.validation').addClass('passed');
- # }
|