UtilCommerceValidateCreditCardNumber Method
Uses the Luhn algorithm to determines whether the specified credit card number is valid.
Please de aware that not all valid credit cards can be verified with the Luhn algorithm because
it not covers all range of card numbers, however the Luhn algorithm does work for many, if not most, major credit cards.
The Luhn algorithm is simply used to prevent transpositional errors,
it is useful as a sanity check prior to submitting card numbers to a payment gateway,
but not suitable to absolutely validate whether a number is a valid card number.
The only way to absolutely verify a credit card number is to validate it via a payment gateway.
Namespace: DevCase.Core.Finances.eCommerceAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
public static bool ValidateCreditCardNumber(
string cardNumber
)
Public Shared Function ValidateCreditCardNumber (
cardNumber As String
) As Boolean
Dim cardNumber As String
Dim returnValue As Boolean
returnValue = UtilCommerce.ValidateCreditCardNumber(cardNumber)
public:
static bool ValidateCreditCardNumber(
String^ cardNumber
)
static member ValidateCreditCardNumber :
cardNumber : string -> bool
No code example is currently available or this language may not be supported.
- cardNumber String
-
The credit card number.
Boolean if the specified card number is a valid card number; otherwise,
.
This is a code example.
No code example is currently available or this language may not be supported.
Dim visaNumber As String = "4012888888881881"
Dim isValid As Boolean = ValidateCreditCardNumber(visaNumber)
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.