1

I have payment gateway integration in my application developed using .Net Compact framework 3.5.

Is there any "Credit card validation and parsing utilities" that i can use in my application or is there any class that i can use to identify the type of the card?

Sundar
  • 93
  • 1
  • 9

2 Answers2

3

Google for Lunn or Luhn validation. This will simply validate that the cc number is a valid sequence, but you will need to obviously validate that against the provider.

The same links may provide you with the prefixes used by several card companies.

leppie
  • 115,091
  • 17
  • 196
  • 297
0

Try Subsonic.Sugar .. then you could do somethign like this

 protected void ValidateCardServerValidate(object source, ServerValidateEventArgs args)

{ bool cardValidate; string item = ddlCardType.SelectedItem.Text.ToUpper();

if (item == "MASTERCARD")
  cardValidate = SubSonic.Sugar.Validation.IsCreditCardMasterCard(args.Value);
else if (item == "VISA")
  cardValidate = SubSonic.Sugar.Validation.IsCreditCardVisa(args.Value);
else if (item == "ACME")
  cardValidate = SubSonic.Sugar.Validation.IsCreditCardDinersClub(args.Value);
else if (item == "DINERS")
  cardValidate = SubSonic.Sugar.Validation.IsCreditCardAmericanExpress(args.Value);
else
  cardValidate = SubSonic.Sugar.Validation.IsCreditCardAny(args.Value);

args.IsValid = cardValidate;

}

Intrigue
  • 672
  • 6
  • 15