[NonAction]
public override IList<string> ValidatePaymentForm(FormCollection form)
{
var warnings = new List<string>();
//validate
var validator = new PaymentInfoValidator(_localizationService);
var model = new PaymentInfoModel()
{
CardholderName = form["CardholderName"],
CardNumber = form["CardNumber"],
CardCode = form["CardCode"],
};
var validationResult = validator.Validate(model);
if (!validationResult.IsValid)
foreach (var error in validationResult.Errors)
warnings.Add(error.ErrorMessage);
return warnings;
}
What I'm trying to accomplish during this process is run it through our CC verification / encryption server to make sure the card if valid.
I know how to access it during the ProcessPaymentRequest() routine but not sure how to access it outside of there but in the controller.