Comments (3)
Hi @merge-tek !
First of all, thanks for using Cardidy!
For the first situation regarding JCB, it's because those cards could also be RuPay cards. We ordered them in an order that seemed like the most likely use of cards, hence why you'll find that JCB is the first one that gets out of the Identify method, but not the only one
Please use First() instead of Single
For Diner's Club International, the IIN should start with 36, so it is normal you wouldn't find a match with a card that starts with 30. Could you please tell me the configuration you used to get something else than 36 as a prefix? I tried with the first card generator you provided (put US/Diner's club international as an issuer brand) and it worked for the credit card numbers I was provided.
By the way, if you know there is a range that is not in the Wiki page, please update the wikipedia and you can also contribute to the library by opening a PR
Don't hesitate to close the issue or ask for it's closing if you have no further issue
With my best
from cardidy.
Hi! Here is a a small demo showcasing @torendil's excellent answer:
using System;
using System.Linq;
using DEdge;
public class Program
{
public static void Main()
{
var cardNumber = "3530111333300000";
// this line will fail because this card number can be either a JCB or RuPay card
// var result = Cardidy.Identify(cardNumber).Single();
// try this instead
var result = Cardidy.Identify(cardNumber).First();
Console.WriteLine(result);
// or even
foreach (var card in Cardidy.Identify(cardNumber))
{
Console.WriteLine($"cardNumber can be {card}");
}
}
}
https://dotnetfiddle.net/2yHfZQ
from cardidy.
Let's close this one for now. Feel free to open a new question if you have one.
from cardidy.
Related Issues (20)
- Update card LankaPay HOT 2
- Compile down to JavaScript HOT 1
- Add more examples and more documentations
- Fix typos in the documentation HOT 4
- Allow noise in strict mode HOT 1
- Target multiple sdks lower than .net6.0 HOT 4
- Identify should send card type on invalids/unkowns HOT 1
- Suggestion to add a result model instead of [cardtype] HOT 4
- Would it be nice to use code generator to parse a json with all card's data and add a generation step? HOT 7
- Add Github Action to `Run Tests` HOT 12
- Target .NET 5.0 HOT 1
- We got a not be fully compatible error on build HOT 4
- Add support for Diners
- Should we include more informations from the IIN?
- Add Diners Club EnRoute
- Add support for card GPN HOT 2
- Add support for card Borica HOT 2
- Should inactive card loose precedence over active card? HOT 2
- Update card Verve HOT 2
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 cardidy.