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.

Definition

Namespace: DevCase.Core.Finances.eCommerce
Assembly: 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
)

Parameters

cardNumber  String
The credit card number.

Return Value

Boolean
if the specified card number is a valid card number; otherwise, .

Remarks

Example

This is a code example.
C#
No code example is currently available or this language may not be supported.

See Also