Class: MonetaryWebToken

Type Definitions

MonetaryToken

Type:
object
Properties:
Name Type Description
Token String Token of user-entered account data.
Brand String Card brand of account represented by token.
ExpirationMonth String Expiration month of account represented by token.
ExpirationYear String Expiration year of account represented by token.
Last4 String Last four digits of account represented by token

Methods

(static) requestToken(publicAuthenticator, formName, callbackFunction) → {MonetaryToken}

Request a token from the Monetary Token API.
Parameters:
Name Type Description
publicAuthenticator String A Monetary public key.
formName String The name of the form containing account data entry elements.
callbackFunction function The function which to call with tokenization results.
Returns:
A MonetaryToken object containing the token properties of the tokenized user-entered account data.
Type
MonetaryToken

(static) validateCardNumber(cardNumber) → {Boolean}

Validate a credit card number with the Luhn Algorithm.
Parameters:
Name Type Description
cardNumber String A credit card number to validate.
Returns:
Credit card number validation status.
Type
Boolean

(static) validateCVV(cvv) → {Boolean}

Validate a credit card CVV.
Parameters:
Name Type Description
cvv String A credit card CVV/CVC to validate.
Returns:
Credit card CVV/CVC validation status.
Type
Boolean

(static) validateExpirationDate(month, year) → {Boolean}

Validate a credit card expiration date.
Parameters:
Name Type Description
month String A 2-digit representation of the card's expiration month.
year String A 2-digit representation of the card's expiration year.
Returns:
Credit card expiration date validation status.
Type
Boolean