Brian Dunning's FileMaker Custom Functions

CreditCardType ( CreditCardNumber )

Returns Credit Card Type: Visa, MC, AmEx, Discover, China UnionPay. Supports 13-19 digit numbers.

  Average rating: 3.5 (2 votes) Log in to vote

Will Loving   Will Loving - Show more from this author
Dedication Technologies, Inc.
http://studioschoolpro.com

Share on Facebook Share on Twitter

  Sample input:
CreditCardType( 5128351752976780 )
CreditCardType( 6222170397307260323 ) [19-digit number]
CreditCardType( 4026757339553700 )
CreditCardType( 370793488154818 )
  Sample output:
MasterCard
China UnionPay
Visa
American Express

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

Updated: 2019-03-18 - This version includes new brands and updated card number ranges for Mastercard, UnionPay and others. It also handles new 17-19 numbers as well as older 13-14 digit numbers. For current card number ranges and brands, see http://en.wikipedia.org/wiki/Payment_card_number for current ranges.

This is a revison of Geoff Well's implementation of Brian Dunning's Card Validator.
It requires that the 3 Luhn custom functions - Luhn, LuhnDoubleEven, LuhnProduct - available at
http://www.briandunning.com/filemaker-custom-functions/

The following discontinued brands have been removed: Bankcard, Diners Club enRoute, Laser, Solo, Switch. I have also removed the detailed breakdown of various Visa cobrands such as Electron, Visa Purchasing, etc. Please reports any errors or suggested improvements in the comments at briandunning.com.

To obtain the Issuing Bank and type of card (debit or credit) for a specific BIN / IIN (Bank Identification Number / Issuing Institution Number), use the binlist.net online service

 

Comments

Lee Smith   Lee Smith
May 6, 2017
I think you need to add your Parameter to the name. i.e. CreditCardType (CreditCardNumber).

Because FileMaker is looking for CreditCardNumber as a parameter.

When I use the Clip Manager link, Clip Manager, provides reditCardTyp as the Parameter, which then has top be changed to CredCardNumber.

Lee
 
Will Loving   Will Loving, Dedication Technologies, Inc.
May 6, 2017
Thanks Lee. Should read correctly now.
 

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 20 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth: