| Project: | Ubercart Contributions |
| Component: | Code |
| Category: | |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
Project:
Ubercart Hi,
uc_credit validates several fields (cc num, cvv, owners...) during checkout, but it's still possible to enter an expiration date in the past (I can currently select Jan 2008, for example). What do you think about adding to this a validation function that makes sure expiration is not in the past?
Chad
$return = TRUE;
if (variable_get('uc_credit_owner_enabled', FALSE) && empty($_POST['cc_owner'])) {
drupal_set_message(t('Enter the owner name as it appears on the card.'), 'error');
$return = FALSE;
}
if (variable_get('uc_credit_cvv_enabled', TRUE) && !_valid_cvv($_POST['cc_cvv'])) {
drupal_set_message(t('You have entered an invalid CVV number.'), 'error');
$return = FALSE;
}
if (variable_get('uc_credit_bank_enabled', FALSE) && empty($_POST['cc_bank'])) {
drupal_set_message(t('You must enter the issuing bank for that card.'), 'error');
$return = FALSE;
}
if (variable_get('uc_credit_validate_numbers', TRUE) && !_valid_card_number($arg1->payment_details['cc_number'])) {
drupal_set_message(t('You have entered an invalid credit card number.'), 'error');
$return = FALSE;
}