Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
$scope.$watch($viewValue, function eagerTypeCheck (number) {
number = card.parse(number)
ngModel.$ccEagerType = ccNumber.eagerType = card.type(number, true)
})
}
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 );
} );
};