You are here

function commerce_cardonfile_validate_card_expiration in Commerce Card on File 7.2

Validates the card expiration date.

Return value

TRUE if the card hasn't expired, FALSE otherwise.

4 calls to commerce_cardonfile_validate_card_expiration()
commerce_cardonfile_can_charge in ./commerce_cardonfile.module
Returns TRUE if the card can be charged
commerce_cardonfile_handler_field_card_exp::render in includes/views/handlers/commerce_cardonfile_handler_field_card_exp.inc
Render the field.
commerce_cardonfile_order_charge_card in ./commerce_cardonfile.module
Process a charge for a given an order
commerce_cardonfile_order_select_card in ./commerce_cardonfile.module
Select the card on file that can be charged for an order.
2 string references to 'commerce_cardonfile_validate_card_expiration'
commerce_cardonfile_form_alter in ./commerce_cardonfile.module
Implements hook_form_alter().
commerce_cardonfile_form_commerce_payment_order_transaction_add_form_alter in ./commerce_cardonfile.module
Implements hook_form_FORM_ID_alter().

File

./commerce_cardonfile.module, line 989
Supports card on file functionality for credit card payment methods by associating card data reference IDs from payment gateways with user accounts.

Code

function commerce_cardonfile_validate_card_expiration($card) {
  commerce_cardonfile_load_credit_card_helpers();
  $check = commerce_payment_validate_credit_card_exp_date($card->card_exp_month, $card->card_exp_year);
  return $check === TRUE;
}