"I need reg expression to allow 9 or 10 digits with no whitespace. For this I created a reg expression and used in attached file. But it is not working. Can you let me know what is wrong or missed in my code? My creditcard is still not working. See the attached file."
Thanks
<?php
function addCustomCardType($vars)
{
$vars['supportedCardTypes'] .= ',isracard';
return <<<HTML
<script>
jQuery(document).ready(function() {
var customCardType =
{
type: 'isracard',
patterns: [54, 77], //What are the first digits. eg: [51, 52, 53, 54, 55, 22, 23, 24, 25, 26, 27],
format: /^[0-9]{0,}$/, // Default Format: /(\d{1,4})/g
length: [9, 10], //12 is the minimum supported card length in WHMCS. Can be multiple. Eg: length: [16, 17, 18, 19],
cvcLength: [3], //The cvv length. Can be an array of accepted lengths
luhn: false
}
if (jQuery.payment.cards) {
jQuery.payment.cards.push(customCardType);
}
});
</script>
HTML;
}
add_hook('AdminAreaFooterOutput', 1, 'addCustomCardType');
add_hook('ClientAreaFooterOutput', 1, 'addCustomCardType');