Comments (8)
How do you envision this working? What would the function return?
from card.
Just a rough example on how this could work:
$('form').card({
...
detection: function (card_number) {
return card_number == '123' ? 'visa' : 'mastercard';
}
...
});
Card will use given detection method when given otherwise using the built-in one.
This way developers could easily hook in other detection methods, in my case I would hook stripe's js lib here to return the correct card type.
from card.
It uses Stripe's jquery.payment
library right now to do the detection. That said, if you'd like to submit a PR, I'd be happy to merge it in.
from card.
Totally worth reading and there is no need to use something that complicated like jquery.payment
: http://creditcardjs.com/credit-card-type-detection
from card.
The suggestion was not to diss or praise any detection algorithm. Just simply to add the possibility to connect this "view" to whatever detection algorithm is used by the payment provider.
Because it uses Stripes jquery.payment I won't be needing it just now, but maybe in the future. Will see!
from card.
I'm with @lipis
from card.
With a detection callback a developer could go much further and detect issuing bank and display an even more correct view of that credit card. I already love that it shows Visa/AmEx etc, and the library shouldn't go much further, but adding an ability to override the detection method won't make the library more complex, it just adds a nice feature for those who want to go a step further and display local bank credit cards.
from card.
Hi all, thanks for your feedback! I like this idea, unfortunately, making the change requires a pretty big logic shift around how we do credit card detection. Right now, I don't have the bandwidth to make that change and there's not enough demand to motivate me to create that bandwidth.
I'm closing the issue for now. If you'd like to create a PR to make the change, I would love to support you in making that happen (especially if you've never contributed before). I'm always around to help answer questions.
from card.
Related Issues (20)
- How to remove the input whitespaces when entering a card number? HOT 2
- Demo 404s HOT 3
- This project is being used in suspicious site HOT 2
- Mastercard Not recognized HOT 5
- Card Number Can't Be Blur In IOS When Input Card Numbers HOT 10
- Credit Card with RTL the float:right makes a problem HOT 1
- Cannot read properties of undefined (reading 'replace') HOT 6
- Card Info storage to database. HOT 1
- how to flip card from js code HOT 7
- Show card without inputs HOT 3
- Add CSS variable support for card colors HOT 3
- Card credit
- Demo link is broken in the readme file HOT 2
- npm install errors HOT 10
- Credit Card Expiration Date Format Not Accepted Error HOT 13
- How to get the card type (visa, mastercard, etc.) so I can pass that info to payment gateway HOT 3
- It does not work HOT 2
- not sure if this is still relevant but for people with the same question: you can use the bin of the card to decode if it's type, the bin is the bank identification number of each card and it identifies a card down to the bank which issued it, with a BIN API like the one from binlist.io you are easily able to check which card goes with which card type. HOT 1
- pleasss.. HOT 2
- Hi
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from card.