Validating credit card number length
Online merchants may use IIN lookups to help validate transactions.
For example, if a card's IIN indicates a bank in one country, while the customer's billing address is in another, the transaction may call for extra scrutiny.
The card number is usually prominently embossed on the front of a payment card, and is encoded on the magnetic stripe and chip, but may be imprinted on the back of the card.
The payment card number differs from the Business Identifier Code (BIC/ISO 9362, a normalized code—also known as Business Identifier Code, Bank International Code or SWIFT code).
ABA is the Registration Authority for this standard and is responsible for allocating IINs to issuers.
International cards use the 36 prefix and are treated as Master Cards in Canada and the United States, but are treated as Diners Club cards elsewhere.
Diners Club International's website makes no reference to old 38 prefix numbers, and they can be presumed reissued under the 55 or 36 IIN prefix.
EMV Certification requires acceptance of a 19-digit Visa card (ADVT 6.1.1 Test Case 2) and Discover Card (E2E Test Plan v1.3, Test Case 06).
I hope, the following two links help to solve your problem.