stripe/jquery.payment — pull request #95 by framp (2014-06-05 01:28:55+00:00)
Title: New feature: retrieve bank details from binlist.net

I've added a new function `getBankDetails` which monitor a `cc-number` field and retrieve information about the bank using binlist.net.

binlist.net supports JSONP (so retrieving data is pretty easy and completely user-side) and provides:

- Bank name
- Country
- Country Code
- Card category ("PREMIER","CLASSIC","",...)
- Card Type ("DEBIT","CREDIT","",...)
- Latitude
- Longitude
- Brand ("VISA","MASTERCARD",...)
- Sub-Brand (...)

Configuring which data and which field name it should have should be straightforward. As of now, I'm returning these data:

- countryCode
- country
- bank
- type
- category

I've also added a cache object which will cache the last 10 (the limit is of course configurable) requests made to binlist.

The final user should simply use:

$('.cc-number').payment('getBankDetails');
$(".cc-number").on('payment.bankDetails', function(){
console.log(arguments);
})

I've added the appropriate tests and I've modified the example to load the code.

I'd love seeing this merged in jquery.payment, if something is not up to jquery.payment standards I'll be more than happy to fix it.