How to use the creditcards.validate function in creditcards

To help you get started, we’ve selected a few creditcards examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Automattic / delphin / app / lib / credit-card-details / validation.js View on Github external
function validateCreditCard( cardDetails ) {
	var expirationMonth = Number( cardDetails.expirationMonth ),
		expirationYear = Number( cardDetails.expirationYear );

	return creditcards.validate( {
		number: cardDetails.number,
		expirationMonth: expirationMonth,
		expirationYear: expirationYear,
		cvc: cardDetails.cvv
	} );
}