You are here

function commerce_payment_validate_credit_card_exp_date in Commerce Core 7

Validates a credit card expiration date.

Parameters

int $month: The 1 or 2-digit numeric representation of the month, i.e. 1, 6, 12.

int $year: The 4-digit numeric representation of the year, i.e. 2010.

Return value

TRUE for non-expired cards, 'year' or 'month' for expired cards indicating which value should receive the error.

1 call to commerce_payment_validate_credit_card_exp_date()
commerce_payment_credit_card_validate in modules/payment/includes/commerce_payment.credit_card.inc
Validates a set of credit card details entered via the credit card form.

File

modules/payment/includes/commerce_payment.credit_card.inc, line 361
Credit-card helper functions for Drupal commerce.

Code

function commerce_payment_validate_credit_card_exp_date($month, $year) {
  return CommercePaymentCreditCard::validateExpirationDate($month, $year);
}