1) Just modify the CreditCardValidator.EvaluateIsValid method of your nopCommerce 1.8 cart. It is located in the Nop.Controls project under Payment > Validators > CreditCardValidator.cs. Notice, the .TrimEnd I added to remove trailing spaces.
/// <summary>
/// Determines whether the value in the credit card control is valid
/// </summary>
/// <returns>true if the value in the input control is valid; otherwise, false.</returns>
/// Contributer: Bruce Leggett
protected override bool EvaluateIsValid()
{
string valueToValidate = base.GetControlValidationValue(base.ControlToValidate).TrimEnd();
int indicator = 1;
int firstNumToAdd = 0;
int secondNumToAdd = 0;
char[] ccArr = valueToValidate.ToCharArray();
for (int i = ccArr.Length - 1; i >= 0; i--)
{
char ccNoAdd = ccArr[i];
int ccAdd = 0;
if (!int.TryParse(ccNoAdd.ToString(), out ccAdd))
{
return false;
}
if (indicator == 1)
{
firstNumToAdd += ccAdd;
indicator = 0;
}
else
{
if ((ccAdd + ccAdd) >= 10)
{
int temporary = ccAdd + ccAdd;
string num1 = temporary.ToString().Substring(0, 1);
string num2 = temporary.ToString().Substring(1, 1);
secondNumToAdd += Convert.ToInt32(num1) + Convert.ToInt32(num2);
}
else
{
secondNumToAdd += ccAdd + ccAdd;
}
indicator = 1;
}
}
return (((firstNumToAdd + secondNumToAdd) % 10) == 0);
}
#endregion
}
2) Compile
3) Copy the Nop.Controls.dll in the bin folder to your websites bin folder and viola!
I know it isn't much, but it was bugging me!
Enjoy!