Giter Site home page Giter Site logo

Comments (3)

03lenio avatar 03lenio commented on June 16, 2024

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.

from card.

ovicko avatar ovicko commented on June 16, 2024

I noticed there is an inbuilt payment library which documents the APIs available.
You don't need to download the library to use it.
In my case:

Form field
<input type="text" id="card-number" class="form-control" placeholder="0000 0000 0000 0000" type="tel" name="number">

Get type

$("#button-confirm").click(function() {

        var type= Payment.fns.cardType($('#card-number').val())
        console.log(type)
}

from card.

Almansori avatar Almansori commented on June 16, 2024

$('#someTextBox').change(function() {
$('#someOutput').text(creditCardTypeFromNumber($(this).val()));
});
This will output into some element with id="someOutput" the result of the text box which fires when the user changes the text in the element id="someTextBox".

from card.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.