stripe/jquery.payment — pull request #63 by acatton (2013-11-22 00:06:05+00:00)
Title: Expose the list of available card types

Hi,

I have a DOM that looks like this, with the card type class on the container:
```html

```

And I was trying to have a stateless event like this: (this is pseudo-code)
```javascript
$ccn.on('keypress change', function (ev) {
if (card.isValid()) {
$ccn_container.removeClass(all_card_types).addClass(card.cardType());
}
});
```

Unfortunately, the list of card types wasn't available, so I had to hard code the list of card types.

Of course, the quick and dirty way to what I want to achieve would be something like: (pseudo code again)
```javascript
var previous_cardtype = '';
$ccn.on('keypress change', function (ev) {
if (card.isValid()) {
$ccn_container.removeClass(previous_cardtype).addClass(card.cardType());
previous_cardtype = card.cardType();
} else {
$ccn_container.removeClass(previous_cardtype);
previous_cardtype = '';
}
});
```

But I do think that stateless code is more robust.

What do you think?