Thursday, March 29, 2012

Creditcard Validation script

Does anyone have a T-SQL script or function that validates US creditcard
numbers?
I am not talking about whether the account is current, just whether the
numeric value of the card is valid. Something similar to what one might use
for zip codes or phone numbers.
Right now I have something that looks for 15 or 16 characters in length and
then checks the first digit for the type of card (e.g., 3 = Amex).
However I was hoping that someone who has worked with this issue might give
me some insights into what conventions or standards a credit card number mus
t
comply with in order to be valid.
ThanksOn Sun, 19 Feb 2006 11:12:26 -0800, "Dave" <Dave@.discussions.microsoft.com>
wrote:
in <331D1E4C-2EB2-4ABF-ACC5-08F5D3E5FC2A@.microsoft.com>

>Does anyone have a T-SQL script or function that validates US creditcard
>numbers?
>I am not talking about whether the account is current, just whether the
>numeric value of the card is valid. Something similar to what one might use
>for zip codes or phone numbers.
>Right now I have something that looks for 15 or 16 characters in length and
>then checks the first digit for the type of card (e.g., 3 = Amex).
>However I was hoping that someone who has worked with this issue might give
>me some insights into what conventions or standards a credit card number mu
st
>comply with in order to be valid.
>Thanks
Here's a URL that I took to heart and converted to VBScript for use in my
classic ASP environment:
http://www.sitepoint.com/print/card...ation-class-php
If you want to see the VBScript also, post back and I'll put it up. I felt
that
this covered it well enough that ashamedly I didn't make any efforts to furt
her
validate the facts that the author presented.
Stefan Berglund

No comments:

Post a Comment