Giter Site home page Giter Site logo

Comments (3)

torendil avatar torendil commented on July 30, 2024 1

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.

aloisdg avatar aloisdg commented on July 30, 2024

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.

aloisdg avatar aloisdg commented on July 30, 2024

Let's close this one for now. Feel free to open a new question if you have one.

from cardidy.

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.