Error codes
These error codes are provided as parameters to the errorCallback
s of tokenize
and
refreshCvv
.
The callbacks will receive an array of error codes, one for each detected error, for example:
[
{ "attribute": "number", "key": "errors.blank", "message": "Card number must not be empty" },
{ "attribute": "cvv", "key": "errors.blank", "message": "CVV code must not be empty" }
]
Card number
Empty
{
"attribute": "number",
"key": "errors.blank",
"message": "Card number must not be empty"
}
Invalid
{
"attribute": "number",
"key": "errors.invalid",
"message": "Invalid card number"
}
CVV/CVC code
Empty
{
"attribute": "cvv",
"key": "errors.blank",
"message": "CVV code must not be empty"
}
Invalid
{
"attribute": "cvv",
"key": "errors.invalid",
"message": "Invalid CVV code"
}
Expiration
Expiration month empty
{
"attribute": "month",
"key": "errors.blank",
"message": "Expiration month must not be empty"
}
Expiration month invalid
{
"attribute": "month",
"key": "errors.invalid",
"message": "Invalid expiration month"
}
Expiration year empty
{
"attribute": "year",
"key": "errors.blank",
"message": "Expiration year must not be empty"
}
Expiration year invalid
{
"attribute": "year",
"key": "errors.invalid",
"message": "Invalid expiration year"
}
Card expired
{
"attribute": "year",
"key": "errors.expired",
"message": "Card expired"
}
Card holder
Card holder empty
{
"attribute": "card_holder",
"key": "errors.blank",
"message": "Card holder must not be empty"
}
First name empty
{
"attribute": "first_name",
"key": "errors.blank",
"message": "First name must not be empty"
}
Last name empty
{
"attribute": "last_name",
"key": "errors.blank",
"message": "Last name must not be empty"
}