Thought this might help someone else as there are no other post in the forum I could find that addressed this problem.
After collecting manual credit card numbers on my website for many years, people often forget to change the default expiry date. I am currently upgrading to nopCommerce , and the Manual Payments Plugin currently doesn't validate the expiry to make sure it is not in the past (e.g. as of today it defaults to 01 / 2014) Only took me about 5 hours to get the Rules correct as I've never used FluentValidation before!
So here are the rules I've added to ensure the expiry date is current.
Add to Nop.Plugin.Payments.Manual.Validators.PaymentInfoValidator
RuleFor(x => x.ExpireYear).Must(x => Convert.ToInt32(x) >= DateTime.Now.Year).When(f => !String.IsNullOrEmpty(f.ExpireYear)).WithMessage("The credit card expiry date is invalid.");
RuleFor(x => x.ExpireMonth).Must(x => Convert.ToInt32(x) >= DateTime.Now.Month).When(f => !String.IsNullOrEmpty(f.ExpireMonth) && !String.IsNullOrEmpty(f.ExpireYear) && Convert.ToInt32(f.ExpireYear) == DateTime.Now.Year).WithMessage("The credit card expiry date is invalid.");
Regards,
Michelle