$.payment.cardExpiryVal(string) and $.fn.payment('cardExpiryVal')
Parses a credit card expiry in the form of MM/YYYY, returning an object containing the month and year. Shorthand years, such as 13 are also supported (and converted into the longhand, e.g. 2013).
This function doesn't perform any validation of the month or year; use $.payment.validateCardExpiry(month, year) for that.
$.payment.cards
Array of objects that describe valid card types. Each object should contain the following fields:
{// Card type, as returned by $.payment.cardType.type: 'mastercard',// Array of prefixes used to identify the card type.patterns: [51,52,53,54,55,22,23,24,25,26,27],// Array of valid card number lengths.length: [16],// Array of valid card CVC lengths.cvcLength: [3],// Boolean indicating whether a valid card number should satisfy the Luhn check.luhn: true,// Regex used to format the card number. Each match is joined with a space.format: /(\d{1,4})/g}
When identifying a card type, the array is traversed in order until the card number matches a prefix in patterns. For this reason, patterns with higher specificity should appear towards the beginning of the array.
We recommend you turn autocomplete on for credit card forms, except for the CVC field (which should never be stored). You can do this by setting the autocomplete attribute:
请发表评论