cancel
Showing results for 
Search instead for 
Did you mean: 

Error - The field length is invalid for Card Number

Hi,

 

We encountered the following error in our production logs:

 

Result code: Error

Messages:

Result code: null; Message: The field length is invalid for Card Number.

 

Our UI validation enforces the credit card length to be between 13 and 16 characters, as documented on the authorize.net website.

 

Are there additional validations performed on the payment gateway side when an account is in PRODUCTION mode compared to a TEST account? Do we have to match the length of the credit card to the credit card type? For example, if a customer has a VISA card, but enters less than 16 characters, does that throw the above exception? If so, shouldn't it be the same in a TEST account?

 

Any help is greatly appreciated.

 

Thanks,

 

Mike

mikenikles
Member
4 REPLIES 4

I would guess that the length has to match the type of the card number you're sending. it's easily tested - just enter your own card number (with CCV 900 if on a test account and if you require CCV) and leave off a digit. If you get this error rather than an error saying the card number is invalid, then it is testing by card type.

 

VISA, for instance, always starts with a 4 and always has 16 digits.

TJPride
Expert

Hi,

 

I entered the test VISA card number I received from Authorize.Net when I signed up for a test account. The card number is 13 digits long and I was able to create an account in CIM.

 

Then, I used the same card number, but added a "9" at the end. So the card number length was 14 digits and it still worked.

 

Looks like it doesn't match the card type to the card number length. However, could there be a difference between a test account and a production account? Are production accounts stricter in verifying valid cards / types?

Unless an admin posts, I'm afraid the only way to find out is to test. Doesn't really matter, though, since an invalid card number will be rejected either way on production - just a question of which error message you're going to get back.

Hi Mike,

 

There are multiple ways we validate the card number, but the length is not one of them because it is not formally specified by the card companies.  Every Visa card you ever see may be 16 digits, but there is nothing in their standards that says a 15 digit Visa is absolutely invalid.

 

We primarily validate the following:

 

1.       We perform a mod-10 mathematical check on the card number to confirm that it at least has the possibility of being valid.

 

2.       We confirm that the bin number (first 6 digits of the card) is valid and assigned to one of our supported card types.  It is the BIN number that tells us the card type.

 

Things that are validated on production accounts are the card number (making sure its valid), expiration date (needs to be a future date), the card code and address—both will be verified if your settings are set to check this (Merchant Interface-Account tab-Security Settings- you will see AVS and Card Code Settings). You do not need to match the length of the credit card to the card type because you don’t need to pass the card type—it is automatically determined based on the credit card number entered.

 

Thanks!

-Joy

Joy
Administrator Administrator
Administrator