How to use the creditcards.card.parse 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 bendrucker / angular-credit-cards / src / number.js View on Github external
$scope.$watch($viewValue, function eagerTypeCheck (number) {
            number = card.parse(number)
            ngModel.$ccEagerType = ccNumber.eagerType = card.type(number, true)
          })
        }
github Automattic / delphin / app / actions / checkout.js View on Github external
export const createPaygateToken = () => ( dispatch, getState ) => {
	const checkoutForm = getValues( getState().form.checkout ),
		cardDetails = {
			name: checkoutForm.name,
			number: card.parse( checkoutForm.number ),
			cvv: checkoutForm.cvv,
			expirationDate: checkoutForm.expirationMonth + checkoutForm.expirationYear,
			countryCode: checkoutForm.countryCode,
			postalCode: checkoutForm.postalCode
		};

	dispatch( { type: PAYGATE_TOKEN_CREATE } );

	return requestPaygateToken( cardDetails )
		.then( token => dispatch( { type: PAYGATE_TOKEN_CREATE_COMPLETE, token } ) )
		.catch( error => {
			dispatch( { type: PAYGATE_TOKEN_CREATE_FAIL, error } );
			return Promise.reject( error );
		} );
};