The CreditCardSwitchGen Generator generates many different types of credit card numbers that can be validated using the Luhn algorithm.

The credit card number generated is determined by the cardName parameter, which can be either a constant or a reference to another Attribute's Generator that generates an appropriate credit card name. The allowed creditCard names are the following: 

  • singleCounter
  • amercanExpress
  • masterCard
  • visa16
  • visa13
  • discover
  • dinersClub
  • jcb
  • carteBlanche
  • billMeLater
  • voyager
  • switchSolo16
  • switchSolo18
  • switchSolo19

Note: If a cardName match is not found, then 0000000000000000 is returned.


The following parameters may be configured for the CreditCardSwitchGen Generator. Items with an asterisk* are required. 

  • cardName* - Defines a constant cardName, list of cardNames, or a reference to another Attribute who's Generator generates an appropriate cardName.

Example 1: Generate Card Numbers for Discover, MasterCard, and Visa

In this example, two Generators have been linked. The ListGen Generator has been configured to generate the Card Name, which is then used by the CreditCardSwitchGen Generator to generate the actual card number. 

ListGen Generator Configuration:

Sample Output

Video Training

The following video can be used to see a quick tutorial on how to use the CreditCardSwitchGen Generator: