You appear to be a bot. Output may be restricted
Description
Given a number and algorithem, determine if we have a valid credit card format
Usage
$bool = edd_validate_card_number_format( $number );
Parameters
- $number
- ( integer ) optional – The Credit Card Number to validate
Returns
bool If the card number provided matches a specific format of a valid card
Source
File name: easy-digital-downloads/includes/checkout/functions.php
Lines:
1 to 27 of 27
function edd_validate_card_number_format( $number = 0 ) { $number = trim( $number ); if ( empty( $number ) ) { return false; } if ( ! is_numeric( $number ) ) { return false; } $is_valid_format = false; // First check if it passes with the passed method, Luhn by default $is_valid_format = edd_validate_card_number_format_luhn( $number ); // Run additional checks before we start the regexing and looping by type $is_valid_format = apply_filters( 'edd_valiate_card_format_pre_type', $is_valid_format, $number ); if ( true === $is_valid_format ) { // We've passed our method check, onto card specific checks $card_type = edd_detect_cc_type( $number ); $is_valid_format = ! empty( $card_type ) ? true : false; } return apply_filters( 'edd_cc_is_valid_format', $is_valid_format, $number ); }