Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
errors.postalCode = i18n.translate( 'Enter your postal code.' );
}
if ( ! values.expirationMonth ) {
errors.expirationMonth = i18n.translate( 'Choose the expiration month from the list.' );
}
if ( ! values.expirationYear ) {
errors.expirationYear = i18n.translate( 'Choose the expiration year from the list.' );
}
if ( ! values.countryCode ) {
errors.countryCode = i18n.translate( 'Choose your country from the list.' );
}
if ( ! errors.number && ! card.isValid( card.parse( values.number ) ) ) {
errors.number = i18n.translate( 'Enter your number as it is on your card.' );
}
if ( ! errors.cvv && ! cvc.isValid( values.cvv ) ) {
errors.cvv = i18n.translate( 'Enter your security code as it is on your card.' );
}
return errors;
};
ngModel.$validators.ccNumber = function validateCcNumber (number) {
return ngModel.$isEmpty(ngModel.$viewValue) || card.isValid(number)
}
ngModel.$validators.ccNumberType = function validateCcNumberType (number) {
if (ngModel.$isEmpty(ngModel.$viewValue)) return true
var type = $parse($attributes.ccType)($scope)
if (!type) card.isValid(number)
return array(type).some(partial(card.isValid, number))
}
}